www.pudn.com > vrtxtst.rar > INTENDIS.S


;************************************************************************* 
; 
; 
;  IMPORTANT - USE OF THIS SOFTWARE IS SUBJECT TO LICENSE RESTRICTIONS 
;  CAREFULLY READ THE LICENSE AGREEMENT BEFORE USING THE SOFTWARE 
; 
; 
;************************************************************************* 
; ORIGIN UK 35-0450.05-400 
;****************************************************************** 
; 
;       ARM VRTRmc 
; 
;****************************************************************** 
; 
;       Description 
;       =========== 
; 
;       INTENDIS.S - Interrupt Enable/Disable routines 
; 
; 
;       Revision History 
;       ================ 
; 
;       Version    Date       Author               Reason for Change 
;       1.0        03/06/96   Samsung & P.Cumming  Initial Version 
;	1.1        29/07/97   Samsung & P.Cumming  cpu_interrupt_window 
;	                                           modified to include 
;	                                           exceptions 
;******************************************************************* 
 
FIQMode			EQU	&11 
IRQMode			EQU	&12 
SVCMode			EQU	&13 
MaskMode		EQU	&1f 
 
NoInt			EQU	&000000c0 
NoIRQInt		EQU	&00000080 
NoFIQInt		EQU	&00000040 
 
	 
	IMPORT	vmc_keep_FIQ_enabled 
	 
	EXPORT	|cpu_interrupt_disable| 
	EXPORT	|cpu_interrupt_restore| 
	EXPORT	|cpu_interrupt_enable| 
	EXPORT	|cpu_interrupt_window| 
 
 
	AREA	|C$$code$$interrupt_dis_en|, CODE, READONLY, INTERWORK 
 
c_keep_FIQ_enabled DCD  vmc_keep_FIQ_enabled 
 
 
;**************************************************************************** 
;	cpu_interrupt_xxxx : Interrupt disable / enable routines 
;**************************************************************************** 
; 
;	extern	cpu_interrupt_t	cpu_interrupt_disable(void); 
; 
|cpu_interrupt_disable| 
	ldr	r0,c_keep_FIQ_enabled	;load address of vmc_keep_FIQ_enabled 
	ldrb	r1,[r0]			;get vmc_keep_FIQ_enables 
	cmp	r1,#0			;check if we keep FIQ enabled	 
 
	mrs	r0,cpsr 
	orreq	r1,r0,#NoInt 
	orrne	r1,r0,#NoIRQInt 
	msr	cpsr,r1 
 
 IF :DEF:VMC_PROBE_INTERRUPT 
	IMPORT	vmc_intr_disable_start 
	stmfd	sp!,{r0,lr} 	;save r0 used by vmc_intr_disable_stop 
	mov	r0,lr	;lr gives pc for interrupt disable  
	bl	vmc_intr_disable_start ;start timer 
	ldmfd	sp!,{r0,lr} 	;restore r0 
 ENDIF 
 
 IF Thumb = {FALSE}	 
	mov	pc,lr 
 ELSE 
        bx lr  
 ENDIF 
 
 
; 
;	extern	void	cpu_interrupt_restore(cpu_interrupt_t); 
; 
|cpu_interrupt_restore| 
 
	msr	cpsr,r0 
 IF Thumb = {FALSE} 
	mov	pc,lr 
 ELSE 
        bx lr  
 ENDIF 
 
; 
;	extern	void	cpu_interrupt_enable(void); 
; 
|cpu_interrupt_enable| 
	mrs	r0,cpsr 
	bic	r0,r0,#NoInt 
 
 IF :DEF:VMC_PROBE_INTERRUPT	 
	IMPORT	vmc_intr_disable_stop 
	stmfd	sp!,{r0,lr} 	;save r0 used by vmc_intr_disable_stop 
	mov	r0,lr		;lr gives pc for interrupt disable  
	bl	vmc_intr_disable_stop ;stop timer 
	ldmfd	sp!,{r0,lr} 	;restore r0 
 ENDIF 
 
	msr	cpsr,r0 
 IF Thumb = {FALSE} 
	mov	pc,lr 
 ELSE 
        bx lr  
 ENDIF 
 
; 
;	extern	void	cpu_interrupt_window(cpu_interrupt_t); 
; 
|cpu_interrupt_window| 
	mrs	r1,cpsr 
	msr	cpsr,r0 
	msr	cpsr,r1 
 IF Thumb = {FALSE} 
	mov	pc,lr 
 ELSE 
        bx lr   
 ENDIF 
 
 END