include/cper.h: Update cper_ia32x64_context_t
Use flexible array member cper_ia32x64_context to simplify the struct usage. Change-Id: I729cb914031b55b2b58bc9e459ee0ea15c7626e8 Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/90479 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
14a7a2315e
commit
e393fd00a4
2 changed files with 3 additions and 5 deletions
|
|
@ -550,8 +550,6 @@ cper_ia32x64_context_t *cper_new_ia32x64_context_msr(
|
|||
cper_ia32x64_proc_error_section_t *x86err, u32 addr, int num)
|
||||
{
|
||||
cper_ia32x64_context_t *ctx;
|
||||
int i;
|
||||
msr_t *dest;
|
||||
|
||||
ctx = new_cper_ia32x64_ctx(status, x86err, CPER_IA32X64_CTX_MSR, num * sizeof(msr_t));
|
||||
if (!ctx)
|
||||
|
|
@ -564,9 +562,9 @@ cper_ia32x64_context_t *cper_new_ia32x64_context_msr(
|
|||
*/
|
||||
ctx->msr_addr = addr;
|
||||
|
||||
dest = (msr_t *)((u8 *)(ctx + 1)); /* point to the Register Array */
|
||||
msr_t *dest = (msr_t *)(ctx->register_array); /* point to the Register Array */
|
||||
|
||||
for (i = 0 ; i < num ; i++)
|
||||
for (int i = 0 ; i < num ; i++)
|
||||
*(dest + i) = rdmsr(addr + i);
|
||||
return ctx;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ typedef struct cper_ia32x64_context {
|
|||
u16 array_size;
|
||||
u32 msr_addr;
|
||||
u64 mmap_addr;
|
||||
/* N bytes of register array */
|
||||
u8 register_array[]; /* N bytes of register array */
|
||||
} __packed cper_ia32x64_context_t;
|
||||
|
||||
/* IA32/X64 Processor Context Information, Types field (Table N.13) */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue