// 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
mov r0, #1
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
-@
+@ Well, can't blame it
+@ - Clear the instruction cache
+.globl __clear_cache
+__clear_cache:
+ svc #0x1001
+ mov pc, lr
+
+
+@ >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
- mov pc, lr
+ @mrc p15, 0, r3, c13, c0, 2
+ ldr r3, =_errno
+ str r2, [r3]
+ 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
+ ldr r3, =_errno
+ str r2, [r3]
+ 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
+ ldr r3, =_errno
+ str r2, [r3]
+ pop {r4,r5,pc}
.endm
#define SYSCALL0(_name,_num) syscall0 _name, _num
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