cputick for arm11

It is of cource possible to read the "tick counter" by asm. I hope you meen the cycle counter.
This is a rutine (ARM1176) that saves the value of the register in the global integer cycle_counter. You do
have to init the counter first.


AREA TIMER, CODE, READONLY ; name this block of code
EXPORT read_timer

read_timer FUNCTION
;===============================
;
IMPORT cycle_counter
LDR r1, =cycle_counter
MRC p15, 0, r0, c15, c12, 1
STR r0, [r1]
MOV pc, lr
ENDFUNC

你可能感兴趣的:(cputick for arm11)