freebsd-dev/sys/x86/include
Dimitry Andric d4ddb330c9 Fix the following clang warning in sys/dev/dcons/dcons.c, caused by the
recent changes in sys/x86/include/endian.h:

  sys/dev/dcons/dcons.c:190:15: error: implicit conversion from '__uint32_t' (aka 'unsigned int') to '__uint16_t' (aka 'unsigned short') changes value from 1684238190 to 28526 [-Werror,-Wconstant-conversion]
	  buf->magic = ntohl(DCONS_MAGIC);
		       ^~~~~~~~~~~~~~~~~~
  sys/sys/param.h:306:18: note: expanded from:
  #define ntohl(x)        __ntohl(x)
			  ^
  ./x86/endian.h:128:20: note: expanded from:
  #define __ntohl(x)      __bswap32(x)
			  ^
  ./x86/endian.h:78:20: note: expanded from:
	      __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
			    ^
  ./x86/endian.h:68:26: note: expanded from:
	  (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16))
				  ^
  ./x86/endian.h:75:53: note: expanded from:
	      __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
					       ~~~~~~~~~~~~~ ^

This is because the __bswapXX_gen() macros (for x86) call the regular
__bswapXX() macros.  Since the __bswapXX_gen() variants are only called
when their arguments are constant, there is no need to do that constancy
check recursively.  Also, it causes the above error with clang.

Fix it by calling __bswap16_gen() from __bswap32_gen(), and similarly,
__bswap32_gen() from  __bswap64_gen().

While here, add extra parentheses around the __bswap16_gen() macro
expansion, to prevent unexpected side effects.
2012-03-24 10:07:21 +00:00
..
_align.h Merge amd64/i386 _align.h by aligning on the size of register_t (copied 2010-11-26 10:59:20 +00:00
_inttypes.h Copy powerpc/include/_inttypes.h to x86 and replace i386/amd64/pc98 2011-01-08 18:09:48 +00:00
_limits.h Copy amd64 _limits.h to x86 and merge with i386 _limits.h. Replace 2012-02-28 18:24:28 +00:00
_stdint.h Do not use INT64_C and UINT64_C to define 64 bit integer limits. They 2012-03-04 20:02:20 +00:00
_types.h Copy amd64 _types.h to x86 and merge with i386 _types.h. Replace existing 2012-02-28 18:15:28 +00:00
apicreg.h
apm_bios.h Move identical copies of apm_bios.h to sys/x86/include, replace them with 2010-11-11 19:36:21 +00:00
bus.h Merge amd64 and i386 bus.h and move the resulting header to x86. Replace 2010-12-20 16:39:43 +00:00
endian.h Fix the following clang warning in sys/dev/dcons/dcons.c, caused by the 2012-03-24 10:07:21 +00:00
float.h Copy amd64 float.h to x86 and merge with i386 float.h. Replace 2012-03-04 14:00:32 +00:00
fpu.h Move userland bits of i386 npx.h and amd64 fpu.h to x86 fpu.h. 2012-03-16 20:24:30 +00:00
mca.h
mptable.h Fix build when NEW_PCIB is not defined. 2011-07-16 14:05:34 +00:00
pci_cfgreg.h Move {amd64,i386}/pci/pci_bus.c and {amd64,i386}/include/pci_cfgreg.h to 2011-06-22 21:04:13 +00:00
psl.h Copy i386 psl.h to x86 and replace amd64/i386/pc98 psl.h with stubs. 2012-03-19 21:29:57 +00:00
ptrace.h Copy amd64 ptrace.h to x86 and merge with i386 ptrace.h. Replace 2012-03-04 20:24:28 +00:00
reg.h Eliminate ia32_reg.h by moving its contents to x86 and ia64 reg.h. 2012-03-18 19:12:11 +00:00
segments.h Move userland bits (and some common kernel bits) from amd64 and i386 2012-03-19 21:24:50 +00:00
setjmp.h Copy amd64 setjmp.h to x86 and replace amd64/i386/pc98 setjmp.h with stubs. 2012-02-28 22:17:52 +00:00
specialreg.h Copy i386 specialreg.h to x86 and merge with amd64 specialreg.h. Replace 2012-03-19 21:34:11 +00:00
stdarg.h Copy amd64 stdarg.h to x86 and replace amd64/i386/pc98 stdarg.h with stubs. 2012-02-28 22:30:58 +00:00
sysarch.h Copy amd64 sysarch.h to x86 and merge with i386 sysarch.h. Replace 2012-03-19 21:57:31 +00:00
trap.h Copy amd64 trap.h to x86 and replace amd64/i386/pc98 trap.h with stubs. 2012-03-04 14:12:57 +00:00