added setjmp()/longjmp() (used by NetBSD x86 emulator)

modified x86pcibios.c to work with NetBSD x86 emulator
This commit is contained in:
Markus Fröschle
2015-02-17 14:43:11 +00:00
parent 5cf48838c6
commit 13209134c3
10 changed files with 305 additions and 118 deletions

16
util/setjmp.S Normal file
View File

@@ -0,0 +1,16 @@
.globl _setjmp
.globl _longjmp
_setjmp: move.l 4(sp),a0 // address of jmp_buf[]
move.l (sp),(a0) // save return address
movem.l d2-d7/a2-a7,4(a0) // save registers to jmp_buf
clr.l d0
rts
_longjmp: move.l 4(sp),a0 // address of jmp_buf[]
move.l 8(sp),d0 // value to return
jne not_0 // value may not be 0
moveq.l #1,d0
not_0: movem.l 4(a0),d2-d7/a2-a7 // restore registers
move.l (a0),(sp) // restore saved return address
rts