xref: /haiku/src/system/libroot/posix/arch/m68k/siglongjmp.S (revision a381c8a06378de22ff08adf4282b4e3f7e50d250)
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 "setjmp_internal.h"
7
8/* int __siglongjmp(jmp_buf buffer, int value) */
9FUNCTION(siglongjmp):
10FUNCTION(longjmp):
11FUNCTION(_longjmp):
12	// a0: buffer, d0: saveMask
13	move.l	(4,%a7),%a0
14	move.l	(8,%a7),%d0
15
16	// restore non-volatile general purpose registers
17	movem.l	(%a0),%d2-%d7/%a2-%a7
18
19	// restore special registers (link, condition)
20	move.w	(JMP_REGS_CCR,%a0),%d0
21	move	%d0,%ccr
22	move.l	(JMP_REGS_PC,%a0),(%a7)
23
24	jmp	__longjmp_return
25
26#pragma weak longjmp=siglongjmp
27