diff options
Diffstat (limited to 'sys/src/9/xen/main.c')
-rw-r--r-- | sys/src/9/xen/main.c | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/sys/src/9/xen/main.c b/sys/src/9/xen/main.c index 22fe77dd4..61bf5bf4c 100644 --- a/sys/src/9/xen/main.c +++ b/sys/src/9/xen/main.c @@ -322,39 +322,22 @@ confinit(void) } } -/* - * set up floating point for a new process - */ void -procsetup(Proc*p) +procsetup(Proc *p) { - p->fpstate = FPinit; - fpoff(); + fpuprocsetup(p); } void procfork(Proc *p) { - int s; - - /* save floating point state */ - s = splhi(); - switch(up->fpstate & ~FPillegal){ - case FPactive: - fpsave(up->fpsave); - up->fpstate = FPinactive; - case FPinactive: - while(p->fpsave == nil) - p->fpsave = mallocalign(sizeof(FPsave), FPalign, 0, 0); - memmove(p->fpsave, up->fpsave, sizeof(FPsave)); - p->fpstate = FPinactive; - } - splx(s); + fpuprocfork(p); } void procrestore(Proc *p) { + fpuprocrestore(p); } /* @@ -363,21 +346,7 @@ procrestore(Proc *p) void procsave(Proc *p) { - if(p->fpstate == FPactive){ - if(p->state == Moribund) - fpclear(); - else{ - /* - * Fpsave() stores without handling pending - * unmasked exeptions. Postnote() can't be called - * so the handling of pending exceptions is delayed - * until the process runs again and generates an - * emulation fault to activate the FPU. - */ - fpsave(p->fpsave); - } - p->fpstate = FPinactive; - } + fpuprocsave(p); /* * While this processor is in the scheduler, the process could run |