Usermode/libc - Fix strchr and strrchr behavior
[tpg/acess2.git] / Usermode / Libraries / ld-acess.so_src / arch / armv7.S.h
index 9132c02..7e604f1 100644 (file)
@@ -16,7 +16,7 @@ _start:
        
        b _exit
 
-@ Stupid GCC
+// Stupid GCC
 .globl __ucmpdi2
 __ucmpdi2:
        cmp r0, r2
@@ -32,36 +32,36 @@ __ucmpdi2:
        mov r0, #1
        mov pc, lr
 
-@ Well, can't blame it
-@ - Clear the instruction cache
+//@ Well, can't blame it
+// - Clear the instruction cache
 .globl __clear_cache
 __clear_cache:
        svc #0x1001
        mov pc, lr
 
-@ DEST
-@ SRC
-@_memcpy:
-@      push rbp
-@      mov rbp, rsp
-@      
-@      ; RDI - First Param
-@      ; RSI - Second Param
-@      mov rcx, rdx    ; RDX - Third
-@      rep movsb
-@      
-@      pop rbp
-@      ret
-@
+
+@ >r0: PC
+@ >r1: Pointer to item count
+@ <r0: Address
+@ STUBBED
+__gnu_Unwind_Find_exidx:
+       mov r0, #0
+       str r0, [r1]
+       mov pc, lr
+
+.section .data
 .globl _errno
 _errno:        .long   0       @ Placed in .text, to allow use of relative addressing
+.section .text
 
 .macro syscall0 _name, _num    
 .globl \_name
 \_name:
        push {lr}
        svc #\_num
-       str r2, _errno
+       @mrc p15, 0, r3, c13, c0, 2
+       ldr r3, =_errno
+       str r2, [r3]
        pop {pc}
 .endm
 
@@ -71,7 +71,8 @@ _errno:       .long   0       @ Placed in .text, to allow use of relative addressing
        push {r4, lr}
        ldr r4, [sp,#8]
        svc #\_num
-       str r2, _errno
+       ldr r3, =_errno
+       str r2, [r3]
        pop {r4, pc}
 .endm
 
@@ -82,7 +83,8 @@ _errno:       .long   0       @ Placed in .text, to allow use of relative addressing
        ldr r4, [sp,#12]
        ldr r5, [sp,#16]
        svc #\_num
-       str r2, _errno
+       ldr r3, =_errno
+       str r2, [r3]
        pop {r4,r5,pc}
 .endm
 
@@ -98,16 +100,31 @@ _errno:    .long   0       @ Placed in .text, to allow use of relative addressing
 // Override the clone syscall
 #define _exit  _exit_raw
 #define _clone _clone_raw
+#define _SysSeek       _SysSeek_borken
 #include "syscalls.s.h"
 #undef _exit
 #undef _clone
+#undef _SysSeek 
+
+// NOTE: _SysSeek needs special handling for alignment
+.globl _SysSeek
+_SysSeek:
+       push {lr}
+       mov r1,r2
+       mov r2,r3
+       ldr r3, [sp,#4]
+       svc #SYS_SEEK
+       ldr r3, =_errno
+       str r2, [r3]
+       pop {pc}
 
 .globl _clone
 _clone:
        push {r4}
        mov r4, r1
        svc #SYS_CLONE
-       str r2, _errno
+       ldr r3, =_errno
+       str r2, [r3]
        tst r4, r4
        beq _clone_ret
        @ If in child, set SP
@@ -117,6 +134,7 @@ _clone_ret:
        pop {r4}
        mov pc, lr
 
+
 .globl _exit
 _exit:
        svc #0

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