MdePkg: Add LoongArch64 support for StackCheckLib

Added LoongArch64 stack cookie interrupt instance, calling `CpuBreakpoint`
to stop the CPU.

Signed-off-by: Chao Li <lichao@loongson.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Chao Li 2026-06-29 09:42:23 +08:00 committed by mergify[bot]
parent 7779b1a042
commit 8756401a02
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,21 @@
#------------------------------------------------------------------------------
#
# LoongArch64/StackCookieInterrupt.S
#
# Copyright (c) 2026, Loongson Technology Corporation Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#------------------------------------------------------------------------------
#include <Library/BaseLib.h>
ASM_GLOBAL ASM_PFX(TriggerStackCookieInterrupt)
#/**
# Calling `CpuBreakpoint` to create a breakpoint to the LoongArch64 exception handle and stop.
#**/
ASM_PFX(TriggerStackCookieInterrupt):
bl CpuBreakpoint
jirl $zero, $ra, 0
.end

View file

@ -30,6 +30,9 @@
AArch64/StackCookieInterrupt.S |GCC
AArch64/StackCookieInterrupt.asm |MSFT
[Sources.LOONGARCH64]
LoongArch64/StackCookieInterrupt.S | GCC
[Packages]
MdePkg/MdePkg.dec