> Good. > > I want all use of the cpu number removed. It seems to be just to avoid > alignment problems that shouldn't happen in practice (the save area > should always be suitably aligned if it isn't already, and I think it > is already). The pcb_save area has the proper alignment but the dummy variable used in npxinit might not have the proper alignment when on the stack. The enclosed patch should be a step in the right direction. - Tor Egge
Index: sys/i386/isa/npx.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/npx.c,v retrieving revision 1.105 diff -u -r1.105 npx.c --- sys/i386/isa/npx.c 2001/07/16 06:00:23 1.105 +++ sys/i386/isa/npx.c 2001/07/16 16:54:13 @@ -564,7 +564,7 @@ npxinit(control) u_short control; { - union savefpu dummy; + static union savefpu dummy; critical_t savecrit; if (!npx_exists) @@ -926,30 +926,21 @@ fpusave(addr) union savefpu *addr; { - static struct savexmm svxmm[MAXCPU]; - u_char oncpu = PCPU_GET(cpuid); if (!cpu_fxsr) fnsave(addr); - else { - fxsave(&svxmm[oncpu]); - bcopy(&svxmm[oncpu], addr, sizeof(struct savexmm)); - } + else + fxsave(addr); } static void fpurstor(addr) union savefpu *addr; { - static struct savexmm svxmm[MAXCPU]; - u_char oncpu = PCPU_GET(cpuid); - if (!cpu_fxsr) frstor(addr); - else { - bcopy(addr, &svxmm[oncpu], sizeof (struct savexmm)); - fxrstor(&svxmm[oncpu]); - } + else + fxrstor(addr); } #ifdef I586_CPU_XXX