isrshell.s

来自「Cirrus Logic EP7312处理器部分控制程序。」· S 代码 · 共 87 行

S
87
字号
#*****************************************************************************
#
# ISRSHELL.S - Assembly shell around the C IRQ and FIQ handlers
#
# Copyright (c) 1998-1999 Cirrus Logic, Inc.
#
#*****************************************************************************

        .EXTERN IRQHandler
        .EXTERN pfnOldIRQ
        .EXTERN FIQHandler
        .EXTERN pfnOldFIQ

#        AREA |C$$code|, CODE

#*****************************************************************************
#
# IRQShell is a wrapper around the IRQ handler.  It saves registers to the
# stack, calls the C IRQ handler, and chains to the original IRQ handler.
#
#*****************************************************************************
        .GLOBAL IRQShell
IRQShell:

        #
        # Save any registers which are not saved by APCS.
        #
        stmdb   r13!, {r0}
        stmdb   r13!, {r1-r3, r9-r12, r14}

        #
        # Call the C IRQ handler.
        #
        bl      IRQHandler

        #
        # Restore the saved registers (except for r0).
        #
        ldmia   r13!, {r1-r3, r9-r12, r14}

        #
        # Branch to the original IRQ handler, being careful to make sure that
        # registers r0-r14 all have the same values as when this routine was
        # called.
        #
        ldr     r0, =pfnOldIRQ
        ldr     r0, [r0, #0]
        swp     r0, r0, [r13]
        ldmia   r13!, {pc}

#*****************************************************************************
#
# FIQShell is a wrapper around the FIQ handler.  It saves registers to the
# stack, calls the C FIQ handler, and chains to the original FIQ handler.
#
#*****************************************************************************
        .GLOBAL FIQShell
FIQShell:

        #
        # Save any registers which are not saved by APCS.
        #
        stmdb   r13!, {r0}
        stmdb   r13!, {r1-r3, r9-r12, r14}

        #
        # Call the C FIQ handler.
        #
        bl      FIQHandler

        #
        # Restore the saved registers (except for r0).
        #
        ldmia   r13!, {r1-r3, r9-r12, r14}

        #
        # Branch to the original FIQ handler, being careful to make sure that
        # registers r0-r14 all have the same values as when this routine was
        # called.
        #
        ldr     r0, =pfnOldFIQ
        ldr     r0, [r0, #0]
        swp     r0, r0, [r13]
        ldmia   r13!, {pc}

#        END

⌨️ 快捷键说明

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