aarch64: Clarify the initial adjustments to sp for kernel exception entry

The first store-pair instruction in save_registers_head decrements the
stack pointer to create room for most of the trapframe (and the
redzone area for nested exceptions).  However, the expression was a
bit non-intuitive as it was using an expression without a leading
negative sign to adjust the stack pointer.  Rewrite the expression so
that it is more clearly a negative adjustment to the stack pointer.

Suggested by:	andrew
Reviewed by:	andrew
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D52514
This commit is contained in:
John Baldwin
2025-09-16 07:21:39 -04:00
parent da20d88599
commit 7314f78b24
+2 -2
View File
@@ -43,9 +43,9 @@
.macro save_registers_head el
.if \el == 1
mov x18, sp
stp x0, x1, [sp, #(TF_X - TF_SIZE - 128)]!
stp x0, x1, [sp, #-(TF_SIZE - TF_X + 128)]!
.else
stp x0, x1, [sp, #(TF_X - TF_SIZE)]!
stp x0, x1, [sp, #-(TF_SIZE - TF_X)]!
.endif
stp x2, x3, [sp, #(2 * 8)]
stp x4, x5, [sp, #(4 * 8)]