Commit c981f0c0 authored by David Mosberger's avatar David Mosberger

ia64: Fix SAL processor-log info handling. Based on patch by

	Keith Owens.
parent 2a9f136d
......@@ -825,7 +825,7 @@ ia64_init_handler (struct pt_regs *regs)
plog_ptr=(ia64_err_rec_t *)IA64_LOG_CURR_BUFFER(SAL_INFO_TYPE_INIT);
proc_ptr = &plog_ptr->proc_err;
ia64_process_min_state_save(&proc_ptr->processor_static_info.min_state_area);
ia64_process_min_state_save(&SAL_LPI_PSI_INFO(proc_ptr)->min_state_area);
/* Clear the INIT SAL logs now that they have been saved in the OS buffer */
ia64_sal_clear_state_info(SAL_INFO_TYPE_INIT);
......@@ -1620,7 +1620,7 @@ ia64_log_proc_dev_err_info_print (sal_log_processor_info_t *slpi,
* absent. Also, current implementations only allocate space for number of
* elements used. So we walk the data pointer from here on.
*/
p_data = &slpi->cache_check_info[0];
p_data = &slpi->info[0];
/* Print the cache check information if any*/
for (i = 0 ; i < slpi->valid.num_cache_check; i++, p_data++)
......
......@@ -336,6 +336,11 @@ typedef struct sal_processor_static_info {
struct ia64_fpreg fr[128];
} sal_processor_static_info_t;
struct sal_cpuid_info {
u64 regs[5];
u64 reserved;
};
typedef struct sal_log_processor_info {
sal_log_section_hdr_t header;
struct {
......@@ -354,18 +359,34 @@ typedef struct sal_log_processor_info {
u64 proc_error_map;
u64 proc_state_parameter;
u64 proc_cr_lid;
sal_log_mod_error_info_t cache_check_info[16];
sal_log_mod_error_info_t tlb_check_info[16];
sal_log_mod_error_info_t bus_check_info[16];
sal_log_mod_error_info_t reg_file_check_info[16];
sal_log_mod_error_info_t ms_check_info[16];
struct {
u64 regs[5];
u64 reserved;
} cpuid_info;
sal_processor_static_info_t processor_static_info;
/*
* The rest of this structure consists of variable-length arrays, which can't be
* expressed in C.
*/
sal_log_mod_error_info_t info[0];
/*
* This is what the rest looked like if C supported variable-length arrays:
*
* sal_log_mod_error_info_t cache_check_info[.valid.num_cache_check];
* sal_log_mod_error_info_t tlb_check_info[.valid.num_tlb_check];
* sal_log_mod_error_info_t bus_check_info[.valid.num_bus_check];
* sal_log_mod_error_info_t reg_file_check_info[.valid.num_reg_file_check];
* sal_log_mod_error_info_t ms_check_info[.valid.num_ms_check];
* struct sal_cpuid_info cpuid_info;
* sal_processor_static_info_t processor_static_info;
*/
} sal_log_processor_info_t;
/* Given a sal_log_processor_info_t pointer, return a pointer to the processor_static_info: */
#define SAL_LPI_PSI_INFO(l) \
({ sal_log_processor_info_t *_l = (l); \
((sal_processor_static_info_t *) \
((char *) _l->info + ((_l->valid.num_cache_check + _l->valid.num_tlb_check \
+ _l->valid.num_bus_check + _l->valid.num_reg_file_check \
+ _l->valid.num_ms_check) * sizeof(sal_log_mod_error_info_t) \
+ sizeof(struct sal_cpuid_info)))); \
})
/* platform error log structures */
typedef struct sal_log_mem_dev_err_info {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment