From: "Jan Beulich" Subject: [PATCH] x86: use single definitions for a few constants Date: Thu, 14 Feb 2013 16:58:28 +0000 Message-ID: <511D25C402000078000BE71E@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part97A7D6A4.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part97A7D6A4.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ... rather than having a C and an assembly one. Signed-off-by: Jan Beulich --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -112,19 +112,14 @@ extern unsigned char boot_edid_info[128] =20 #define CONFIG_COMPAT 1 =20 +#include + #define PML4_ENTRY_BITS 39 -#ifndef __ASSEMBLY__ -#define PML4_ENTRY_BYTES (1UL << PML4_ENTRY_BITS) -#define PML4_ADDR(_slot) \ - ((((_slot ## UL) >> 8) * 0xffff000000000000UL) | \ - (_slot ## UL << PML4_ENTRY_BITS)) -#define GB(_gb) (_gb ## UL << 30) -#else -#define PML4_ENTRY_BYTES (1 << PML4_ENTRY_BITS) -#define PML4_ADDR(_slot) \ - (((_slot >> 8) * 0xffff000000000000) | (_slot << PML4_ENTRY_BITS)) -#define GB(_gb) (_gb << 30) -#endif +#define PML4_ENTRY_BYTES (_AC(1,UL) << PML4_ENTRY_BITS) +#define PML4_ADDR(_slot) \ + (((_AC(_slot, UL) >> 8) * _AC(0xffff000000000000,UL)) | \ + (_AC(_slot, UL) << PML4_ENTRY_BITS)) +#define GB(_gb) (_AC(_gb, UL) << 30) =20 /* * Memory layout: @@ -242,7 +237,7 @@ extern unsigned char boot_edid_info[128] PAGE_SHIFT)) + = 1) #define SPAGETABLE_SIZE (SPAGETABLE_NR * sizeof(struct spage_info)= ) #define SPAGETABLE_VIRT_START ((SPAGETABLE_VIRT_END - SPAGETABLE_SIZE) = & \ - (-1UL << SUPERPAGE_SHIFT)) + (_AC(-1,UL) << SUPERPAGE_SHIFT)) /* Slot 261: page-frame information array (128GB). */ #define FRAMETABLE_VIRT_END DIRECTMAP_VIRT_START #define FRAMETABLE_SIZE GB(128) --=__Part97A7D6A4.0__= Content-Type: text/plain; name="x86-unify-constants.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-unify-constants.patch" x86: use single definitions for a few constants=0A=0A... rather than = having a C and an assembly one.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- a/xen/include/asm-x86/config.h=0A+++ b/xen/include/asm-x8= 6/config.h=0A@@ -112,19 +112,14 @@ extern unsigned char boot_edid_info[128]= =0A =0A #define CONFIG_COMPAT 1=0A =0A+#include =0A+=0A = #define PML4_ENTRY_BITS 39=0A-#ifndef __ASSEMBLY__=0A-#define PML4_ENTRY_B= YTES (1UL << PML4_ENTRY_BITS)=0A-#define PML4_ADDR(_slot) = \=0A- ((((_slot ## UL) >> 8) * 0xffff000000000000UL) | \=0A- = (_slot ## UL << PML4_ENTRY_BITS))=0A-#define GB(_gb) (_gb ## UL << = 30)=0A-#else=0A-#define PML4_ENTRY_BYTES (1 << PML4_ENTRY_BITS)=0A-#define = PML4_ADDR(_slot) \=0A- (((_slot >> 8) * = 0xffff000000000000) | (_slot << PML4_ENTRY_BITS))=0A-#define GB(_gb) (_gb = << 30)=0A-#endif=0A+#define PML4_ENTRY_BYTES (_AC(1,UL) << PML4_ENTRY_BITS)= =0A+#define PML4_ADDR(_slot) \=0A+ = (((_AC(_slot, UL) >> 8) * _AC(0xffff000000000000,UL)) | \=0A+ = (_AC(_slot, UL) << PML4_ENTRY_BITS))=0A+#define GB(_gb) (_AC(_gb, UL) << = 30)=0A =0A /*=0A * Memory layout:=0A@@ -242,7 +237,7 @@ extern unsigned = char boot_edid_info[128]=0A = PAGE_SHIFT)) + 1)=0A #define SPAGETABLE_SIZE (SPAGETABLE= _NR * sizeof(struct spage_info))=0A #define SPAGETABLE_VIRT_START = ((SPAGETABLE_VIRT_END - SPAGETABLE_SIZE) & \=0A- = (-1UL << SUPERPAGE_SHIFT))=0A+ = (_AC(-1,UL) << SUPERPAGE_SHIFT))=0A /* Slot 261: page-frame information = array (128GB). */=0A #define FRAMETABLE_VIRT_END DIRECTMAP_VIRT_START= =0A #define FRAMETABLE_SIZE GB(128)=0A --=__Part97A7D6A4.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part97A7D6A4.0__=--