[tip:x86/trampoline] x86: Make the GDT_ENTRY() macro in <asm/segment.h> safe for assembly

From: tip-bot for H. Peter Anvin
Date: Fri Feb 18 2011 - 00:20:25 EST


Commit-ID: 014eea518af3d141e276664cf40ef3da899eba35
Gitweb: http://git.kernel.org/tip/014eea518af3d141e276664cf40ef3da899eba35
Author: H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>
AuthorDate: Mon, 14 Feb 2011 18:33:55 -0800
Committer: H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>
CommitDate: Thu, 17 Feb 2011 21:05:13 -0800

x86: Make the GDT_ENTRY() macro in <asm/segment.h> safe for assembly

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@xxxxxxxxxxxxxxx>
LKML-Reference: <4D5DFBE4.7090104@xxxxxxxxx>
Cc: Rafael J. Wysocki <rjw@xxxxxxx>
Cc: Matthieu Castet <castet.matthieu@xxxxxxx>
Cc: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
---
arch/x86/include/asm/segment.h | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
index 231f1c1..cd84f72 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -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 */

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/