X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Fld-acess.so_src%2Farch%2Fx86.asm.h;h=17327997bff9cdf855aa53e597fd061bd9212ef8;hb=6516331968f11dd9e5c495572f27cc69fa3d4c48;hp=a569637df8c0277375bc7dcdc2ff75e8bcccf3a6;hpb=9867382061f9035d65e118d95fa819c0e615f353;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 a569637d..17327997 100644 --- a/Usermode/Libraries/ld-acess.so_src/arch/x86.asm.h +++ b/Usermode/Libraries/ld-acess.so_src/arch/x86.asm.h @@ -2,8 +2,6 @@ ; AcssMicro - System Calls ; ======================== -%include "../../../Kernel/include/syscalls.inc.asm" - [bits 32] [section .data] [global _errno:data 4] @@ -14,11 +12,8 @@ _errno: dw 0 [extern SoMain] _start: call SoMain - - add esp, 4 + add esp, 4 ; // Base address call eax - - push eax call _exit ; DEST @@ -161,6 +156,7 @@ clone: push ebp mov ebp, esp push ebx + push edx mov ebx, [ebp+12] ; Get new stack pointer @@ -192,11 +188,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