usbarmory / tamago

TamaGo - ARM/RISC-V bare metal Go
BSD 3-Clause "New" or "Revised" License
1.35k stars 52 forks source link

what does WORD mean in rt0_tamago_arm.s? #36

Closed kekemuyu closed 2 years ago

kekemuyu commented 2 years ago

Is "WORD $0xe10f0000" represent a machine code?

runtime/rt0_tamago_arm.s

TEXT _rt0_arm_tamago(SB),NOSPLIT,$0
    // Detect HYP mode and switch to SVC if necessary
    WORD    $0xe10f0000 // mrs r0, CPSR
    AND $0x1f, R0, R0   // get processor mode

    CMP $0x10, R0   // USR mode
    B.EQ    runtime_start   // Skip initialization if USER mode

    CMP $0x1a, R0   // HYP mode
    B.NE    after_eret  // Skip ERET if not HYP mode

    BIC $0x1f, R0
    ORR $0x1d3, R0  // AIF masked, SVC mode
    MOVW    $12(R15), R14   // add lr, pc, #12 (after_eret)
    WORD    $0xe16ff000 // msr SPSR_fsxc, r0
    WORD    $0xe12ef30e // msr ELR_hyp, lr
    WORD    $0xe160006e // eret0
abarisani commented 2 years ago

Please see section "Unsupported opcodes" here. Also please note that Github Issues are not the best media for general question, favor usbarmory@withsecure.com or our discussion group for that. Thanks!