1/* 2 * Copyright 2005, Ingo Weinhold <bonefish@cs.tu-berlin.de>. All rights 3 * reserved. Distributed under the terms of the Haiku License. 4 */ 5 6#include <asm_defs.h> 7 8#include "setjmp_internal.h" 9 10/* int sigsetjmp(jmp_buf buffer, int saveMask) */ 11FUNCTION(__sigsetjmp): 12FUNCTION(sigsetjmp): 13 // a0: buffer, d0: saveMask 14 move.l (4,%a7),%a0 15 move.l (8,%a7),%d0 16 17 // store non-volatile general purpose registers 18#warning M68K: do we want to save a7 there ?? 19 movem.l %d2-%d7/%a2-%a7,(%a0) 20 21 // store special registers (link, condition) 22 clr.l %d0 23 move %ccr,%d0 24 move.w %d0,(JMP_REGS_CCR,%a0) 25 move.l (%a7),(JMP_REGS_PC,%a0) 26 27#warning M68K: check this. 28 29 jmp __setjmp_save_sigs 30FUNCTION_END(__sigsetjmp) 31FUNCTION_END(sigsetjmp) 32 33 34/* int setjmp(jmp_buf buffer) */ 35FUNCTION(setjmp): 36 move.l (%a7)+,%a0 37 move.l (%a7)+,%d0 38 clr.l -(%a7) /* push 0 as 2nd arg */ 39 move.l %d0,-(%a7) 40 move.l %a0,-(%a7) 41 // call __sigsetjmp with saveMask = 0 42 jmp __sigsetjmp 43FUNCTION_END(setjmp) 44 45#pragma weak _setjmp=setjmp 46