uapi: xtensa: change ar to variable array

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This commit is contained in:
Janusz Jankowski 2019-05-15 14:33:29 +02:00
parent 0c30369f98
commit b780605eaf
3 changed files with 9 additions and 5 deletions

View File

@ -26,6 +26,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
* Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
* Janusz Jankowski <janusz.jankowski@linux.intel.com>
* *
*/ */
@ -41,6 +42,10 @@
/* architecture specific stack frames to dump */ /* architecture specific stack frames to dump */
#define ARCH_STACK_DUMP_FRAMES 32 #define ARCH_STACK_DUMP_FRAMES 32
/* xtensa core specific oops size */
#define ARCH_OOPS_SIZE (sizeof(struct sof_ipc_dsp_oops_xtensa) \
+ (XCHAL_NUM_AREGS * sizeof(uint32_t)))
void arch_dump_regs_a(void *dump_buf, uint32_t ps); void arch_dump_regs_a(void *dump_buf, uint32_t ps);
static inline void *arch_get_stack_ptr(void) static inline void *arch_get_stack_ptr(void)
@ -60,7 +65,7 @@ static inline void fill_core_dump(struct sof_ipc_dsp_oops_xtensa *oops,
uintptr_t *epc1) uintptr_t *epc1)
{ {
oops->arch_hdr.arch = ARCHITECTURE_ID; oops->arch_hdr.arch = ARCHITECTURE_ID;
oops->arch_hdr.totalsize = sizeof(*oops); oops->arch_hdr.totalsize = ARCH_OOPS_SIZE;
#if XCHAL_HW_CONFIGID_RELIABLE #if XCHAL_HW_CONFIGID_RELIABLE
oops->plat_hdr.configidhi = XCHAL_HW_CONFIGID0; oops->plat_hdr.configidhi = XCHAL_HW_CONFIGID0;
oops->plat_hdr.configidlo = XCHAL_HW_CONFIGID1; oops->plat_hdr.configidlo = XCHAL_HW_CONFIGID1;
@ -85,7 +90,7 @@ static inline void arch_dump_regs(uint32_t ps, uintptr_t stack_ptr,
fill_core_dump(buf, ps, stack_ptr, epc1); fill_core_dump(buf, ps, stack_ptr, epc1);
dcache_writeback_region(buf, sizeof(struct sof_ipc_dsp_oops_xtensa)); dcache_writeback_region(buf, ARCH_OOPS_SIZE);
} }
#endif #endif

View File

@ -76,7 +76,7 @@ struct sof_ipc_dsp_oops_xtensa {
uint32_t widnowbase; uint32_t widnowbase;
uint32_t windowstart; uint32_t windowstart;
uint32_t excsave1; uint32_t excsave1;
uint32_t ar[XCHAL_NUM_AREGS]; uint32_t ar[];
} __attribute__((packed)); } __attribute__((packed));
#endif #endif

View File

@ -62,8 +62,7 @@ void panic_rewind(uint32_t p, uint32_t stack_rewind_frames,
/* disable all IRQs */ /* disable all IRQs */
oldps = interrupt_global_disable(); oldps = interrupt_global_disable();
ext_offset = (void *)mailbox_get_exception_base() + ext_offset = (void *)mailbox_get_exception_base() + ARCH_OOPS_SIZE;
sizeof(struct sof_ipc_dsp_oops_xtensa);
/* dump panic info, filename ane linenum */ /* dump panic info, filename ane linenum */
dump_panicinfo(ext_offset, panic_info); dump_panicinfo(ext_offset, panic_info);