summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S')
-rw-r--r--MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S22
1 files changed, 17 insertions, 5 deletions
diff --git a/MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S b/MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S
index 3c34fb2cdd..126c7b49b3 100644
--- a/MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S
+++ b/MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S
@@ -1,21 +1,33 @@
#------------------------------------------------------------------------------
#
-# LoongArch interrupt enable
+# LoongArch interrupt enable operations
#
-# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
+# Copyright (c) 2024, Loongson Technology Corporation Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#------------------------------------------------------------------------------
+#include <Base.h>
+#include <Register/LoongArch64/Csr.h>
+
+ASM_GLOBAL ASM_PFX(EnableLocalInterrupts)
ASM_GLOBAL ASM_PFX(EnableInterrupts)
#/**
-# Enables CPU interrupts.
+# Enables local CPU interrupts.
+#
+# @param Needs to enable local interrupt bit.
#**/
+ASM_PFX(EnableLocalInterrupts):
+ csrxchg $a0, $a0, LOONGARCH_CSR_ECFG
+ jirl $zero, $ra, 0
+#/**
+# Enables global CPU interrupts.
+#**/
ASM_PFX(EnableInterrupts):
- li.w $t0, 0x4
- csrxchg $t0, $t0, 0x0
+ li.w $t0, BIT2
+ csrxchg $t0, $t0, LOONGARCH_CSR_CRMD
jirl $zero, $ra, 0
.end