1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

Don't use -mregparm=3 in userspace.

It's pretty comfy having arguments in registers in the kernel for now though.
This commit is contained in:
Andreas Kling 2019-02-08 01:24:52 +01:00
parent 04378d9063
commit 5158bee08c
11 changed files with 50 additions and 47 deletions

33
LibC/setjmp.asm Normal file
View file

@ -0,0 +1,33 @@
; asmsyntax=nasm
global setjmp
setjmp:
mov eax, [esp + 4]
mov [eax * 4], ebx
mov [eax + 1 * 4], esi
mov [eax + 2 * 4], edi
mov [eax + 3 * 4], ebp
lea ecx, [esp + 4]
mov [eax + 4 * 4], ecx
mov ecx, [esp]
mov [eax + 5 * 4], ecx
xor eax, eax
ret
global longjmp
longjmp:
mov edx, [esp + 4]
mov eax, [esp + 8]
mov ebx, [edx * 4]
mov esi, [edx + 1 * 4]
mov edi, [edx + 2 * 4]
mov ebp, [edx + 3 * 4]
mov ecx, [edx + 4 * 4]
mov esp, ecx
mov ecx, [edx + 5 * 4]
test eax, eax
jnz .nonzero
mov eax, 1
.nonzero:
jmp ecx