📄 xllp_intc.s
字号:
;******************************************************************************
;
; COPYRIGHT (C) 2002 Intel Corporation.
;
; This software as well as the software described in it is furnished under
; license and may only be used or copied in accordance with the terms of the
; license. The information in this file is furnished for informational use
; only, is subject to change without notice, and should not be construed as
; a commitment by Intel Corporation. Intel Corporation assumes no
; responsibility or liability for any errors or inaccuracies that may appear
; in this document or any software that may be provided in association with
; this document.
;
; Except as permitted by such license, no part of this document may be
; reproduced, stored in a retrieval system, or transmitted in any form or by
; any means without the express written consent of Intel Corporation.
;
; FILENAME: xllp_intc.s
;
; PURPOSE: Provides low level INTC primitive functions written specifically
; for the Bulverde/Mainstone processor/platform.
;
;******************************************************************************
INCLUDE xlli_Bulverde_defs.inc
;
; List of primitive functions in this module:
;
EXPORT XllpIntcDisableInts
EXPORT XllpIntcRestoreInts
AREA |.text|, CODE, READONLY, ALIGN=5 ; Align =5 required for "ALIGN 32" to work
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; UINT32 XllpIntcDisableInts (void)
;;
;; Disable IRQ and FIQ interrupts by setting the I+F bits in the CPSR.
;;
;; Returns (R0): the state of the I+F bits before they were set
;;
;; Assumes caller is running in privileged mode.
;;
XllpIntcDisableInts FUNCTION
mov r1, #(xlli_CPSR_I_Bit:OR:xlli_CPSR_F_Bit)
mrs r2, cpsr
and r0, r2, r1 ; This is the return with the current int flags
orr r2, r2, r1
msr cpsr_c, r2 ; Only interested in control fields
IF :DEF: Interworking
IF Interworking :LOR: Thumbing
bx lr
ELSE
mov pc, lr ; return
ENDIF
ELSE
mov pc, lr ; return
ENDIF
ENDFUNC
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; void XllpIntcRestoreInts (UINT32)
;;
;; Set the I+F bits in the CPSR to the values received in R0.
;; - Protects against changing any other bits the CPSR.
;; - If the value returned by pmDisableInts() is used as the parameter,
;; this function restores the interrupt enable/disable state to
;; that which existed at the time pmDisableInts() was invoked.
;;
;; Assumes caller is running in privileged mode.
;;
XllpIntcRestoreInts FUNCTION
mov r1, #(xlli_CPSR_I_Bit:OR:xlli_CPSR_F_Bit)
and r0, r0, r1 ; Isolate the I+F bits
mrs r2, cpsr ; Get existing settings
bic r2, r2, r1 ; Clear out the flag locations
orr r2, r2, r0 ; Set the restored flags in place
msr cpsr_c, r2 ; Only interested in control fields
IF :DEF: Interworking
IF Interworking :LOR: Thumbing
bx lr
ELSE
mov pc, lr ; return
ENDIF
ELSE
mov pc, lr ; return
ENDIF
ENDFUNC
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -