ia64/xen-unstable

changeset 15892:b2a02f7ed849

[IA64] Make use of PAGE_MASK and PAGE_ALIGN()

As suggested by Isaku Yamahata

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author Alex Williamson <alex.williamson@hp.com>
date Mon Sep 17 13:38:25 2007 -0600 (2007-09-17)
parents fdd298b75fb5
children f3173d151e1d
files xen/arch/ia64/xen/mm.c xen/arch/ia64/xen/vhpt.c
line diff
     1.1 --- a/xen/arch/ia64/xen/mm.c	Mon Sep 17 13:26:19 2007 -0600
     1.2 +++ b/xen/arch/ia64/xen/mm.c	Mon Sep 17 13:38:25 2007 -0600
     1.3 @@ -524,7 +524,7 @@ u64 translate_domain_pte(u64 pteval, u64
     1.4  
     1.5  	pteval2 = lookup_domain_mpa(d, mpaddr, entry);
     1.6  	if (_itir.ps < PAGE_SHIFT)
     1.7 -		pteval2 |= mpaddr & (PAGE_SIZE - 1) & ~((1L << _itir.ps) - 1);
     1.8 +		pteval2 |= mpaddr & ~PAGE_MASK & ~((1L << _itir.ps) - 1);
     1.9  
    1.10  	/* Check access rights.  */
    1.11  	arflags  = pteval  & _PAGE_AR_MASK;
     2.1 --- a/xen/arch/ia64/xen/vhpt.c	Mon Sep 17 13:26:19 2007 -0600
     2.2 +++ b/xen/arch/ia64/xen/vhpt.c	Mon Sep 17 13:38:25 2007 -0600
     2.3 @@ -293,10 +293,10 @@ static void
     2.4  {
     2.5  	void *vhpt_base = __va(vhpt_maddr);
     2.6  	u64 pgsz = 1L << current->arch.vhpt_pg_shift;
     2.7 -	u64 purge_addr = vadr & ~(PAGE_SIZE - 1);
     2.8 +	u64 purge_addr = vadr & PAGE_MASK;
     2.9  
    2.10  	addr_range += vadr - purge_addr;
    2.11 -	addr_range = (addr_range + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
    2.12 +	addr_range = PAGE_ALIGN(addr_range);
    2.13  	while ((long)addr_range > 0) {
    2.14  		/* Get the VHPT entry.  */
    2.15  		unsigned int off = ia64_thash(purge_addr) -