github.com/usbarmory/tamago@v0.0.0-20240508072735-8612bbe1e454/arm/arm.s (about)

     1  // ARM processor support
     2  // https://github.com/usbarmory/tamago
     3  //
     4  // Copyright (c) WithSecure Corporation
     5  // https://foundry.withsecure.com
     6  //
     7  // Use of this source code is governed by the license
     8  // that can be found in the LICENSE file.
     9  
    10  // func read_cpsr() uint32
    11  TEXT ·read_cpsr(SB),$0-4
    12  	// ARM Architecture Reference Manual - ARMv7-A and ARMv7-R edition
    13  	// B1.3.3 Program Status Registers (PSRs)
    14  	WORD	$0xe10f0000 // mrs r0, CPSR
    15  	MOVW	R0, ret+0(FP)
    16  
    17  	RET
    18  
    19  // func halt()
    20  TEXT ·halt(SB),$0
    21  	// wait forever in low-power state
    22  	WORD	$0xf10c0080 // cpsid i
    23  	WORD	$0xe320f003 // wfi