Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67197
b: refs/heads/master
c: 0f2342c
h: refs/heads/master
i:
  67195: 085c6cd
v: v3
  • Loading branch information
Linas Vepstas authored and Paul Mackerras committed Aug 17, 2007
1 parent d730047 commit 02a1d75
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 79c0108d1b9db4864ab77b2a95dfa04f2dcf264c
refs/heads/master: 0f2342c85df4248bc1cd72421b13969a0782ed6a
10 changes: 5 additions & 5 deletions trunk/arch/powerpc/kernel/nvram_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ static struct nvram_partition * nvram_part;
static long nvram_error_log_index = -1;
static long nvram_error_log_size = 0;

extern volatile int error_log_cnt;

struct err_log_info {
int error_type;
unsigned int seq_num;
Expand Down Expand Up @@ -627,7 +625,8 @@ void __exit nvram_cleanup(void)
* sequence #: The unique sequence # for each event. (until it wraps)
* error log: The error log from event_scan
*/
int nvram_write_error_log(char * buff, int length, unsigned int err_type)
int nvram_write_error_log(char * buff, int length,
unsigned int err_type, unsigned int error_log_cnt)
{
int rc;
loff_t tmp_index;
Expand Down Expand Up @@ -665,7 +664,8 @@ int nvram_write_error_log(char * buff, int length, unsigned int err_type)
*
* Reads nvram for error log for at most 'length'
*/
int nvram_read_error_log(char * buff, int length, unsigned int * err_type)
int nvram_read_error_log(char * buff, int length,
unsigned int * err_type, unsigned int * error_log_cnt)
{
int rc;
loff_t tmp_index;
Expand All @@ -691,7 +691,7 @@ int nvram_read_error_log(char * buff, int length, unsigned int * err_type)
return rc;
}

error_log_cnt = info.seq_num;
*error_log_cnt = info.seq_num;
*err_type = info.error_type;

return 0;
Expand Down
7 changes: 4 additions & 3 deletions trunk/arch/powerpc/platforms/pseries/rtasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static int full_rtas_msgs = 0;
/* Stop logging to nvram after first fatal error */
static int no_more_logging;

volatile int error_log_cnt = 0;
static int error_log_cnt;

/*
* Since we use 32 bit RTAS, the physical address of this must be below
Expand Down Expand Up @@ -218,7 +218,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)

/* Write error to NVRAM */
if (!no_more_logging && !(err_type & ERR_FLAG_BOOT))
nvram_write_error_log(buf, len, err_type);
nvram_write_error_log(buf, len, err_type, error_log_cnt);

/*
* rtas errors can occur during boot, and we do want to capture
Expand Down Expand Up @@ -412,7 +412,8 @@ static int rtasd(void *unused)

/* See if we have any error stored in NVRAM */
memset(logdata, 0, rtas_error_log_max);
rc = nvram_read_error_log(logdata, rtas_error_log_max, &err_type);
rc = nvram_read_error_log(logdata, rtas_error_log_max,
&err_type, &error_log_cnt);

if (!rc) {
if (err_type != ERR_FLAG_ALREADY_LOGGED) {
Expand Down
6 changes: 4 additions & 2 deletions trunk/include/asm-powerpc/nvram.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ struct nvram_partition {
};


extern int nvram_write_error_log(char * buff, int length, unsigned int err_type);
extern int nvram_read_error_log(char * buff, int length, unsigned int * err_type);
extern int nvram_write_error_log(char * buff, int length,
unsigned int err_type, unsigned int err_seq);
extern int nvram_read_error_log(char * buff, int length,
unsigned int * err_type, unsigned int *err_seq);
extern int nvram_clear_error_log(void);
extern struct nvram_partition *nvram_find_partition(int sig, const char *name);

Expand Down

0 comments on commit 02a1d75

Please sign in to comment.