X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Fld-acess.so_src%2Farch%2Fx86.asm.h;h=2d2c36a187bc96608a043750deac7337324e5c99;hb=0162285103aa3ee5eecc3762105cc1145b7e81da;hp=9e452734effdfb7979c0f1581a598b3e686d60d7;hpb=8a8a744341df513d00d2e60adf5e88636856e65b;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/ld-acess.so_src/arch/x86.asm.h b/Usermode/Libraries/ld-acess.so_src/arch/x86.asm.h index 9e452734..2d2c36a1 100644 --- a/Usermode/Libraries/ld-acess.so_src/arch/x86.asm.h +++ b/Usermode/Libraries/ld-acess.so_src/arch/x86.asm.h @@ -10,6 +10,13 @@ _errno: dw 0 [section .text] +[global _start] +[extern SoMain] +_start: + call SoMain + add esp, 4 ; // Base address + jmp eax + ; DEST ; SRC _memcpy: @@ -150,6 +157,7 @@ clone: push ebp mov ebp, esp push ebx + push edx mov ebx, [ebp+12] ; Get new stack pointer @@ -181,11 +189,20 @@ clone: sub ebx, 12 %endif .doCall: + mov edx, ebx ; Save new stack mov eax, SYS_CLONE mov ecx, ebx ; Stack mov ebx, [ebp+8] ; Flags SYSCALL_OP mov [_errno], ebx + + test eax, eax + jnz .ret + test edx, edx + jz .ret + mov esp, edx +.ret: + pop edx pop ebx pop ebp ret