x86: Make the GDT_ENTRY() macro in <asm/segment.h> safe for assembly
authorH. Peter Anvin <hpa@linux.intel.com>
Tue, 15 Feb 2011 02:33:55 +0000 (18:33 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Fri, 18 Feb 2011 05:05:13 +0000 (21:05 -0800)
Make the GDT_ENTRY() macro in  <asm/segment.h> safe for use in
assembly code by guarding the ULL suffixes with _AC() macros.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
LKML-Reference: <4D5DFBE4.7090104@intel.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Matthieu Castet <castet.matthieu@free.fr>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
arch/x86/include/asm/segment.h

index 231f1c1..cd84f72 100644 (file)
@@ -1,14 +1,16 @@
 #ifndef _ASM_X86_SEGMENT_H
 #define _ASM_X86_SEGMENT_H
 
+#include <linux/const.h>
+
 /* Constructor for a conventional segment GDT (or LDT) entry */
 /* This is a macro so it can be used in initializers */
 #define GDT_ENTRY(flags, base, limit)                  \
-       ((((base)  & 0xff000000ULL) << (56-24)) |       \
-        (((flags) & 0x0000f0ffULL) << 40) |            \
-        (((limit) & 0x000f0000ULL) << (48-16)) |       \
-        (((base)  & 0x00ffffffULL) << 16) |            \
-        (((limit) & 0x0000ffffULL)))
+       ((((base)  & _AC(0xff000000,ULL)) << (56-24)) | \
+        (((flags) & _AC(0x0000f0ff,ULL)) << 40) |      \
+        (((limit) & _AC(0x000f0000,ULL)) << (48-16)) | \
+        (((base)  & _AC(0x00ffffff,ULL)) << 16) |      \
+        (((limit) & _AC(0x0000ffff,ULL))))
 
 /* Simple and small GDT entries for booting only */