]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libc/sparc/notejmp.c
fltfmt: %.ng is supposed to print a number with n significant figures, but it prints...
[plan9front.git] / sys / src / libc / sparc / notejmp.c
1 #include <u.h>
2 #include <libc.h>
3 #include <ureg.h>
4
5 int     __noterestore(void);
6
7 void
8 notejmp(void *vr, jmp_buf j, int ret)
9 {
10         struct Ureg *r = vr;
11
12         /*
13          * song and dance to get around the kernel smashing r7 in noted
14          */
15         r->r8 = ret;
16         if(ret == 0)
17                 r->r8 = 1;
18         r->r9 = j[JMPBUFPC] - JMPBUFDPC;
19         r->pc = (ulong)__noterestore;
20         r->npc = (ulong)__noterestore + 4;
21         r->sp = j[JMPBUFSP];
22         noted(NCONT);
23 }