/* Max bytes to read/write in one go */ #define NVRW_CNT 0x20
staticunsignedint nvram_size; staticint nvram_fetch, nvram_store; staticchar nvram_buf[NVRW_CNT]; /* assume this is in the first 4GB */ static DEFINE_SPINLOCK(nvram_lock);
/* nvram_write_error_log * * We need to buffer the error logs into nvram to ensure that we have * the failure information to decode.
*/ int nvram_write_error_log(char * buff, int length, unsignedint err_type, unsignedint error_log_cnt)
{ int rc = nvram_write_os_partition(&rtas_log_partition, buff, length,
err_type, error_log_cnt); if (!rc) {
last_unread_rtas_event = ktime_get_real_seconds(); #ifdef CONFIG_PSTORE
last_rtas_event = ktime_get_real_seconds(); #endif
}
return rc;
}
/* nvram_read_error_log * * Reads nvram for error log for at most 'length'
*/ int nvram_read_error_log(char *buff, int length, unsignedint *err_type, unsignedint *error_log_cnt)
{ return nvram_read_partition(&rtas_log_partition, buff, length,
err_type, error_log_cnt);
}
/* This doesn't actually zero anything, but it sets the event_logged * word to tell that this event is safely in syslog.
*/ int nvram_clear_error_log(void)
{
loff_t tmp_index; int clear_word = ERR_FLAG_ALREADY_LOGGED; int rc;
/* * Are we using the ibm,rtas-log for oops/panic reports? And if so, * would logging this oops/panic overwrite an RTAS event that rtas_errd * hasn't had a chance to read and process? Return 1 if so, else 0. * * We assume that if rtas_errd hasn't read the RTAS event in * NVRAM_RTAS_READ_TIMEOUT seconds, it's probably not going to.
*/ int clobbering_unread_rtas_event(void)
{ return (oops_log_partition.index == rtas_log_partition.index
&& last_unread_rtas_event
&& ktime_get_real_seconds() - last_unread_rtas_event <=
NVRAM_RTAS_READ_TIMEOUT);
}
staticint __init pseries_nvram_init_log_partitions(void)
{ int rc;
/* Scan nvram for partitions */
nvram_scan_partitions();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.