xtensa: fix num_high_regs calculation when dumping stack

The calculation of number of high registers is not entirely
correct. We need to get past the pointer to BSA in the stack
frame before reaching the high registers. The location address
difference between the BSA and start of high registers then
can be used to calculate how many high registers in the stack
frame. So correct the start location of high registers in
the calculation as it was incorrect before. Though the result
would be the same as further divisions would mask this error.
However, it is better to correct this for readability.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2025-05-16 10:08:06 -07:00 committed by Daniel DeGrasse
commit d00095c4a6

View file

@ -153,7 +153,7 @@ void xtensa_dump_stack(const void *stack)
bsa = frame->ptr_to_bsa;
/* Calculate number of high registers. */
num_high_regs = (uint8_t *)bsa - (uint8_t *)frame + sizeof(void *);
num_high_regs = (uint8_t *)bsa - ((uint8_t *)frame + sizeof(void *));
num_high_regs /= sizeof(uintptr_t);
/* And high registers are always comes in 4 in a block. */