📄 irq_ven.s
字号:
; ********************************************************************************
; *
; * ARM Strategic Support Group
; *
; ********************************************************************************
; ********************************************************************************
; *
; * Module : irq_ven.s
; * Description : Angel IRQ veneer code
; *
; * This code is written to allow chaining of the
; * example IRQ code with the Angel IRQ handler
; * caring for the registers using the stack.
; *
; * Tool Chain : ARM Developer Suite v1.0
; * Platform : Evaluator7T
; * History :
; *
; * 970326 DBrooke
; * - created example code
; *
; * 980420 MEchavarria
; * - modified for Sharp 77790A
; * - added timer counter interrupt handler
; *
; * 980429 ASloss
; * - added button interrupt handler
; *
; * 2000-04-04 Andrew N. Sloss
; * - ported to the Evaluator7T
; *
; * Notes :
; *
; * The AREA must have
; * - the attribute READONLY, otherwise the linker will not
; * place it in ROM.
; * - the attribute CODE, otherwise the assembler will not
; * let us put any code in this AREA
; *
; ********************************************************************************
; ********************************************************************************
; * IMPORT/EXPORT
; ********************************************************************************
IMPORT irq_buttonpress
EXPORT handler_irq
EXPORT Angel_IRQ_Address
EXPORT SetupSVC ; just a stub, angel's done the job already
SYSCFG EQU 0x03FF0000
AREA irq, CODE, READONLY
; ********************************************************************************
; * DATA
; ********************************************************************************
INTPND DCD 0x03ff4004 ;IRQ controller status register address
; *********************************************************************************
; * ROUTINES
; *********************************************************************************
; -- irqHandler -------------------------------------------------------------------
;
; Description : handles the IRQ interrupt and determines the source and then
; vectors to the correct interrupt rountine.
;
handler_irq
STMFD sp!, {r0 - r3, LR} ; Maintain Stack using APCS standard
LDR r0, INTPND ; Get address of the IRQ status Reg
LDR r0, [r0] ; Read the status reg byte
TST r0, #0x0001 ; Is it a button press ?
BNE handler_event_button ; Branch if button is pressed
LDMFD sp!, {r0 - r3, lr} ;If not then its an Angel request
LDR pc, Angel_IRQ_Address ;remove the regs from the stack and call
;the routine
;
; **********************************************************************************
; EVENT: Button
; **********************************************************************************
;
handler_event_button
BL irq_buttonpress ; if this point is reached then the irq is from the
; button
LDMFD sp!, {r0 - r3,lr} ; return from the irq_buttonpress routine - restore
; the registers
subs pc, lr, #4 ; and return from the interrupt
SetupSVC
MOV pc, lr ; return
AREA var, DATA, READWRITE
Angel_IRQ_Address
DCD 0x00000000 ;Scratch location for Angel IRQ Handler address
END
; ***********************************************************************************
; * End of irq_ven.c
; ***********************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -