ia64/xen-unstable

changeset 19604:eb66644da833

x86: Use PGC_cacheattr_mask rather than a hardcoded constant.

Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 19 01:17:16 2009 +0100 (2009-05-19)
parents 9890a1e5b6ab
children c1340cda65fb
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Mon May 18 13:53:55 2009 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Tue May 19 01:17:16 2009 +0100
     1.3 @@ -766,7 +766,7 @@ get_page_from_l1e(
     1.4          goto could_not_pin;
     1.5  
     1.6      if ( pte_flags_to_cacheattr(l1f) !=
     1.7 -         ((page->count_info >> PGC_cacheattr_base) & 7) )
     1.8 +         ((page->count_info & PGC_cacheattr_mask) >> PGC_cacheattr_base) )
     1.9      {
    1.10          unsigned long x, nx, y = page->count_info;
    1.11          unsigned long cacheattr = pte_flags_to_cacheattr(l1f);
    1.12 @@ -782,7 +782,7 @@ get_page_from_l1e(
    1.13              return 0;
    1.14          }
    1.15  
    1.16 -        while ( ((y >> PGC_cacheattr_base) & 7) != cacheattr )
    1.17 +        while ( ((y & PGC_cacheattr_mask) >> PGC_cacheattr_base) != cacheattr )
    1.18          {
    1.19              x  = y;
    1.20              nx = (x & ~PGC_cacheattr_mask) | (cacheattr << PGC_cacheattr_base);
    1.21 @@ -2389,7 +2389,8 @@ int get_page_type_preemptible(struct pag
    1.22  
    1.23  void cleanup_page_cacheattr(struct page_info *page)
    1.24  {
    1.25 -    uint32_t cacheattr = (page->count_info >> PGC_cacheattr_base) & 7;
    1.26 +    uint32_t cacheattr =
    1.27 +        (page->count_info & PGC_cacheattr_mask) >> PGC_cacheattr_base;
    1.28  
    1.29      if ( likely(cacheattr == 0) )
    1.30          return;