From: "Jan Beulich" Subject: [PATCH] x86: move and fold certain type property definitions Date: Thu, 12 Jan 2012 12:36:44 +0000 Message-ID: <4F0EE1EC020000780006C16D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part36187ACC.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" 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. --=__Part36187ACC.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Not only is it less code to have them consolidated, it also permits their use virtually everywhere (since config.h is required to be included everywhere. (Shouldn't we, btw, follow Linux and remove the explicit inclusion in favor of command line enforced one?) Signed-off-by: Jan Beulich --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -8,11 +8,16 @@ #define __X86_CONFIG_H__ =20 #if defined(__x86_64__) +# define LONG_BYTEORDER 3 # define CONFIG_PAGING_LEVELS 4 #else +# define LONG_BYTEORDER 2 # define CONFIG_PAGING_LEVELS 3 #endif =20 +#define BYTES_PER_LONG (1 << LONG_BYTEORDER) +#define BITS_PER_LONG (BYTES_PER_LONG << 3) + #define CONFIG_X86 1 #define CONFIG_X86_HT 1 #define CONFIG_PAGING_ASSISTANCE 1 --- a/xen/include/asm-x86/types.h +++ b/xen/include/asm-x86/types.h @@ -55,14 +55,4 @@ typedef char bool_t; =20 #endif /* __ASSEMBLY__ */ =20 -#if defined(__i386__) -#define BITS_PER_LONG 32 -#define BYTES_PER_LONG 4 -#define LONG_BYTEORDER 2 -#elif defined(__x86_64__) -#define BITS_PER_LONG 64 -#define BYTES_PER_LONG 8 -#define LONG_BYTEORDER 3 -#endif - #endif /* __X86_TYPES_H__ */ --=__Part36187ACC.0__= Content-Type: text/plain; name="x86-type-config.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-type-config.patch" x86: move and fold certain type property definitions=0A=0ANot only is it = less code to have them consolidated, it also permits=0Atheir use virtually = everywhere (since config.h is required to be=0Aincluded everywhere. = (Shouldn't we, btw, follow Linux and remove the=0Aexplicit inclusion in = favor of command line enforced one?)=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/include/asm-x86/config.h=0A+++ = b/xen/include/asm-x86/config.h=0A@@ -8,11 +8,16 @@=0A #define __X86_CONFIG_= H__=0A =0A #if defined(__x86_64__)=0A+# define LONG_BYTEORDER 3=0A # = define CONFIG_PAGING_LEVELS 4=0A #else=0A+# define LONG_BYTEORDER 2=0A # = define CONFIG_PAGING_LEVELS 3=0A #endif=0A =0A+#define BYTES_PER_LONG (1 = << LONG_BYTEORDER)=0A+#define BITS_PER_LONG (BYTES_PER_LONG << 3)=0A+=0A = #define CONFIG_X86 1=0A #define CONFIG_X86_HT 1=0A #define CONFIG_PAGING_AS= SISTANCE 1=0A--- a/xen/include/asm-x86/types.h=0A+++ b/xen/include/asm-x86/= types.h=0A@@ -55,14 +55,4 @@ typedef char bool_t;=0A =0A #endif /* = __ASSEMBLY__ */=0A =0A-#if defined(__i386__)=0A-#define BITS_PER_LONG = 32=0A-#define BYTES_PER_LONG 4=0A-#define LONG_BYTEORDER 2=0A-#elif = defined(__x86_64__)=0A-#define BITS_PER_LONG 64=0A-#define BYTES_PER_LONG = 8=0A-#define LONG_BYTEORDER 3=0A-#endif=0A-=0A #endif /* __X86_TYPES_H__ = */=0A --=__Part36187ACC.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.xensource.com http://lists.xensource.com/xen-devel --=__Part36187ACC.0__=--