freebsd-dev/sys/x86
Dimitry Andric a80f8859c4 Fix an issue introduced in sys/x86/include/endian.h with r232721. In
that revision, the bswapXX_const() macros were renamed to bswapXX_gen().

Also, bswap64_gen() was implemented as two calls to bswap32(), and
similarly, bswap32_gen() as two calls to bswap16().  This mainly helps
our base gcc to produce more efficient assembly.

However, the arguments are not properly masked, which results in the
wrong value being calculated in some instances.  For example,
bswap32(0x12345678) returns 0x7c563412, and bswap64(0x123456789abcdef0)
returns 0xfcdefc9a7c563412.

Fix this by appropriately masking the arguments to bswap16() in
bswap32_gen(), and to bswap32() in bswap64_gen().  This should also
silence warnings from clang.

Submitted by:	jh
2012-03-29 23:31:48 +00:00
..
acpica
bios
cpufreq
include Fix an issue introduced in sys/x86/include/endian.h with r232721. In 2012-03-29 23:31:48 +00:00
isa Restore proper use of bounce buffers for ISA DMA. When locking was 2012-03-29 18:58:02 +00:00
pci Use a more proper fix for enabling HT MSI mapping windows on Host-PCI 2012-03-29 19:03:22 +00:00
x86 Use a more proper fix for enabling HT MSI mapping windows on Host-PCI 2012-03-29 19:03:22 +00:00