summaryrefslogtreecommitdiff
path: root/gp2x/sys_cacheflush.S
blob: d26f81ab46f86d7a49425fa38038b44a8a13484f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@ vim:filetype=armasm
#include <sys/syscall.h>


.global sys_cacheflush @ void *start_addr, void *end_addr

sys_cacheflush:
    mov     r2, #0
#ifdef __ARM_EABI__
    /* EABI version */
    str     r7, [sp, #-4]!
    mov     r7, #(__ARM_NR_cacheflush & 0xff)
    orr     r7, r7, #(__ARM_NR_cacheflush & 0x00ff00)
    orr     r7, r7, #(__ARM_NR_cacheflush & 0xff0000)
    swi     0
    ldr     r7, [sp], #4
#else
    /* OABI */
    swi     __ARM_NR_cacheflush
#endif
    bx      lr

.global spend_cycles
spend_cycles:
    mov r0,r0,lsr #2
  0:subs r0, r0, #1
    bne 0b
    bx lr