Merge branch 'master' of git://git.ucc.asn.au/tpg/acess2
[tpg/acess2.git] / Usermode / Libraries / ld-acess.so_src / arch / armv7.S.h
index 85a3ac6..9132c02 100644 (file)
@@ -2,12 +2,11 @@
 // Acess2 ARMv7 - System Calls
 //
 
-#include "../../../../Kernel/include/syscalls.h"
-
 .globl _start
 .extern SoMain
 _start:
        pop {r0}
+       ldm sp, {r1,r2,r3}
        bl SoMain
        
        mov r4, r0
@@ -33,6 +32,13 @@ __ucmpdi2:
        mov r0, #1
        mov pc, lr
 
+@ Well, can't blame it
+@ - Clear the instruction cache
+.globl __clear_cache
+__clear_cache:
+       svc #0x1001
+       mov pc, lr
+
 @ DEST
 @ SRC
 @_memcpy:
@@ -53,32 +59,31 @@ _errno:     .long   0       @ Placed in .text, to allow use of relative addressing
 .macro syscall0 _name, _num    
 .globl \_name
 \_name:
+       push {lr}
        svc #\_num
        str r2, _errno
-       mov pc, lr
+       pop {pc}
 .endm
 
 .macro syscall5 _name, _num
 .globl \_name
 \_name:
-       push {r4}
-       ldr r4, [sp,#4]
+       push {r4, lr}
+       ldr r4, [sp,#8]
        svc #\_num
        str r2, _errno
-       pop {r4}
-       mov pc, lr
+       pop {r4, pc}
 .endm
 
 .macro syscall6 _name, _num
 .globl \_name
 \_name:
-       push {r4,r5}
-       ldr r4, [sp,#8]
-       ldr r5, [sp,#12]
+       push {r4,r5,lr}
+       ldr r4, [sp,#12]
+       ldr r5, [sp,#16]
        svc #\_num
        str r2, _errno
-       pop {r4,r5}
-       mov pc, lr
+       pop {r4,r5,pc}
 .endm
 
 #define SYSCALL0(_name,_num)   syscall0 _name, _num

UCC git Repository :: git.ucc.asn.au