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:
parent
f3255fdd03
commit
d00095c4a6
1 changed files with 1 additions and 1 deletions
|
@ -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. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue