github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/transform/testdata/interrupt.out.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.Interrupt" = type { i32 }
     8  
     9  @machine.UART0 = internal global %machine.UART { ptr @"machine$alloc.335" }
    10  @"machine$alloc.335" = internal global %machine.RingBuffer zeroinitializer
    11  
    12  declare void @"runtime/interrupt.callHandlers"(i32, ptr) local_unnamed_addr
    13  
    14  declare void @"device/arm.EnableIRQ"(i32, ptr nocapture readnone)
    15  
    16  declare void @"device/arm.SetPriority"(i32, i32, ptr nocapture readnone)
    17  
    18  declare void @"runtime/interrupt.use"(%"runtime/interrupt.Interrupt")
    19  
    20  define void @runtime.initAll(ptr nocapture readnone %0) unnamed_addr {
    21  entry:
    22    call void @"device/arm.SetPriority"(i32 2, i32 192, ptr undef)
    23    call void @"device/arm.EnableIRQ"(i32 2, ptr undef)
    24    ret void
    25  }
    26  
    27  define void @UARTE0_UART0_IRQHandler() {
    28    call void @"(*machine.UART).handleInterrupt$bound"(i32 2, ptr @machine.UART0)
    29    ret void
    30  }
    31  
    32  define internal void @interruptSWVector(i32 %num) {
    33  entry:
    34    switch i32 %num, label %switch.done [
    35      i32 2, label %switch.body2
    36      i32 5, label %switch.body5
    37    ]
    38  
    39  switch.body2:                                     ; preds = %entry
    40    call void @"(*machine.UART).handleInterrupt$bound"(i32 2, ptr @machine.UART0)
    41    ret void
    42  
    43  switch.body5:                                     ; preds = %entry
    44    unreachable
    45  
    46  switch.done:                                      ; preds = %entry
    47    ret void
    48  }
    49  
    50  define internal void @"(*machine.UART).handleInterrupt$bound"(i32 %0, ptr nocapture %context) {
    51  entry:
    52    call void @"(*machine.UART).handleInterrupt"(ptr %context, i32 %0, ptr undef)
    53    ret void
    54  }
    55  
    56  declare void @"(*machine.UART).handleInterrupt"(ptr nocapture, i32, ptr nocapture readnone)