[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86: use single definitions for a few constants


  • To: Jan Beulich <JBeulich@xxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxx>
  • Date: Thu, 14 Feb 2013 20:52:52 +0000
  • Delivery-date: Thu, 14 Feb 2013 20:53:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac4K9UFZQHQMq45Kj0GlOAM81H4i7g==
  • Thread-topic: [Xen-devel] [PATCH] x86: use single definitions for a few constants

On 14/02/2013 16:58, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> ... rather than having a C and an assembly one.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Keir Fraser <keir@xxxxxxx>

> --- 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]
>  
>  #define CONFIG_COMPAT 1
>  
> +#include <xen/const.h>
> +
>  #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)
>  
>  /*
>   * 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)
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.