All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: move and fold certain type property definitions
@ 2012-01-12 12:36 Jan Beulich
  2012-01-12 14:06 ` Keir Fraser
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2012-01-12 12:36 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1198 bytes --]

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 <jbeulich@suse.com>

--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -8,11 +8,16 @@
 #define __X86_CONFIG_H__
 
 #if defined(__x86_64__)
+# define LONG_BYTEORDER 3
 # define CONFIG_PAGING_LEVELS 4
 #else
+# define LONG_BYTEORDER 2
 # define CONFIG_PAGING_LEVELS 3
 #endif
 
+#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;
 
 #endif /* __ASSEMBLY__ */
 
-#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__ */




[-- Attachment #2: x86-type-config.patch --]
[-- Type: text/plain, Size: 1248 bytes --]

x86: move and fold certain type property definitions

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 <jbeulich@suse.com>

--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -8,11 +8,16 @@
 #define __X86_CONFIG_H__
 
 #if defined(__x86_64__)
+# define LONG_BYTEORDER 3
 # define CONFIG_PAGING_LEVELS 4
 #else
+# define LONG_BYTEORDER 2
 # define CONFIG_PAGING_LEVELS 3
 #endif
 
+#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;
 
 #endif /* __ASSEMBLY__ */
 
-#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__ */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: move and fold certain type property definitions
  2012-01-12 12:36 [PATCH] x86: move and fold certain type property definitions Jan Beulich
@ 2012-01-12 14:06 ` Keir Fraser
  2012-01-12 16:39   ` [PATCH 0/2] enforce inclusion of xen/config.h (Re: [PATCH] x86: move and fold certain type property definitions) Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2012-01-12 14:06 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

On 12/01/2012 12:36, "Jan Beulich" <JBeulich@suse.com> wrote:

> 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?)

Yes, could do.

> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/include/asm-x86/config.h
> +++ b/xen/include/asm-x86/config.h
> @@ -8,11 +8,16 @@
>  #define __X86_CONFIG_H__
>  
>  #if defined(__x86_64__)
> +# define LONG_BYTEORDER 3
>  # define CONFIG_PAGING_LEVELS 4
>  #else
> +# define LONG_BYTEORDER 2
>  # define CONFIG_PAGING_LEVELS 3
>  #endif
>  
> +#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;
>  
>  #endif /* __ASSEMBLY__ */
>  
> -#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__ */
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 0/2] enforce inclusion of xen/config.h (Re: [PATCH] x86: move and fold certain type property definitions)
  2012-01-12 14:06 ` Keir Fraser
@ 2012-01-12 16:39   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2012-01-12 16:39 UTC (permalink / raw)
  To: Keir Fraser, xen-devel

>>> On 12.01.12 at 15:06, Keir Fraser <keir.xen@gmail.com> wrote:
> On 12/01/2012 12:36, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> 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?)
> 
> Yes, could do.

This pair of patches starts this process.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-12 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-12 12:36 [PATCH] x86: move and fold certain type property definitions Jan Beulich
2012-01-12 14:06 ` Keir Fraser
2012-01-12 16:39   ` [PATCH 0/2] enforce inclusion of xen/config.h (Re: [PATCH] x86: move and fold certain type property definitions) Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.