2018-06-27 15:11:33 +02:00
|
|
|
#------------------------------------------------------------------------------
|
2009-08-19 16:02:07 +02:00
|
|
|
#
|
|
|
|
# GetInterruptState() function for ARM
|
|
|
|
#
|
2018-06-27 15:11:33 +02:00
|
|
|
# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
2010-04-23 18:00:47 +02:00
|
|
|
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
2019-04-04 01:06:00 +02:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
2009-08-19 16:02:07 +02:00
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
.text
|
|
|
|
.p2align 2
|
2011-02-01 06:01:35 +01:00
|
|
|
GCC_ASM_EXPORT (GetInterruptState)
|
2009-08-19 16:02:07 +02:00
|
|
|
|
|
|
|
#/**
|
|
|
|
# Retrieves the current CPU interrupt state.
|
|
|
|
#
|
|
|
|
# Returns TRUE is interrupts are currently enabled. Otherwise
|
|
|
|
# returns FALSE.
|
|
|
|
#
|
|
|
|
# @retval TRUE CPU interrupts are enabled.
|
|
|
|
# @retval FALSE CPU interrupts are disabled.
|
|
|
|
#
|
|
|
|
#**/
|
|
|
|
#
|
|
|
|
#BOOLEAN
|
|
|
|
#EFIAPI
|
|
|
|
#GetInterruptState (
|
|
|
|
# VOID
|
|
|
|
# );
|
|
|
|
#
|
2010-12-15 01:58:34 +01:00
|
|
|
ASM_PFX(GetInterruptState):
|
2009-08-19 16:02:07 +02:00
|
|
|
mrs R0, CPSR
|
2009-08-19 16:09:31 +02:00
|
|
|
tst R0, #0x80 @Check if IRQ is enabled.
|
2009-08-19 16:02:07 +02:00
|
|
|
moveq R0, #1
|
|
|
|
movne R0, #0
|
|
|
|
bx LR
|