summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S
blob: 126c7b49b3c61a8d63b28dae78ccab65297e0c0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#------------------------------------------------------------------------------
#
# LoongArch interrupt enable 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(EnableLocalInterrupts)
ASM_GLOBAL ASM_PFX(EnableInterrupts)

#/**
#  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, BIT2
  csrxchg $t0, $t0, LOONGARCH_CSR_CRMD
  jirl    $zero, $ra, 0
  .end