This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Nested IRQ for SAM7

I remake a nested irq source for AT91SAM7256.

What do you think of it?

Its ok ?

Thanks for help.
Kamil

;/*****************************************************************************/
;/* NEST_IRQ.S: Nested irq  - Keil3 support                                   */
;/*****************************************************************************/

                PRESERVE8
                AREA    NEST_IRQ, CODE, READONLY
                ARM
                IMPORT  nested_irq_sys_func
                EXPORT  nested_irq_sys
nested_irq_sys
                PUSH    {R0-R12,LR}             ; save register context
                MRS     LR, SPSR                ; Copy SPSR_irq to LR
                PUSH    {LR}                    ; Save SPSR_irq
                MSR     CPSR_c, #0x1F           ; Enable IRQ (Sys Mode)
                PUSH    {LR}                    ; Save LR

                BL      nested_irq_sys_func

                POP     {LR}                    ; Restore LR
                MSR     CPSR_c, #0x92           ; Disable IRQ (IRQ Mode)
                POP     {LR}                    ; Restore SPSR_irq to LR
                MSR     SPSR_cxsf, LR           ; Copy LR to SPSR_irq

               ;EOICR = 0;                      ; Acknowledge Interrupt
            LDR R6,=(0xFFFFF130)
            LDR R5,=0x0
            STR R5,[R6]

                POP     {R0-R12,LR}          ; restore register context
                SUBS    R15,R14,#0x0004         ; return from interrupt


                END

0