github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/targets/cortex-m-qemu.s (about)

     1  // Generic Cortex-M interrupt vector.
     2  // This vector is used by the Cortex-M QEMU target.
     3  
     4  .cfi_sections .debug_frame
     5  .syntax unified
     6  
     7  // This is the default handler for interrupts, if triggered but not defined.
     8  .section .text.Default_Handler
     9  .global  Default_Handler
    10  .type    Default_Handler, %function
    11  Default_Handler:
    12      .cfi_startproc
    13      wfe
    14      b    Default_Handler
    15      .cfi_endproc
    16  .size Default_Handler, .-Default_Handler
    17  
    18  // Avoid the need for repeated .weak and .set instructions.
    19  .macro IRQ handler
    20      .weak  \handler
    21      .set   \handler, Default_Handler
    22  .endm
    23  
    24  .section .isr_vector, "a", %progbits
    25  .global  __isr_vector
    26  __isr_vector:
    27      // Interrupt vector as defined by Cortex-M, starting with the stack top.
    28      // On reset, SP is initialized with *0x0 and PC is loaded with *0x4, loading
    29      // _stack_top and Reset_Handler.
    30      .long _stack_top
    31      .long Reset_Handler
    32      .long NMI_Handler
    33      .long HardFault_Handler
    34      .long MemoryManagement_Handler
    35      .long BusFault_Handler
    36      .long UsageFault_Handler
    37      .long 0
    38      .long 0
    39      .long 0
    40      .long 0
    41      .long SVC_Handler
    42      .long DebugMon_Handler
    43      .long 0
    44      .long PendSV_Handler
    45      .long SysTick_Handler
    46  
    47      // Define default implementations for interrupts, redirecting to
    48      // Default_Handler when not implemented.
    49      IRQ NMI_Handler
    50      IRQ HardFault_Handler
    51      IRQ MemoryManagement_Handler
    52      IRQ BusFault_Handler
    53      IRQ UsageFault_Handler
    54      IRQ SVC_Handler
    55      IRQ DebugMon_Handler
    56      IRQ PendSV_Handler
    57      IRQ SysTick_Handler
    58  
    59  .size __isr_vector, .-__isr_vector