diff options
author | Sigrid <ftrvxmtrx@gmail.com> | 2020-12-06 19:40:57 +0100 |
---|---|---|
committer | Sigrid <ftrvxmtrx@gmail.com> | 2020-12-06 19:40:57 +0100 |
commit | 97b32915334c700a8b282888481c7f37a6ae0442 (patch) | |
tree | 7cdf39a71e585e7002b8e177d1669e3c5a85bd3a /sys/src/9 | |
parent | 334c5e1134719a02c35c72ec5435a967a74846f8 (diff) |
amd64: FP: back to static size for allocation and copying
Diffstat (limited to 'sys/src/9')
-rw-r--r-- | sys/src/9/pc64/dat.h | 1 | ||||
-rw-r--r-- | sys/src/9/pc64/fpu.c | 4 | ||||
-rw-r--r-- | sys/src/9/pc64/main.c | 6 |
3 files changed, 3 insertions, 8 deletions
diff --git a/sys/src/9/pc64/dat.h b/sys/src/9/pc64/dat.h index b9b9fc147..b597f8988 100644 --- a/sys/src/9/pc64/dat.h +++ b/sys/src/9/pc64/dat.h @@ -241,7 +241,6 @@ struct Mach u64int dr7; /* shadow copy of dr7 */ u64int xcr0; - u32int fpsavesz; void* vmx; diff --git a/sys/src/9/pc64/fpu.c b/sys/src/9/pc64/fpu.c index 6ac8819d7..3af4d60e3 100644 --- a/sys/src/9/pc64/fpu.c +++ b/sys/src/9/pc64/fpu.c @@ -16,7 +16,6 @@ fpuinit(void) uintptr cr4; ulong regs[4]; - m->fpsavesz = sizeof(FPsave); /* always enough to fit sse+avx */ if((m->cpuiddx & (Sse|Fxsr)) == (Sse|Fxsr)){ /* have sse fp? */ cr4 = getcr4() | CR4Osfxsr|CR4Oxmmex; putcr4(cr4); @@ -31,9 +30,6 @@ fpuinit(void) fpsave = fpxsave; fprestore = fpxrestore; - cpuid(0xd, 0, regs); - m->fpsavesz = regs[1]; - cpuid(0xd, 1, regs); if(regs[0] & Xsaveopt) fpsave = fpxsaveopt; diff --git a/sys/src/9/pc64/main.c b/sys/src/9/pc64/main.c index 803799ab9..4ab9c0a31 100644 --- a/sys/src/9/pc64/main.c +++ b/sys/src/9/pc64/main.c @@ -488,7 +488,7 @@ mathemu(Ureg *ureg, void*) up->fpstate |= FPkernel; } while(up->fpslot[index] == nil) - up->fpslot[index] = mallocalign(m->fpsavesz, FPalign, 0, 0); + up->fpslot[index] = mallocalign(sizeof(FPsave), FPalign, 0, 0); up->fpsave = up->fpslot[index]; up->fpstate = FPactive | (up->fpstate & (FPnouser|FPkernel|FPindexm)); break; @@ -574,8 +574,8 @@ procfork(Proc *p) case FPinactive | FPpush: case FPinactive: while(p->fpslot[0] == nil) - p->fpslot[0] = mallocalign(m->fpsavesz, FPalign, 0, 0); - memmove(p->fpsave = p->fpslot[0], up->fpslot[0], m->fpsavesz); + p->fpslot[0] = mallocalign(sizeof(FPsave), FPalign, 0, 0); + memmove(p->fpsave = p->fpslot[0], up->fpslot[0], sizeof(FPsave)); p->fpstate = FPinactive; } splx(s); |