shithub: riscv

ref: fe93e698589d6b23a02ec8e6d104f83e533661f3
dir: /sys/src/ape/lib/ap/sparc/setjmp.s/

View raw version
TEXT	setjmp(SB), 1, $0

	MOVW	R1, (R7)
	MOVW	R15, 4(R7)
	MOVW	$0, R7
	RETURN

TEXT	sigsetjmp(SB), 1, $0

	MOVW	savemask+4(FP), R8
	MOVW	R8, 0(R7)
	MOVW	$_psigblocked(SB), R8
	MOVW	R8, 4(R7)
	MOVW	R1, 8(R7)
	MOVW	R15, 12(R7)
	MOVW	$0, R7
	RETURN

TEXT	longjmp(SB), 1, $0

	MOVW	R7, R8
	MOVW	r+4(FP), R7
	CMP	R7, R0
	BNE	ok		/* ansi: "longjmp(0) => longjmp(1)" */
	MOVW	$1, R7		/* bless their pointed heads */
ok:	MOVW	(R8), R1
	MOVW	4(R8), R15
	RETURN

/*
 * trampoline functions because the kernel smashes r7
 * in the uregs given to notejmp
 */
TEXT	__noterestore(SB), 1, $-4
	MOVW	R8, R7
	JMP	(R9)