ia64/xen-unstable

changeset 8692:3e7bcf1b6f70

Fix build.

Signed-off-by: Steven Smith, sos22@cam.ac.uk
author sos22@douglas.cl.cam.ac.uk
date Sat Jan 28 11:09:18 2006 +0100 (2006-01-28)
parents 5a9efc35feb2
children 491a8798945e
files linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c	Fri Jan 27 22:18:15 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c	Sat Jan 28 11:09:18 2006 +0100
     1.3 @@ -93,14 +93,11 @@ static void early_make_mmu_page_readonly
     1.4  		BUG();
     1.5  }
     1.6  
     1.7 -void make_mmu_page_readonly(void *va)
     1.8 +void make_page_readonly(void *va)
     1.9  {
    1.10  	pgd_t *pgd; pud_t *pud; pmd_t *pmd; pte_t pte, *ptep;
    1.11  	unsigned long addr = (unsigned long) va;
    1.12  
    1.13 -	if (xen_feature(writable_mmu_structures))
    1.14 -		return;
    1.15 -
    1.16  	pgd = pgd_offset_k(addr);
    1.17  	pud = pud_offset(pgd, addr);
    1.18  	pmd = pmd_offset(pud, addr);
    1.19 @@ -111,17 +108,21 @@ void make_mmu_page_readonly(void *va)
    1.20  		xen_l1_entry_update(ptep, pte); /* fallback */
    1.21  
    1.22  	if ((addr >= VMALLOC_START) && (addr < VMALLOC_END))
    1.23 -		make_mmu_page_readonly(__va(pte_pfn(pte) << PAGE_SHIFT));
    1.24 +		make_page_readonly(__va(pte_pfn(pte) << PAGE_SHIFT));
    1.25  }
    1.26  
    1.27 -void make_mmu_page_writable(void *va)
    1.28 +void make_mmu_page_readonly(void *va)
    1.29 +{
    1.30 +	if (xen_feature(writable_mmu_structures))
    1.31 +		return;
    1.32 +	make_page_readonly(va);
    1.33 +}
    1.34 +
    1.35 +void make_page_writable(void *va)
    1.36  {
    1.37  	pgd_t *pgd; pud_t *pud; pmd_t *pmd; pte_t pte, *ptep;
    1.38  	unsigned long addr = (unsigned long) va;
    1.39  
    1.40 -	if (xen_feature(writable_mmu_structures))
    1.41 -		return;
    1.42 -
    1.43  	pgd = pgd_offset_k(addr);
    1.44  	pud = pud_offset(pgd, addr);
    1.45  	pmd = pmd_offset(pud, addr);
    1.46 @@ -132,16 +133,35 @@ void make_mmu_page_writable(void *va)
    1.47  		xen_l1_entry_update(ptep, pte); /* fallback */
    1.48  
    1.49  	if ((addr >= VMALLOC_START) && (addr < VMALLOC_END))
    1.50 -		make_mmu_page_writable(__va(pte_pfn(pte) << PAGE_SHIFT));
    1.51 +		make_page_writable(__va(pte_pfn(pte) << PAGE_SHIFT));
    1.52 +}
    1.53 +
    1.54 +void make_mmu_page_writable(void *va)
    1.55 +{
    1.56 +	if (xen_feature(writable_mmu_structures))
    1.57 +		return;
    1.58 +	make_page_writable(va);
    1.59 +}
    1.60 +
    1.61 +void make_pages_readonly(void *va, unsigned nr)
    1.62 +{
    1.63 +	while (nr-- != 0) {
    1.64 +		make_page_readonly(va);
    1.65 +		va = (void*)((unsigned long)va + PAGE_SIZE);
    1.66 +	}
    1.67  }
    1.68  
    1.69  void make_mmu_pages_readonly(void *va, unsigned nr)
    1.70  {
    1.71  	if (xen_feature(writable_mmu_structures))
    1.72  		return;
    1.73 +	make_pages_readonly(va, nr);
    1.74 +}
    1.75  
    1.76 +void make_pages_writable(void *va, unsigned nr)
    1.77 +{
    1.78  	while (nr-- != 0) {
    1.79 -		make_mmu_page_readonly(va);
    1.80 +		make_page_writable(va);
    1.81  		va = (void*)((unsigned long)va + PAGE_SIZE);
    1.82  	}
    1.83  }
    1.84 @@ -150,10 +170,7 @@ void make_mmu_pages_writable(void *va, u
    1.85  {
    1.86  	if (xen_feature(writable_mmu_structures))
    1.87  		return;
    1.88 -	while (nr-- != 0) {
    1.89 -		make_mmu_page_writable(va);
    1.90 -		va = (void*)((unsigned long)va + PAGE_SIZE);
    1.91 -	}
    1.92 +	make_pages_writable(va, nr);
    1.93  }
    1.94  
    1.95  /*