diff options
Diffstat (limited to 'include/bl31')
-rw-r--r-- | include/bl31/context.h | 16 | ||||
-rw-r--r-- | include/bl31/cpu_data.h | 23 |
2 files changed, 24 insertions, 15 deletions
diff --git a/include/bl31/context.h b/include/bl31/context.h index 82d0c9ce..3bf49806 100644 --- a/include/bl31/context.h +++ b/include/bl31/context.h @@ -76,21 +76,13 @@ * 32-bits wide but are stored as 64-bit values for convenience ******************************************************************************/ #define CTX_EL3STATE_OFFSET (CTX_GPREGS_OFFSET + CTX_GPREGS_END) -#define CTX_VBAR_EL3 0x0 /* Currently unused */ +#define CTX_SCR_EL3 0x0 #define CTX_RUNTIME_SP 0x8 #define CTX_SPSR_EL3 0x10 #define CTX_ELR_EL3 0x18 -#define CTX_SCR_EL3 0x20 -#define CTX_SCTLR_EL3 0x28 -#define CTX_CPTR_EL3 0x30 -/* Unused space to allow registers to be stored as pairs */ -#define CTX_CNTFRQ_EL0 0x40 -#define CTX_MAIR_EL3 0x48 -#define CTX_TCR_EL3 0x50 -#define CTX_TTBR0_EL3 0x58 -#define CTX_DAIF_EL3 0x60 -/* Unused space to honour alignment requirements */ -#define CTX_EL3STATE_END 0x70 +#define CTX_CPTR_EL3 0x20 +#define CTX_CNTFRQ_EL0 0x28 +#define CTX_EL3STATE_END 0x30 /******************************************************************************* * Constants that allow assembler code to access members of and the diff --git a/include/bl31/cpu_data.h b/include/bl31/cpu_data.h index 5f45f144..ef0b68cf 100644 --- a/include/bl31/cpu_data.h +++ b/include/bl31/cpu_data.h @@ -32,9 +32,14 @@ #define __CPU_DATA_H__ /* Offsets for the cpu_data structure */ -#define CPU_DATA_CRASH_STACK_OFFSET 0x10 +#define CPU_DATA_CRASH_BUF_OFFSET 0x10 +#if CRASH_REPORTING +#define CPU_DATA_LOG2SIZE 7 +#else #define CPU_DATA_LOG2SIZE 6 - +#endif +/* need enough space in crash buffer to save 8 registers */ +#define CPU_DATA_CRASH_BUF_SIZE 64 #ifndef __ASSEMBLY__ #include <arch_helpers.h> @@ -61,9 +66,21 @@ typedef struct cpu_data { void *cpu_context[2]; - uint64_t crash_stack; +#if CRASH_REPORTING + uint64_t crash_buf[CPU_DATA_CRASH_BUF_SIZE >> 3]; +#endif } __aligned(CACHE_WRITEBACK_GRANULE) cpu_data_t; +#if CRASH_REPORTING +/* verify assembler offsets match data structures */ +CASSERT(CPU_DATA_CRASH_BUF_OFFSET == __builtin_offsetof + (cpu_data_t, crash_buf), + assert_cpu_data_crash_stack_offset_mismatch); +#endif + +CASSERT((1 << CPU_DATA_LOG2SIZE) == sizeof(cpu_data_t), + assert_cpu_data_log2size_mismatch); + struct cpu_data *_cpu_data_by_index(uint32_t cpu_index); struct cpu_data *_cpu_data_by_mpidr(uint64_t mpidr); |