1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00
freebsd/sys/amd64/include
Bruce Evans 3764a82377 Simplified PCPU_GET() and PCPU_SET(). We must copy through a temporary
variable to avoid invalid constraints in dead code.  Use an array of
u_char's (inside a struct) instead of a char/short/int/long variable so
that the variable and its accesses can be spelled in the same way in all
cases and code doesn't need to be cloned just to hold the spelling
differences.

Fixed strict-aliasing errors in PCPU_SET() and in the amd64 PCPU_GET().
Cast to (void *) as in rev.1.37 of the i386 version where the errors
were fixed for the i386 PCPU_GET() only.  It would be more correct to
copy to and from the temp. variable using memcpy(), but then an
ifdef tangle would be required to ensure using the builtin memcpy().
We depend on fairly aggressive optimization to put the temp. variable
only in a register despite it being copied using
*(type *)(void *)&anothertype and could depend on this when using
memcpy() too.  This seems to work right even for -O0, but the -O0 case
has not been completely tested.

This change gives identical object code for all object files in LINT
on amd64 (except for one file with a __TIME__ stamp).  For LINT on
i386 it gives unimportant differences in instruction order and padding
in a few object files.  This was only tested for -O.

This change (actually a previous version of it) gives the following
reductions in the number of object files in LINT that fail to compile
with -O2 but without the -fno-strict-aliasing kludge:
- amd64: 29 (down from 211)
- i386: 36 (down from 47)

gcc-3.4.6 actually allows the invalid constraints that result from not
using the temp. variable, at least with -O[1-2], but gcc-3.3.3 crashes
on them and I don't want to depend on compiler bugs.
2007-02-06 16:21:09 +00:00
..
pc
_bus.h
_inttypes.h
_limits.h
_stdint.h
_types.h
acpica_machdep.h
apicreg.h
apicvar.h Newer versions of gcc don't support treating structures passed by value 2006-12-17 06:48:40 +00:00
asm.h
asmacros.h Removed all traces of HIDENAME() in amd64 and i386 kernel code. Using 2006-10-28 06:04:29 +00:00
atomic.h Fixed some style bugs (mainly assorted errors in comments, and inconsistent 2006-12-29 15:29:49 +00:00
bus_dma.h
bus.h
clock.h Cleaned up declaration and initialization of clock_lock. It is only 2007-01-23 08:01:20 +00:00
cpu.h Clean out sysctl machdep.* related defines. 2006-05-11 17:29:25 +00:00
cpufunc.h
cputypes.h
db_machdep.h
elf.h PR: 2006-10-04 21:37:10 +00:00
endian.h
exec.h
float.h
floatingpoint.h
fpu.h
frame.h
gdb_machdep.h Change GDB_BUFSZ to be large enough to hold a register dump where each 2007-02-05 21:48:32 +00:00
ieeefp.h
in_cksum.h
intr_machdep.h Expand the MSI/MSI-X API to address some deficiencies in the MSI-X support. 2007-01-22 21:48:44 +00:00
iodev.h
kdb.h
legacyvar.h
limits.h
md_var.h Revert previous change. 2007-01-18 05:46:32 +00:00
memdev.h
metadata.h
minidump.h
mp_watchdog.h
mptable.h
mutex.h Move clock_lock prototype into <machine/clock.h>, where it is more 2006-05-19 18:53:50 +00:00
param.h
pcb_ext.h
pcb.h
pci_cfgreg.h
pcpu.h Simplified PCPU_GET() and PCPU_SET(). We must copy through a temporary 2007-02-06 16:21:09 +00:00
pmap.h Use a different bitmask for superpages' base address so that it 2006-12-05 11:31:33 +00:00
pmc_mdep.h
ppireg.h
proc.h
profile.h In the userland .mcount(): 2006-10-28 13:12:06 +00:00
psl.h
ptrace.h
reg.h Add support for 8 byte hardware watches in long mode. Kernel hardware 2006-11-17 20:27:01 +00:00
reloc.h
resource.h
runq.h
segments.h
setjmp.h Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00
sf_buf.h
sigframe.h
signal.h
smp.h Add a new 'pmap_invalidate_cache()' to flush the CPU caches via the 2006-05-01 21:36:47 +00:00
specialreg.h Add SSSE3 extensions and correct CNXT-ID spelling for Intel processors. 2007-01-09 19:23:22 +00:00
stdarg.h Use __builtin_va_start instead of __builtin_stdarg_start. GCC4 obsoletes 2006-09-21 01:37:02 +00:00
sysarch.h
timerreg.h
trap.h
tss.h
ucontext.h
varargs.h
vmparam.h