freebsd-dev/sys/amd64
Attilio Rao 86d2e48c22 Per their definition, atomic instructions used in conjuction with
memory barriers should also ensure that the compiler doesn't reorder paths
where they are used.  GCC, however, does that aggressively, even in
presence of volatile operands.  The most reliable way GCC offers for avoid
instructions reordering is clobbering "memory" even if that is
theoretically an heavy-weight operation, flushing the content of all
the registers and forcing reload of them (We could rely, however, on
gcc DTRT by just understanding the purpose as this is a well-known
pattern for many modern operating-systems).

Not all our memory barriers, right now, clobber memory for GCC-like
compilers. The most notable cases are IA32 and amd64 where the memory
barrier are treacted the same as normal atomic instructions.
Fix this by offering the possibility to implement atomic instructions
with memory barriers separately from the normal version and implement
the GCC-like specific one using memory clobbering.
Thanks to Chris Lattner (@apple) for his discussion on llvm specifics.

Reported by:	jhb
Reviewed by:	jhb
Tested by:	rdivacky, Giovanni Trematerra
		<giovanni dot trematerra at gmail dot com>
2009-10-06 13:45:49 +00:00
..
acpica Copy apm(4) emulation from sys/i386/acpica/acpi_machdep.c and 2009-09-27 14:00:16 +00:00
amd64 Make sure that the primary native brandinfo always gets added 2009-10-03 11:57:21 +00:00
compile
conf Improve 802.11s comment. 2009-10-01 02:08:42 +00:00
ia32 Restore the segment registers and segment base MSRs for amd64 syscall 2009-07-09 09:34:11 +00:00
include Per their definition, atomic instructions used in conjuction with 2009-10-06 13:45:49 +00:00
isa Improve the handling of cpuset with interrupts. 2009-07-01 17:20:07 +00:00
linux32 As jhb@ pointed out to me, r197057 was incorrect, not least because these 2009-09-10 13:20:27 +00:00
pci number of cleanups in i386 and amd64 pci md code 2009-09-24 07:11:23 +00:00
Makefile Adjustments to make a tags file a bit more suitable to amd64. 2008-12-01 14:15:10 +00:00