⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 int.s.bak

📁 Nuclues嵌入式RTOS源码
💻 BAK
📖 第 1 页 / 共 5 页
字号:
;*                                                                       
;* INPUTS                                                                
;*                                                                       
;*      None                                                             
;*                                                                       
;* OUTPUTS                                                               
;*                                                                       
;*      None                                                             
;*                                                                       
;* HISTORY                                                               
;*                                                                       
;*         NAME            DATE                    REMARKS               
;*                                                                       
;*                                                                       
;*************************************************************
;    EXPORT INT_FIQ
    
INT_FIQ

;    IF :DEF: NU_FIQ_DEMO
    STMDB   sp!, {r1}
    MRS     r1, SPSR
    TST     r1, #FIQ_BIT                        ; If F bit = 1 we need to exit
    LDMIA   sp!, {r1}
    SUBNES  pc, lr, #4

    SUB     lr,lr,#4                            ; Adjust the return address
    STMDB   sp!,{r0-r7,lr}                      ; Save all on temporary FIQ stack

;    LDR     r3, INT_CNTRL_BASE                  ; load Interrupt Control Base
;    MOV     r1, #2                              ; Clear the pending interrupt 
;    STR     r1,[r3,#INT_CNTRL_CTRL_REG]         ; by writing a 1 to the Control Reg

;    BL      _FIQ_LISR                           ; Branch to FIQ service routine
    MOV	    r0, #26				 ;get FIQ vector
    BL	    TCC_Dispatch_LISR			 ; Branch to FIQ service routine

    LDMIA   sp!,{r0-r7,pc}^                     ; return to point of interrupt
    
;    ELSE

;    B    INT_FIQ

;    ENDIF

;************************************************************************
;*                                                                       
;* FUNCTION                                                              
;*                                                                         
;*     INT_Interrupt_Shell                                               
;*                                                                         
;* DESCRIPTION                                                           
;*                                                                         
;*     Handles all interrupts which use NU_Register_LISR.                
;*                                                                         
;*                                                                       
;* CALLED BY                                                             
;*                                                                       
;*      INT_IRQ                                                          
;*                                                                       
;* CALLS                                                                 
;*                                                                       
;*      TCT_Dispatch_LISR                                                
;*      TCT_Interrupt_Context_Restore                                    
;*                                                                       
;* INPUTS                                                                
;*                                                                       
;*      vector (register r0)                                             
;*                                                                       
;* OUTPUTS                                                               
;*                                                                       
;*      None                                  
;************************************************************************
;VOID INT_Interrupt_Shell(UNSIGNED vector)
;{
    
INT_Interrupt_Shell

    ;********************************
    ;* Begin Hardware Specific Code *
    ;********************************
    ; Clear the pending interrupt
    
    
    ; This is done in the INT_IRQ function by writing a zero to the   
    ; timer bit.

    ;******************************
    ;* End Hardware Specific Code *
    ;******************************

    MOV     r4,lr                           ; Put IRQ return address into r4

    BL      TCT_Interrupt_Context_Save

    BL      TCC_Dispatch_LISR

    MRS     r1,CPSR                         ; Pickup current CPSR
    BIC     r1,r1,#MODE_MASK                ; Clear the mode bits
    ORR     r1,r1,#(IRQ_MODE_OR_LOCKOUT)    ; Set the IRQ mode bits and Lockout interrupts
    MSR     CPSR_cxsf,r1                         ; Lockout interrupts/change to IRQ mode

;********************************
;* Begin Hardware Specific Code *
;********************************
    LDMIA   sp!,{r1}                        ; Get IRQ enable value off IRQ stack

    LDR     r2, INT_CNTRL_BASE_1            ; Get IRQ0 base register address
    STR     r1,[r2,#INT_IRQ0_ENABLESET]
;    STR     r1,[r2,#INT_CNTRL_MIR]          ; Re-enable all lower priority interrupts
;******************************
;* End Hardware Specific Code *                                         
;******************************
    
    MRS     r1,CPSR                         ; Pickup current CPSR
    BIC     r1,r1,#MODE_MASK                ; Clear the mode bits
    ORR     r1,r1,#SUP_MODE                 ; Set the SVC mode bits
    MSR     CPSR_cxsf,r1                    ; Change to SVC mode

    B       TCT_Interrupt_Context_Restore
;}

;************************************************************************
;*                                                                       
;* FUNCTION                                                              
;*                                                                       
;*      INT_Timer_Interrupt                                              
;*                                                                       
;* DESCRIPTION                                                           
;*                                                                       
;*      This routine is the board-specific section of the timer          
;*      interrupt handling                                               
;*                                                                       
;* CALLED BY                                                             
;*                                                                       
;*      None                                                             
;*                                                                       
;* CALLS                                                                 
;*                                                                       
;*      TMT_Timer_Interrupt                                              
;*                                                                       
;* INPUTS                                                                
;*                                                                       
;*      None                                                             
;*                                                                       
;*                                                                       
;* OUTPUTS                                                               
;*                                                                       
;*      None                                                             
;*                                                                       
;* HISTORY                                                               
;*                                                                       
;*         NAME            DATE                    REMARKS               
;*                                                                       
;*      B.Ronquillo        05-10-00          Created initial version 1.0   
;*                                                                       
;************************************************************************
;VOID INT_Timer_Interrupt(VOID)
;{

INT_Timer_Interrupt

;********************************
;* Begin Hardware Specific Code *
;********************************
; Clear the pending timer interrupt

    LDR     r3, CNTL_TIMER_BASE
    LDR     r2, [r3,#TIMER1_CLR]

; This is done in the INT_IRQ function by writing a zero to the   
; timer bit.

;******************************
;* End Hardware Specific Code *
;******************************

    MOV     r4,lr                           ; Put IRQ return address into r4

    BL      TCT_Interrupt_Context_Save

    BL      TMT_Timer_Interrupt            ; Call the timer interrupt
                                            ; processing.

    MRS     r1,CPSR                         ; Pickup current CPSR
    BIC     r1,r1,#MODE_MASK                ; Clear the mode bits
    ORR     r1,r1,#IRQ_MODE                 ; Set the IRQ mode bits
    MSR     CPSR_cxsf,r1                     ; Change to IRQ mode

    LDMIA   sp!,{r1}                        ; Get IRQ enable value off IRQ stack
;********************************
;* Begin Hardware Specific Code *
;********************************

    ; Re-enable all lower priority interrupts
    LDR     r2, INT_CNTRL_BASE_1              ; Get IRQ0 base register address
    STR     r1,[r2,#INT_IRQ0_ENABLESET]
;;    STR     r1,[r2,#INT_CNTRL_MIR]  ; Re-enable all lower priority interrupts

;******************************
;* End Hardware Specific Code *
;******************************
    
    MRS     r1,CPSR                         ; Pickup current CPSR
    BIC     r1,r1,#MODE_MASK                ; Clear the mode bits
    ORR     r1,r1,#SUP_MODE                 ; Set the SVC mode bits
    MSR     CPSR_cxsf,r1                         ; Change to SVC mode

    B       TCT_Interrupt_Context_Restore

;}
; End of INT_Timer_Interrupt

;************************************************************************
;*                                                                       
;* FUNCTION                                                              
;*                                                                       
;*      INT_Install_Vector_Table                                         
;*                                                                       
;* DESCRIPTION                                                           
;*                                                                       
;*      This function sets up the vector table with                      
;*      the Plus interrupt sevice routines.                              
;*                                                                       
;*                                                                       
;*                                                                       
;* CALLED BY                                                             
;*                                                                       
;*      INT_Initialize                                                   
;*                                                                       
;* CALLS                                                                 
;*                                                                       
;*      None                                                             
;*                                                                       
;* INPUTS                                                                
;*                                                                       
;*      None                                                             
;*                                                                       
;* OUTPUTS                                                               
;*                                                                       
;*      None                                                             
;*                                                                       
;* HISTORY                                                               
;*                                                                       
;*         NAME            DATE                    REMARKS               
;*                                                   

⌨️ 快捷键说明

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