mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
35a1aa5f9c
Summary: Failure to update the FP / vector state was causing daemon(3) to violate C ABI by failing to preserve nonvolatile registers. This was causing a weird issue where moused was not working on PowerBook G4s when daemonizing, but was working fine when running it foreground. Force saving off the same state that cpu_switch() does in cases where we are about to copy a thread. MFC after: 1 week Sponsored by: Tag1 Consulting, Inc. Test Plan: ``` /* * Test for ABI violation due to side effects of daemon(3). * * NOTE: Compile with -O2 to see the effect. */ /* Allow compiling for Linux too. */ static double test = 1234.56f; /* * This contrivance coerces clang to not bounce the double * off of memory again in main. */ void __attribute__((noinline)) print_double(int j1, int j2, double d) { printf("%f\n", d); } int main(int argc, char *argv[]) { print_double(0, 0, test); if (daemon(0, 1)) { } /* Compiler assumes nonvolatile regs are intact... */ print_double(0, 0, test); return(0); } ``` Working output: ``` 1234.560059 1234.560059 ``` Output in broken case: ``` 1234.560059 0.0 ``` Reviewers: #powerpc Subscribers: jhibbits, luporl, alfredo Tags: #powerpc Differential Revision: https://reviews.freebsd.org/D29851 |
||
---|---|---|
.. | ||
aim | ||
amigaone | ||
booke | ||
conf | ||
cpufreq | ||
fpu | ||
include | ||
mambo | ||
mikrotik | ||
mpc85xx | ||
ofw | ||
powermac | ||
powernv | ||
powerpc | ||
ps3 | ||
pseries | ||
psim |