mirror of
https://github.com/acidanthera/audk.git
synced 2025-08-16 07:08:11 +02:00
Adding LoongArch local interrupt function set, which is used to control the opening or closing of the local interrupt when the global interrupt is enabled. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Chao Li <lichao@loongson.cn> Acked-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
34 lines
876 B
ArmAsm
34 lines
876 B
ArmAsm
#------------------------------------------------------------------------------
|
|
#
|
|
# LoongArch interrupt disable operations
|
|
#
|
|
# 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(DisableLocalInterrupts)
|
|
ASM_GLOBAL ASM_PFX(DisableInterrupts)
|
|
|
|
#/**
|
|
# Disables local CPU interrupts.
|
|
#
|
|
# @param Needs to disable local interrupt bit.
|
|
#**/
|
|
ASM_PFX(DisableLocalInterrupts):
|
|
csrxchg $zero, $a0, LOONGARCH_CSR_ECFG
|
|
jirl $zero, $ra, 0
|
|
|
|
#/**
|
|
# Disables global CPU interrupts.
|
|
#**/
|
|
ASM_PFX(DisableInterrupts):
|
|
li.w $t0, BIT2
|
|
csrxchg $zero, $t0, LOONGARCH_CSR_CRMD
|
|
jirl $zero, $ra, 0
|
|
.end
|