Plan 9 from Bell Labs’s /usr/web/sources/plan9/sys/src/libc/power/notejmp.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include <u.h>
#include <libc.h>
#include <ureg.h>

int	__noterestore(void);

void
notejmp(void *vr, jmp_buf j, int ret)
{
	struct Ureg *r = vr;

	/*
	 * song and dance to get around the kernel smashing r3 in noted
	 */
	r->r4 = ret;
	if(ret == 0)
		r->r4 = 1;
	r->r5 = j[JMPBUFPC] - JMPBUFDPC;
	r->pc = (ulong)__noterestore;
	r->sp = j[JMPBUFSP];
	noted(NCONT);
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.