github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/transform/testdata/interrupt.ll (about)

     1  target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
     2  target triple = "armv7em-none-eabi"
     3  
     4  %machine.UART = type { ptr }
     5  %machine.RingBuffer = type { [128 x %"runtime/volatile.Register8"], %"runtime/volatile.Register8", %"runtime/volatile.Register8" }
     6  %"runtime/volatile.Register8" = type { i8 }
     7  %"runtime/interrupt.handle" = type { ptr, i32, %"runtime/interrupt.Interrupt" }
     8  %"runtime/interrupt.Interrupt" = type { i32 }
     9  
    10  @"runtime/interrupt.$interrupt2" = private unnamed_addr constant %"runtime/interrupt.handle" { ptr @machine.UART0, i32 ptrtoint (ptr @"(*machine.UART).handleInterrupt$bound" to i32), %"runtime/interrupt.Interrupt" { i32 2 } }
    11  @machine.UART0 = internal global %machine.UART { ptr @"machine$alloc.335" }
    12  @"machine$alloc.335" = internal global %machine.RingBuffer zeroinitializer
    13  
    14  declare void @"runtime/interrupt.callHandlers"(i32, ptr) local_unnamed_addr
    15  
    16  declare void @"device/arm.EnableIRQ"(i32, ptr nocapture readnone)
    17  
    18  declare void @"device/arm.SetPriority"(i32, i32, ptr nocapture readnone)
    19  
    20  declare void @"runtime/interrupt.use"(%"runtime/interrupt.Interrupt")
    21  
    22  define void @runtime.initAll(ptr nocapture readnone) unnamed_addr {
    23  entry:
    24    call void @"device/arm.SetPriority"(i32 ptrtoint (ptr @"runtime/interrupt.$interrupt2" to i32), i32 192, ptr undef)
    25    call void @"device/arm.EnableIRQ"(i32 ptrtoint (ptr @"runtime/interrupt.$interrupt2" to i32), ptr undef)
    26    call void @"runtime/interrupt.use"(%"runtime/interrupt.Interrupt" { i32 ptrtoint (ptr @"runtime/interrupt.$interrupt2" to i32) })
    27    ret void
    28  }
    29  
    30  define void @UARTE0_UART0_IRQHandler() {
    31    call void @"runtime/interrupt.callHandlers"(i32 2, ptr undef)
    32    ret void
    33  }
    34  
    35  define void @NFCT_IRQHandler() {
    36    call void @"runtime/interrupt.callHandlers"(i32 5, ptr undef)
    37    ret void
    38  }
    39  
    40  define internal void @interruptSWVector(i32 %num) {
    41  entry:
    42    switch i32 %num, label %switch.done [
    43      i32 2, label %switch.body2
    44      i32 5, label %switch.body5
    45    ]
    46  
    47  switch.body2:
    48    call void @"runtime/interrupt.callHandlers"(i32 2, ptr undef)
    49    ret void
    50  
    51  switch.body5:
    52    call void @"runtime/interrupt.callHandlers"(i32 5, ptr undef)
    53    ret void
    54  
    55  switch.done:
    56    ret void
    57  }
    58  
    59  define internal void @"(*machine.UART).handleInterrupt$bound"(i32, ptr nocapture %context) {
    60  entry:
    61    call void @"(*machine.UART).handleInterrupt"(ptr %context, i32 %0, ptr undef)
    62    ret void
    63  }
    64  
    65  declare void @"(*machine.UART).handleInterrupt"(ptr nocapture, i32, ptr nocapture readnone)