Power Management
15-28
Figure 15–12. Code Example
.state16
; thumb mode
.ref
edata
; defined by armas
.global $arm_idle
$arm_idle:
push
{lr}
push
{r1–r7}
adr
r4, into_32_bis
bx
r
nop
nop
nop
.state32
; arm mode
into_32_bis:
LDR
R1,ARM_IDLECT1
MOV
R3,#1
MOV
R3,R3,LSL # 11
MOV
R2,#0
LDR
R0,[R1]
ORR
R0,R0,R3
; This is the loop that will wait for at least 100 cycles
; before issuing next request from ARM. On the first run of the loop only Icache
; gets loaded with the loop and the next 2 instructions but write to SYSST does
not occur
; In the 2nd run of the loop only write to IDLE_CT1 happens and after that ARM
runs the loop from
;Icache so no request goes out
LOOP
CMP
R2,#1
STREQ
R0,[R1]
ADD
R2,R2,#1
CMP
R2,#16
BNE
LOOP