call_int.s

来自「可以提供s3c44b0x开发配置帮助的英蓓特公司s3cev40的通用配置程序」· S 代码 · 共 72 行

S
72
字号
/*
#------------------------------------------------------------------------------
#- Entry function:	void	irqEntry(void)
#- Extern function:	void	isrHandle(void)
#------------------------------------------------------------------------------
*/
		.macro IRQHandle isrHandle:
		stmdb	sp!, {r0-r11, ip, lr}	/* save r0-r11, ip, lr */
		ldr		r0, =\isrHandle
		mov		lr, pc
		bx		r0						/* jump to user_handle(void) */
		ldmia	sp!, {r0-r11, ip, lr}	/* restore r0, ip, lr */
		subs	pc, r14, #4				/* return from interrupt */
		.endm

/* Examples showed as following:
@ void TSInt (void); ---> The interrupt handle function write as C program, it is user application func.
@ isrEINT2           ---> It is the interrupt vactor entry function to jump here, call by INTERRUPT  VECTOR TABLE.
@ TSP_INT            ---> '#define TSP_INT' or '.EQU TSP_INT' in source file (except this file).
       .extern TSInt
       .global isrEINT2	
isrEINT2:
.ifdef TSP_INT
       IRQHandle TSInt
.endif
*/
@--------------------------------------------
       .extern KeyboardInt
       .global isrEINT1
isrEINT1: 
.ifdef KEY_INT
       IRQHandle KeyboardInt
.endif

       .extern TSInt
       .global isrEINT2
isrEINT2:
.ifdef TSP_INT
       IRQHandle TSInt
.endif

       .extern Eint4567Isr
       .global isrEint4567
isrEint4567:
.ifdef BUT_INT
       IRQHandle Eint4567Isr
.endif

       .extern timer_Int
       .global isrTIMER0
isrTIMER0: 
.ifdef T0_INT
       IRQHandle timer_Int
.endif

       .extern rtc_int
       .global isrRTC
isrRTC:
.ifdef RTC_INT
       IRQHandle rtc_int
.endif

       .extern BDMA0_Done
       .global isrBDMA0
isrBDMA0:
.ifdef IIS_INT
       IRQHandle BDMA0_Done
.endif

@-------------------------------------------- if no isr, return directly
		subs	pc, r14, #4				/* return from interrupt */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?