diff options
author | Leif Lindholm <quic_llindhol@quicinc.com> | 2020-10-01 19:37:09 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-10-02 15:48:02 +0000 |
commit | 80bbea192aa44ab664ba8be29ac06c83f246e99c (patch) | |
tree | 9e0dad0e166fb9b773e3f11d35ca8e6903f38e33 | |
parent | cbf0e4f5b370a874ace11a0b20533e891dbc25ab (diff) | |
download | edk2-80bbea192aa44ab664ba8be29ac06c83f246e99c.zip edk2-80bbea192aa44ab664ba8be29ac06c83f246e99c.tar.gz edk2-80bbea192aa44ab664ba8be29ac06c83f246e99c.tar.bz2 |
MdePkg/BaseLib: add ASSERT in ARM* SetJump implementations
The SetJump comment header states that:
If JumpBuffer is NULL, then ASSERT().
However, this was not currently done.
Add a call to InternalAssertJumpBuffer.
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
-rw-r--r-- | MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S | 8 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S index 78db9b3..de79ad3 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S @@ -46,6 +46,14 @@ GCC_ASM_EXPORT(InternalLongJump) #
ASM_PFX(SetJump):
AARCH64_BTI(c)
+#ifndef MDEPKG_NDEBUG
+ stp x29, x30, [sp, #-32]!
+ mov x29, sp
+ str x0, [sp, #16]
+ bl InternalAssertJumpBuffer
+ ldr x0, [sp, #16]
+ ldp x29, x30, [sp], #32
+#endif
mov x16, sp // use IP0 so save SP
#define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS]
#define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS]
diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm index d8b267a..c2774ee 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm @@ -44,6 +44,14 @@ ; );
;
SetJump
+#ifndef MDEPKG_NDEBUG
+ stp x29, x30, [sp, #-32]!
+ mov x29, sp
+ str x0, [sp, #16]
+ bl InternalAssertJumpBuffer
+ ldr x0, [sp, #16]
+ ldp x29, x30, [sp], #32
+#endif
mov x16, sp // use IP0 so save SP
#define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS]
#define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS]
|