github.com/aykevl/tinygo@v0.5.0/targets/cortex-m.s (about)

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