Skip to content

Commit 2110725

Browse files
committed
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 <[email protected]>
1 parent 6b02c9f commit 2110725

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/xtensa/core/vector_handlers.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void xtensa_dump_stack(const void *stack)
153153
bsa = frame->ptr_to_bsa;
154154

155155
/* Calculate number of high registers. */
156-
num_high_regs = (uint8_t *)bsa - (uint8_t *)frame + sizeof(void *);
156+
num_high_regs = (uint8_t *)bsa - ((uint8_t *)frame + sizeof(void *));
157157
num_high_regs /= sizeof(uintptr_t);
158158

159159
/* And high registers are always comes in 4 in a block. */

0 commit comments

Comments
 (0)