ia64/xen-unstable

changeset 9276:1055f276cc4d

[IA64] Remove header files where "page" is used

This patch is "step2" which we showed by the following mail.
http://lists.xensource.com/archives/html/xen-ia64-devel/2006-03/msg00305.html

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Fri Mar 17 13:23:01 2006 -0700 (2006-03-17)
parents e3aa5b2387ac
children 32c39e71740f
files xen/arch/ia64/xen/mm_init.c xen/arch/ia64/xen/xenmisc.c xen/include/asm-ia64/linux-null/asm-generic/pci-dma-compat.h xen/include/asm-ia64/linux-null/asm/scatterlist.h xen/include/asm-ia64/linux-null/linux/page-flags.h xen/include/asm-ia64/linux-xen/asm/page.h xen/include/asm-ia64/linux-xen/asm/pgalloc.h xen/include/asm-ia64/linux-xen/asm/pgtable.h xen/include/asm-ia64/linux-xen/linux/gfp.h xen/include/asm-ia64/linux/README.origin xen/include/asm-ia64/linux/asm-generic/README.origin xen/include/asm-ia64/linux/asm-generic/pci-dma-compat.h xen/include/asm-ia64/linux/asm/README.origin xen/include/asm-ia64/linux/asm/scatterlist.h xen/include/asm-ia64/linux/page-flags.h xen/include/asm-ia64/linux/rbtree.h xen/include/asm-ia64/mm.h
line diff
     1.1 --- a/xen/arch/ia64/xen/mm_init.c	Thu Mar 16 12:22:37 2006 -0700
     1.2 +++ b/xen/arch/ia64/xen/mm_init.c	Fri Mar 17 13:23:01 2006 -0700
     1.3 @@ -69,7 +69,7 @@ EXPORT_SYMBOL(vmem_map);
     1.4  struct page_info *zero_page_memmap_ptr;	/* map entry for zero page */
     1.5  EXPORT_SYMBOL(zero_page_memmap_ptr);
     1.6  
     1.7 -#ifdef XEN
     1.8 +#ifndef XEN
     1.9  void *high_memory;
    1.10  EXPORT_SYMBOL(high_memory);
    1.11  
     2.1 --- a/xen/arch/ia64/xen/xenmisc.c	Thu Mar 16 12:22:37 2006 -0700
     2.2 +++ b/xen/arch/ia64/xen/xenmisc.c	Fri Mar 17 13:23:01 2006 -0700
     2.3 @@ -114,23 +114,6 @@ while(1);
     2.4  #endif
     2.5  
     2.6  ///////////////////////////////
     2.7 -// from arch/ia64/page_alloc.c
     2.8 -///////////////////////////////
     2.9 -DEFINE_PER_CPU(struct page_state, page_states) = {0};
    2.10 -unsigned long totalram_pages;
    2.11 -
    2.12 -void __mod_page_state(unsigned long offset, unsigned long delta)
    2.13 -{
    2.14 -	unsigned long flags;
    2.15 -	void* ptr;
    2.16 -
    2.17 -	local_irq_save(flags);
    2.18 -	ptr = &__get_cpu_var(page_states);
    2.19 -	*(unsigned long*)(ptr + offset) += delta;
    2.20 -	local_irq_restore(flags);
    2.21 -}
    2.22 -
    2.23 -///////////////////////////////
    2.24  // from arch/x86/flushtlb.c
    2.25  ///////////////////////////////
    2.26  
     6.1 --- a/xen/include/asm-ia64/linux-xen/asm/page.h	Thu Mar 16 12:22:37 2006 -0700
     6.2 +++ b/xen/include/asm-ia64/linux-xen/asm/page.h	Fri Mar 17 13:23:01 2006 -0700
     6.3 @@ -75,7 +75,7 @@ do {						\
     6.4  	flush_dcache_page(page);		\
     6.5  } while (0)
     6.6  
     6.7 -
     6.8 +#ifndef XEN
     6.9  #define alloc_zeroed_user_highpage(vma, vaddr) \
    6.10  ({						\
    6.11  	struct page *page = alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr); \
    6.12 @@ -83,6 +83,7 @@ do {						\
    6.13   		flush_dcache_page(page);	\
    6.14  	page;					\
    6.15  })
    6.16 +#endif
    6.17  
    6.18  #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
    6.19  
     7.1 --- a/xen/include/asm-ia64/linux-xen/asm/pgalloc.h	Thu Mar 16 12:22:37 2006 -0700
     7.2 +++ b/xen/include/asm-ia64/linux-xen/asm/pgalloc.h	Fri Mar 17 13:23:01 2006 -0700
     7.3 @@ -106,11 +106,13 @@ static inline void pmd_free(pmd_t * pmd)
     7.4  
     7.5  #define __pmd_free_tlb(tlb, pmd)	pmd_free(pmd)
     7.6  
     7.7 +#ifndef XEN
     7.8  static inline void
     7.9  pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte)
    7.10  {
    7.11  	pmd_val(*pmd_entry) = page_to_maddr(pte);
    7.12  }
    7.13 +#endif
    7.14  
    7.15  static inline void
    7.16  pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)
    7.17 @@ -118,11 +120,13 @@ pmd_populate_kernel(struct mm_struct *mm
    7.18  	pmd_val(*pmd_entry) = __pa(pte);
    7.19  }
    7.20  
    7.21 +#ifndef XEN
    7.22  static inline struct page *pte_alloc_one(struct mm_struct *mm,
    7.23  					 unsigned long addr)
    7.24  {
    7.25  	return virt_to_page(pgtable_quicklist_alloc());
    7.26  }
    7.27 +#endif
    7.28  
    7.29  static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
    7.30  					  unsigned long addr)
    7.31 @@ -130,6 +134,7 @@ static inline pte_t *pte_alloc_one_kerne
    7.32  	return pgtable_quicklist_alloc();
    7.33  }
    7.34  
    7.35 +#ifndef XEN
    7.36  static inline void pte_free(struct page *pte)
    7.37  {
    7.38  	pgtable_quicklist_free(page_address(pte));
    7.39 @@ -141,6 +146,7 @@ static inline void pte_free_kernel(pte_t
    7.40  }
    7.41  
    7.42  #define __pte_free_tlb(tlb, pte)	pte_free(pte)
    7.43 +#endif
    7.44  
    7.45  extern void check_pgt_cache(void);
    7.46  
     8.1 --- a/xen/include/asm-ia64/linux-xen/asm/pgtable.h	Thu Mar 16 12:22:37 2006 -0700
     8.2 +++ b/xen/include/asm-ia64/linux-xen/asm/pgtable.h	Fri Mar 17 13:23:01 2006 -0700
     8.3 @@ -467,8 +467,10 @@ extern void paging_init (void);
     8.4   * for zero-mapped memory areas etc..
     8.5   */
     8.6  extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
     8.7 +#ifndef XEN
     8.8  extern struct page *zero_page_memmap_ptr;
     8.9  #define ZERO_PAGE(vaddr) (zero_page_memmap_ptr)
    8.10 +#endif
    8.11  
    8.12  /* We provide our own get_unmapped_area to cope with VA holes for userland */
    8.13  #define HAVE_ARCH_UNMAPPED_AREA
     9.1 --- a/xen/include/asm-ia64/linux-xen/linux/gfp.h	Thu Mar 16 12:22:37 2006 -0700
     9.2 +++ b/xen/include/asm-ia64/linux-xen/linux/gfp.h	Fri Mar 17 13:23:01 2006 -0700
     9.3 @@ -82,11 +82,11 @@ struct vm_area_struct;
     9.4   * optimized to &contig_page_data at compile-time.
     9.5   */
     9.6  
     9.7 +#ifndef XEN
     9.8  #ifndef HAVE_ARCH_FREE_PAGE
     9.9  static inline void arch_free_page(struct page *page, int order) { }
    9.10  #endif
    9.11  
    9.12 -#ifndef XEN
    9.13  extern struct page *
    9.14  FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *));
    9.15  
    9.16 @@ -119,7 +119,6 @@ extern struct page *alloc_page_vma(unsig
    9.17  #define alloc_page_vma(gfp_mask, vma, addr) alloc_pages(gfp_mask, 0)
    9.18  #endif
    9.19  #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
    9.20 -#endif /* XEN */
    9.21  
    9.22  extern unsigned long FASTCALL(__get_free_pages(unsigned int __nocast gfp_mask, unsigned int order));
    9.23  extern unsigned long FASTCALL(get_zeroed_page(unsigned int __nocast gfp_mask));
    9.24 @@ -137,6 +136,7 @@ extern void FASTCALL(free_cold_page(stru
    9.25  
    9.26  #define __free_page(page) __free_pages((page), 0)
    9.27  #define free_page(addr) free_pages((addr),0)
    9.28 +#endif /* XEN */
    9.29  
    9.30  void page_alloc_init(void);
    9.31  #ifdef CONFIG_NUMA
    10.1 --- a/xen/include/asm-ia64/linux/README.origin	Thu Mar 16 12:22:37 2006 -0700
    10.2 +++ b/xen/include/asm-ia64/linux/README.origin	Fri Mar 17 13:23:01 2006 -0700
    10.3 @@ -16,10 +16,8 @@ kmalloc_sizes.h		-> linux/include/linux/
    10.4  linkage.h		-> linux/include/linux/linkage.h
    10.5  notifier.h		-> linux/include/linux/notifier.h
    10.6  numa.h			-> linux/include/linux/numa.h
    10.7 -page-flags.h		-> linux/include/linux/page-flags.h
    10.8  percpu.h		-> linux/include/linux/percpu.h
    10.9  preempt.h		-> linux/include/linux/preempt.h
   10.10 -rbtree.h		-> linux/include/linux/rbtree.h
   10.11  rwsem.h			-> linux/include/linux/rwsem.h
   10.12  seqlock.h		-> linux/include/linux/seqlock.h
   10.13  sort.h			-> linux/include/linux/sort.h
    11.1 --- a/xen/include/asm-ia64/linux/asm-generic/README.origin	Thu Mar 16 12:22:37 2006 -0700
    11.2 +++ b/xen/include/asm-ia64/linux/asm-generic/README.origin	Fri Mar 17 13:23:01 2006 -0700
    11.3 @@ -10,7 +10,6 @@ errno-base.h		-> linux/include/asm-gener
    11.4  errno.h			-> linux/include/asm-generic/errno.h
    11.5  ide_iops.h		-> linux/include/asm-generic/ide_iops.h
    11.6  iomap.h			-> linux/include/asm-generic/iomap.h
    11.7 -pci-dma-compat.h	-> linux/include/asm-generic/pci-dma-compat.h
    11.8  pci.h			-> linux/include/asm-generic/pci.h
    11.9  pgtable.h		-> linux/include/asm-generic/pgtable.h
   11.10  pgtable-nopud.h		-> linux/include/asm-generic/pgtable-nopud.h
    12.1 --- a/xen/include/asm-ia64/linux/asm-generic/pci-dma-compat.h	Thu Mar 16 12:22:37 2006 -0700
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,107 +0,0 @@
    12.4 -/* include this file if the platform implements the dma_ DMA Mapping API
    12.5 - * and wants to provide the pci_ DMA Mapping API in terms of it */
    12.6 -
    12.7 -#ifndef _ASM_GENERIC_PCI_DMA_COMPAT_H
    12.8 -#define _ASM_GENERIC_PCI_DMA_COMPAT_H
    12.9 -
   12.10 -#include <linux/dma-mapping.h>
   12.11 -
   12.12 -/* note pci_set_dma_mask isn't here, since it's a public function
   12.13 - * exported from drivers/pci, use dma_supported instead */
   12.14 -
   12.15 -static inline int
   12.16 -pci_dma_supported(struct pci_dev *hwdev, u64 mask)
   12.17 -{
   12.18 -	return dma_supported(hwdev == NULL ? NULL : &hwdev->dev, mask);
   12.19 -}
   12.20 -
   12.21 -static inline void *
   12.22 -pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
   12.23 -		     dma_addr_t *dma_handle)
   12.24 -{
   12.25 -	return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, dma_handle, GFP_ATOMIC);
   12.26 -}
   12.27 -
   12.28 -static inline void
   12.29 -pci_free_consistent(struct pci_dev *hwdev, size_t size,
   12.30 -		    void *vaddr, dma_addr_t dma_handle)
   12.31 -{
   12.32 -	dma_free_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, vaddr, dma_handle);
   12.33 -}
   12.34 -
   12.35 -static inline dma_addr_t
   12.36 -pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
   12.37 -{
   12.38 -	return dma_map_single(hwdev == NULL ? NULL : &hwdev->dev, ptr, size, (enum dma_data_direction)direction);
   12.39 -}
   12.40 -
   12.41 -static inline void
   12.42 -pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
   12.43 -		 size_t size, int direction)
   12.44 -{
   12.45 -	dma_unmap_single(hwdev == NULL ? NULL : &hwdev->dev, dma_addr, size, (enum dma_data_direction)direction);
   12.46 -}
   12.47 -
   12.48 -static inline dma_addr_t
   12.49 -pci_map_page(struct pci_dev *hwdev, struct page *page,
   12.50 -	     unsigned long offset, size_t size, int direction)
   12.51 -{
   12.52 -	return dma_map_page(hwdev == NULL ? NULL : &hwdev->dev, page, offset, size, (enum dma_data_direction)direction);
   12.53 -}
   12.54 -
   12.55 -static inline void
   12.56 -pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,
   12.57 -	       size_t size, int direction)
   12.58 -{
   12.59 -	dma_unmap_page(hwdev == NULL ? NULL : &hwdev->dev, dma_address, size, (enum dma_data_direction)direction);
   12.60 -}
   12.61 -
   12.62 -static inline int
   12.63 -pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
   12.64 -	   int nents, int direction)
   12.65 -{
   12.66 -	return dma_map_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction);
   12.67 -}
   12.68 -
   12.69 -static inline void
   12.70 -pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
   12.71 -	     int nents, int direction)
   12.72 -{
   12.73 -	dma_unmap_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction);
   12.74 -}
   12.75 -
   12.76 -static inline void
   12.77 -pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t dma_handle,
   12.78 -		    size_t size, int direction)
   12.79 -{
   12.80 -	dma_sync_single_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction);
   12.81 -}
   12.82 -
   12.83 -static inline void
   12.84 -pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t dma_handle,
   12.85 -		    size_t size, int direction)
   12.86 -{
   12.87 -	dma_sync_single_for_device(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction);
   12.88 -}
   12.89 -
   12.90 -static inline void
   12.91 -pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg,
   12.92 -		int nelems, int direction)
   12.93 -{
   12.94 -	dma_sync_sg_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction);
   12.95 -}
   12.96 -
   12.97 -static inline void
   12.98 -pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg,
   12.99 -		int nelems, int direction)
  12.100 -{
  12.101 -	dma_sync_sg_for_device(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction);
  12.102 -}
  12.103 -
  12.104 -static inline int
  12.105 -pci_dma_mapping_error(dma_addr_t dma_addr)
  12.106 -{
  12.107 -	return dma_mapping_error(dma_addr);
  12.108 -}
  12.109 -
  12.110 -#endif
    13.1 --- a/xen/include/asm-ia64/linux/asm/README.origin	Thu Mar 16 12:22:37 2006 -0700
    13.2 +++ b/xen/include/asm-ia64/linux/asm/README.origin	Fri Mar 17 13:23:01 2006 -0700
    13.3 @@ -42,7 +42,6 @@ ptrace_offsets.h	-> linux/include/asm-ia
    13.4  rse.h			-> linux/include/asm-ia64/rse.h
    13.5  rwsem.h			-> linux/include/asm-ia64/rwsem.h
    13.6  sal.h			-> linux/include/asm-ia64/sal.h
    13.7 -scatterlist.h		-> linux/include/asm-ia64/scatterlist.h
    13.8  sections.h		-> linux/include/asm-ia64/sections.h
    13.9  semaphore.h		-> linux/include/asm-ia64/semaphore.h
   13.10  setup.h			-> linux/include/asm-ia64/setup.h
    14.1 --- a/xen/include/asm-ia64/linux/asm/scatterlist.h	Thu Mar 16 12:22:37 2006 -0700
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,28 +0,0 @@
    14.4 -#ifndef _ASM_IA64_SCATTERLIST_H
    14.5 -#define _ASM_IA64_SCATTERLIST_H
    14.6 -
    14.7 -/*
    14.8 - * Modified 1998-1999, 2001-2002, 2004
    14.9 - *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
   14.10 - */
   14.11 -
   14.12 -struct scatterlist {
   14.13 -	struct page *page;
   14.14 -	unsigned int offset;
   14.15 -	unsigned int length;	/* buffer length */
   14.16 -
   14.17 -	dma_addr_t dma_address;
   14.18 -	unsigned int dma_length;
   14.19 -};
   14.20 -
   14.21 -/*
   14.22 - * It used to be that ISA_DMA_THRESHOLD had something to do with the
   14.23 - * DMA-limits of ISA-devices.  Nowadays, its only remaining use (apart
   14.24 - * from the aha1542.c driver, which isn't 64-bit clean anyhow) is to
   14.25 - * tell the block-layer (via BLK_BOUNCE_ISA) what the max. physical
   14.26 - * address of a page is that is allocated with GFP_DMA.  On IA-64,
   14.27 - * that's 4GB - 1.
   14.28 - */
   14.29 -#define ISA_DMA_THRESHOLD	0xffffffff
   14.30 -
   14.31 -#endif /* _ASM_IA64_SCATTERLIST_H */
    15.1 --- a/xen/include/asm-ia64/linux/page-flags.h	Thu Mar 16 12:22:37 2006 -0700
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,324 +0,0 @@
    15.4 -/*
    15.5 - * Macros for manipulating and testing page->flags
    15.6 - */
    15.7 -
    15.8 -#ifndef PAGE_FLAGS_H
    15.9 -#define PAGE_FLAGS_H
   15.10 -
   15.11 -#include <linux/percpu.h>
   15.12 -#include <linux/cache.h>
   15.13 -#include <asm/pgtable.h>
   15.14 -
   15.15 -/*
   15.16 - * Various page->flags bits:
   15.17 - *
   15.18 - * PG_reserved is set for special pages, which can never be swapped out. Some
   15.19 - * of them might not even exist (eg empty_bad_page)...
   15.20 - *
   15.21 - * The PG_private bitflag is set if page->private contains a valid value.
   15.22 - *
   15.23 - * During disk I/O, PG_locked is used. This bit is set before I/O and
   15.24 - * reset when I/O completes. page_waitqueue(page) is a wait queue of all tasks
   15.25 - * waiting for the I/O on this page to complete.
   15.26 - *
   15.27 - * PG_uptodate tells whether the page's contents is valid.  When a read
   15.28 - * completes, the page becomes uptodate, unless a disk I/O error happened.
   15.29 - *
   15.30 - * For choosing which pages to swap out, inode pages carry a PG_referenced bit,
   15.31 - * which is set any time the system accesses that page through the (mapping,
   15.32 - * index) hash table.  This referenced bit, together with the referenced bit
   15.33 - * in the page tables, is used to manipulate page->age and move the page across
   15.34 - * the active, inactive_dirty and inactive_clean lists.
   15.35 - *
   15.36 - * Note that the referenced bit, the page->lru list_head and the active,
   15.37 - * inactive_dirty and inactive_clean lists are protected by the
   15.38 - * zone->lru_lock, and *NOT* by the usual PG_locked bit!
   15.39 - *
   15.40 - * PG_error is set to indicate that an I/O error occurred on this page.
   15.41 - *
   15.42 - * PG_arch_1 is an architecture specific page state bit.  The generic code
   15.43 - * guarantees that this bit is cleared for a page when it first is entered into
   15.44 - * the page cache.
   15.45 - *
   15.46 - * PG_highmem pages are not permanently mapped into the kernel virtual address
   15.47 - * space, they need to be kmapped separately for doing IO on the pages.  The
   15.48 - * struct page (these bits with information) are always mapped into kernel
   15.49 - * address space...
   15.50 - */
   15.51 -
   15.52 -/*
   15.53 - * Don't use the *_dontuse flags.  Use the macros.  Otherwise you'll break
   15.54 - * locked- and dirty-page accounting.  The top eight bits of page->flags are
   15.55 - * used for page->zone, so putting flag bits there doesn't work.
   15.56 - */
   15.57 -#define PG_locked	 	 0	/* Page is locked. Don't touch. */
   15.58 -#define PG_error		 1
   15.59 -#define PG_referenced		 2
   15.60 -#define PG_uptodate		 3
   15.61 -
   15.62 -#define PG_dirty	 	 4
   15.63 -#define PG_lru			 5
   15.64 -#define PG_active		 6
   15.65 -#define PG_slab			 7	/* slab debug (Suparna wants this) */
   15.66 -
   15.67 -#define PG_checked		 8	/* kill me in 2.5.<early>. */
   15.68 -#define PG_arch_1		 9
   15.69 -#define PG_reserved		10
   15.70 -#define PG_private		11	/* Has something at ->private */
   15.71 -
   15.72 -#define PG_writeback		12	/* Page is under writeback */
   15.73 -#define PG_nosave		13	/* Used for system suspend/resume */
   15.74 -#define PG_compound		14	/* Part of a compound page */
   15.75 -#define PG_swapcache		15	/* Swap page: swp_entry_t in private */
   15.76 -
   15.77 -#define PG_mappedtodisk		16	/* Has blocks allocated on-disk */
   15.78 -#define PG_reclaim		17	/* To be reclaimed asap */
   15.79 -#define PG_nosave_free		18	/* Free, should not be written */
   15.80 -#define PG_uncached		19	/* Page has been mapped as uncached */
   15.81 -
   15.82 -/*
   15.83 - * Global page accounting.  One instance per CPU.  Only unsigned longs are
   15.84 - * allowed.
   15.85 - */
   15.86 -struct page_state {
   15.87 -	unsigned long nr_dirty;		/* Dirty writeable pages */
   15.88 -	unsigned long nr_writeback;	/* Pages under writeback */
   15.89 -	unsigned long nr_unstable;	/* NFS unstable pages */
   15.90 -	unsigned long nr_page_table_pages;/* Pages used for pagetables */
   15.91 -	unsigned long nr_mapped;	/* mapped into pagetables */
   15.92 -	unsigned long nr_slab;		/* In slab */
   15.93 -#define GET_PAGE_STATE_LAST nr_slab
   15.94 -
   15.95 -	/*
   15.96 -	 * The below are zeroed by get_page_state().  Use get_full_page_state()
   15.97 -	 * to add up all these.
   15.98 -	 */
   15.99 -	unsigned long pgpgin;		/* Disk reads */
  15.100 -	unsigned long pgpgout;		/* Disk writes */
  15.101 -	unsigned long pswpin;		/* swap reads */
  15.102 -	unsigned long pswpout;		/* swap writes */
  15.103 -	unsigned long pgalloc_high;	/* page allocations */
  15.104 -
  15.105 -	unsigned long pgalloc_normal;
  15.106 -	unsigned long pgalloc_dma;
  15.107 -	unsigned long pgfree;		/* page freeings */
  15.108 -	unsigned long pgactivate;	/* pages moved inactive->active */
  15.109 -	unsigned long pgdeactivate;	/* pages moved active->inactive */
  15.110 -
  15.111 -	unsigned long pgfault;		/* faults (major+minor) */
  15.112 -	unsigned long pgmajfault;	/* faults (major only) */
  15.113 -	unsigned long pgrefill_high;	/* inspected in refill_inactive_zone */
  15.114 -	unsigned long pgrefill_normal;
  15.115 -	unsigned long pgrefill_dma;
  15.116 -
  15.117 -	unsigned long pgsteal_high;	/* total highmem pages reclaimed */
  15.118 -	unsigned long pgsteal_normal;
  15.119 -	unsigned long pgsteal_dma;
  15.120 -	unsigned long pgscan_kswapd_high;/* total highmem pages scanned */
  15.121 -	unsigned long pgscan_kswapd_normal;
  15.122 -
  15.123 -	unsigned long pgscan_kswapd_dma;
  15.124 -	unsigned long pgscan_direct_high;/* total highmem pages scanned */
  15.125 -	unsigned long pgscan_direct_normal;
  15.126 -	unsigned long pgscan_direct_dma;
  15.127 -	unsigned long pginodesteal;	/* pages reclaimed via inode freeing */
  15.128 -
  15.129 -	unsigned long slabs_scanned;	/* slab objects scanned */
  15.130 -	unsigned long kswapd_steal;	/* pages reclaimed by kswapd */
  15.131 -	unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */
  15.132 -	unsigned long pageoutrun;	/* kswapd's calls to page reclaim */
  15.133 -	unsigned long allocstall;	/* direct reclaim calls */
  15.134 -
  15.135 -	unsigned long pgrotated;	/* pages rotated to tail of the LRU */
  15.136 -	unsigned long nr_bounce;	/* pages for bounce buffers */
  15.137 -};
  15.138 -
  15.139 -extern void get_page_state(struct page_state *ret);
  15.140 -extern void get_full_page_state(struct page_state *ret);
  15.141 -extern unsigned long __read_page_state(unsigned long offset);
  15.142 -extern void __mod_page_state(unsigned long offset, unsigned long delta);
  15.143 -
  15.144 -#define read_page_state(member) \
  15.145 -	__read_page_state(offsetof(struct page_state, member))
  15.146 -
  15.147 -#define mod_page_state(member, delta)	\
  15.148 -	__mod_page_state(offsetof(struct page_state, member), (delta))
  15.149 -
  15.150 -#define inc_page_state(member)	mod_page_state(member, 1UL)
  15.151 -#define dec_page_state(member)	mod_page_state(member, 0UL - 1)
  15.152 -#define add_page_state(member,delta) mod_page_state(member, (delta))
  15.153 -#define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta))
  15.154 -
  15.155 -#define mod_page_state_zone(zone, member, delta)				\
  15.156 -	do {									\
  15.157 -		unsigned offset;						\
  15.158 -		if (is_highmem(zone))						\
  15.159 -			offset = offsetof(struct page_state, member##_high);	\
  15.160 -		else if (is_normal(zone))					\
  15.161 -			offset = offsetof(struct page_state, member##_normal);	\
  15.162 -		else								\
  15.163 -			offset = offsetof(struct page_state, member##_dma);	\
  15.164 -		__mod_page_state(offset, (delta));				\
  15.165 -	} while (0)
  15.166 -
  15.167 -/*
  15.168 - * Manipulation of page state flags
  15.169 - */
  15.170 -#define PageLocked(page)		\
  15.171 -		test_bit(PG_locked, &(page)->flags)
  15.172 -#define SetPageLocked(page)		\
  15.173 -		set_bit(PG_locked, &(page)->flags)
  15.174 -#define TestSetPageLocked(page)		\
  15.175 -		test_and_set_bit(PG_locked, &(page)->flags)
  15.176 -#define ClearPageLocked(page)		\
  15.177 -		clear_bit(PG_locked, &(page)->flags)
  15.178 -#define TestClearPageLocked(page)	\
  15.179 -		test_and_clear_bit(PG_locked, &(page)->flags)
  15.180 -
  15.181 -#define PageError(page)		test_bit(PG_error, &(page)->flags)
  15.182 -#define SetPageError(page)	set_bit(PG_error, &(page)->flags)
  15.183 -#define ClearPageError(page)	clear_bit(PG_error, &(page)->flags)
  15.184 -
  15.185 -#define PageReferenced(page)	test_bit(PG_referenced, &(page)->flags)
  15.186 -#define SetPageReferenced(page)	set_bit(PG_referenced, &(page)->flags)
  15.187 -#define ClearPageReferenced(page)	clear_bit(PG_referenced, &(page)->flags)
  15.188 -#define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags)
  15.189 -
  15.190 -#define PageUptodate(page)	test_bit(PG_uptodate, &(page)->flags)
  15.191 -#ifndef SetPageUptodate
  15.192 -#define SetPageUptodate(page)	set_bit(PG_uptodate, &(page)->flags)
  15.193 -#endif
  15.194 -#define ClearPageUptodate(page)	clear_bit(PG_uptodate, &(page)->flags)
  15.195 -
  15.196 -#define PageDirty(page)		test_bit(PG_dirty, &(page)->flags)
  15.197 -#define SetPageDirty(page)	set_bit(PG_dirty, &(page)->flags)
  15.198 -#define TestSetPageDirty(page)	test_and_set_bit(PG_dirty, &(page)->flags)
  15.199 -#define ClearPageDirty(page)	clear_bit(PG_dirty, &(page)->flags)
  15.200 -#define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags)
  15.201 -
  15.202 -#define SetPageLRU(page)	set_bit(PG_lru, &(page)->flags)
  15.203 -#define PageLRU(page)		test_bit(PG_lru, &(page)->flags)
  15.204 -#define TestSetPageLRU(page)	test_and_set_bit(PG_lru, &(page)->flags)
  15.205 -#define TestClearPageLRU(page)	test_and_clear_bit(PG_lru, &(page)->flags)
  15.206 -
  15.207 -#define PageActive(page)	test_bit(PG_active, &(page)->flags)
  15.208 -#define SetPageActive(page)	set_bit(PG_active, &(page)->flags)
  15.209 -#define ClearPageActive(page)	clear_bit(PG_active, &(page)->flags)
  15.210 -#define TestClearPageActive(page) test_and_clear_bit(PG_active, &(page)->flags)
  15.211 -#define TestSetPageActive(page) test_and_set_bit(PG_active, &(page)->flags)
  15.212 -
  15.213 -#define PageSlab(page)		test_bit(PG_slab, &(page)->flags)
  15.214 -#define SetPageSlab(page)	set_bit(PG_slab, &(page)->flags)
  15.215 -#define ClearPageSlab(page)	clear_bit(PG_slab, &(page)->flags)
  15.216 -#define TestClearPageSlab(page)	test_and_clear_bit(PG_slab, &(page)->flags)
  15.217 -#define TestSetPageSlab(page)	test_and_set_bit(PG_slab, &(page)->flags)
  15.218 -
  15.219 -#ifdef CONFIG_HIGHMEM
  15.220 -#define PageHighMem(page)	is_highmem(page_zone(page))
  15.221 -#else
  15.222 -#define PageHighMem(page)	0 /* needed to optimize away at compile time */
  15.223 -#endif
  15.224 -
  15.225 -#define PageChecked(page)	test_bit(PG_checked, &(page)->flags)
  15.226 -#define SetPageChecked(page)	set_bit(PG_checked, &(page)->flags)
  15.227 -#define ClearPageChecked(page)	clear_bit(PG_checked, &(page)->flags)
  15.228 -
  15.229 -#define PageReserved(page)	test_bit(PG_reserved, &(page)->flags)
  15.230 -#define SetPageReserved(page)	set_bit(PG_reserved, &(page)->flags)
  15.231 -#define ClearPageReserved(page)	clear_bit(PG_reserved, &(page)->flags)
  15.232 -#define __ClearPageReserved(page)	__clear_bit(PG_reserved, &(page)->flags)
  15.233 -
  15.234 -#define SetPagePrivate(page)	set_bit(PG_private, &(page)->flags)
  15.235 -#define ClearPagePrivate(page)	clear_bit(PG_private, &(page)->flags)
  15.236 -#define PagePrivate(page)	test_bit(PG_private, &(page)->flags)
  15.237 -#define __SetPagePrivate(page)  __set_bit(PG_private, &(page)->flags)
  15.238 -#define __ClearPagePrivate(page) __clear_bit(PG_private, &(page)->flags)
  15.239 -
  15.240 -#define PageWriteback(page)	test_bit(PG_writeback, &(page)->flags)
  15.241 -#define SetPageWriteback(page)						\
  15.242 -	do {								\
  15.243 -		if (!test_and_set_bit(PG_writeback,			\
  15.244 -				&(page)->flags))			\
  15.245 -			inc_page_state(nr_writeback);			\
  15.246 -	} while (0)
  15.247 -#define TestSetPageWriteback(page)					\
  15.248 -	({								\
  15.249 -		int ret;						\
  15.250 -		ret = test_and_set_bit(PG_writeback,			\
  15.251 -					&(page)->flags);		\
  15.252 -		if (!ret)						\
  15.253 -			inc_page_state(nr_writeback);			\
  15.254 -		ret;							\
  15.255 -	})
  15.256 -#define ClearPageWriteback(page)					\
  15.257 -	do {								\
  15.258 -		if (test_and_clear_bit(PG_writeback,			\
  15.259 -				&(page)->flags))			\
  15.260 -			dec_page_state(nr_writeback);			\
  15.261 -	} while (0)
  15.262 -#define TestClearPageWriteback(page)					\
  15.263 -	({								\
  15.264 -		int ret;						\
  15.265 -		ret = test_and_clear_bit(PG_writeback,			\
  15.266 -				&(page)->flags);			\
  15.267 -		if (ret)						\
  15.268 -			dec_page_state(nr_writeback);			\
  15.269 -		ret;							\
  15.270 -	})
  15.271 -
  15.272 -#define PageNosave(page)	test_bit(PG_nosave, &(page)->flags)
  15.273 -#define SetPageNosave(page)	set_bit(PG_nosave, &(page)->flags)
  15.274 -#define TestSetPageNosave(page)	test_and_set_bit(PG_nosave, &(page)->flags)
  15.275 -#define ClearPageNosave(page)		clear_bit(PG_nosave, &(page)->flags)
  15.276 -#define TestClearPageNosave(page)	test_and_clear_bit(PG_nosave, &(page)->flags)
  15.277 -
  15.278 -#define PageNosaveFree(page)	test_bit(PG_nosave_free, &(page)->flags)
  15.279 -#define SetPageNosaveFree(page)	set_bit(PG_nosave_free, &(page)->flags)
  15.280 -#define ClearPageNosaveFree(page)		clear_bit(PG_nosave_free, &(page)->flags)
  15.281 -
  15.282 -#define PageMappedToDisk(page)	test_bit(PG_mappedtodisk, &(page)->flags)
  15.283 -#define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags)
  15.284 -#define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags)
  15.285 -
  15.286 -#define PageReclaim(page)	test_bit(PG_reclaim, &(page)->flags)
  15.287 -#define SetPageReclaim(page)	set_bit(PG_reclaim, &(page)->flags)
  15.288 -#define ClearPageReclaim(page)	clear_bit(PG_reclaim, &(page)->flags)
  15.289 -#define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags)
  15.290 -
  15.291 -#ifdef CONFIG_HUGETLB_PAGE
  15.292 -#define PageCompound(page)	test_bit(PG_compound, &(page)->flags)
  15.293 -#else
  15.294 -#define PageCompound(page)	0
  15.295 -#endif
  15.296 -#define SetPageCompound(page)	set_bit(PG_compound, &(page)->flags)
  15.297 -#define ClearPageCompound(page)	clear_bit(PG_compound, &(page)->flags)
  15.298 -
  15.299 -#ifdef CONFIG_SWAP
  15.300 -#define PageSwapCache(page)	test_bit(PG_swapcache, &(page)->flags)
  15.301 -#define SetPageSwapCache(page)	set_bit(PG_swapcache, &(page)->flags)
  15.302 -#define ClearPageSwapCache(page) clear_bit(PG_swapcache, &(page)->flags)
  15.303 -#else
  15.304 -#define PageSwapCache(page)	0
  15.305 -#endif
  15.306 -
  15.307 -#define PageUncached(page)	test_bit(PG_uncached, &(page)->flags)
  15.308 -#define SetPageUncached(page)	set_bit(PG_uncached, &(page)->flags)
  15.309 -#define ClearPageUncached(page)	clear_bit(PG_uncached, &(page)->flags)
  15.310 -
  15.311 -struct page;	/* forward declaration */
  15.312 -
  15.313 -int test_clear_page_dirty(struct page *page);
  15.314 -int test_clear_page_writeback(struct page *page);
  15.315 -int test_set_page_writeback(struct page *page);
  15.316 -
  15.317 -static inline void clear_page_dirty(struct page *page)
  15.318 -{
  15.319 -	test_clear_page_dirty(page);
  15.320 -}
  15.321 -
  15.322 -static inline void set_page_writeback(struct page *page)
  15.323 -{
  15.324 -	test_set_page_writeback(page);
  15.325 -}
  15.326 -
  15.327 -#endif	/* PAGE_FLAGS_H */
    16.1 --- a/xen/include/asm-ia64/linux/rbtree.h	Thu Mar 16 12:22:37 2006 -0700
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,141 +0,0 @@
    16.4 -/*
    16.5 -  Red Black Trees
    16.6 -  (C) 1999  Andrea Arcangeli <andrea@suse.de>
    16.7 -  
    16.8 -  This program is free software; you can redistribute it and/or modify
    16.9 -  it under the terms of the GNU General Public License as published by
   16.10 -  the Free Software Foundation; either version 2 of the License, or
   16.11 -  (at your option) any later version.
   16.12 -
   16.13 -  This program is distributed in the hope that it will be useful,
   16.14 -  but WITHOUT ANY WARRANTY; without even the implied warranty of
   16.15 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   16.16 -  GNU General Public License for more details.
   16.17 -
   16.18 -  You should have received a copy of the GNU General Public License
   16.19 -  along with this program; if not, write to the Free Software
   16.20 -  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   16.21 -
   16.22 -  linux/include/linux/rbtree.h
   16.23 -
   16.24 -  To use rbtrees you'll have to implement your own insert and search cores.
   16.25 -  This will avoid us to use callbacks and to drop drammatically performances.
   16.26 -  I know it's not the cleaner way,  but in C (not in C++) to get
   16.27 -  performances and genericity...
   16.28 -
   16.29 -  Some example of insert and search follows here. The search is a plain
   16.30 -  normal search over an ordered tree. The insert instead must be implemented
   16.31 -  int two steps: as first thing the code must insert the element in
   16.32 -  order as a red leaf in the tree, then the support library function
   16.33 -  rb_insert_color() must be called. Such function will do the
   16.34 -  not trivial work to rebalance the rbtree if necessary.
   16.35 -
   16.36 ------------------------------------------------------------------------
   16.37 -static inline struct page * rb_search_page_cache(struct inode * inode,
   16.38 -						 unsigned long offset)
   16.39 -{
   16.40 -	struct rb_node * n = inode->i_rb_page_cache.rb_node;
   16.41 -	struct page * page;
   16.42 -
   16.43 -	while (n)
   16.44 -	{
   16.45 -		page = rb_entry(n, struct page, rb_page_cache);
   16.46 -
   16.47 -		if (offset < page->offset)
   16.48 -			n = n->rb_left;
   16.49 -		else if (offset > page->offset)
   16.50 -			n = n->rb_right;
   16.51 -		else
   16.52 -			return page;
   16.53 -	}
   16.54 -	return NULL;
   16.55 -}
   16.56 -
   16.57 -static inline struct page * __rb_insert_page_cache(struct inode * inode,
   16.58 -						   unsigned long offset,
   16.59 -						   struct rb_node * node)
   16.60 -{
   16.61 -	struct rb_node ** p = &inode->i_rb_page_cache.rb_node;
   16.62 -	struct rb_node * parent = NULL;
   16.63 -	struct page * page;
   16.64 -
   16.65 -	while (*p)
   16.66 -	{
   16.67 -		parent = *p;
   16.68 -		page = rb_entry(parent, struct page, rb_page_cache);
   16.69 -
   16.70 -		if (offset < page->offset)
   16.71 -			p = &(*p)->rb_left;
   16.72 -		else if (offset > page->offset)
   16.73 -			p = &(*p)->rb_right;
   16.74 -		else
   16.75 -			return page;
   16.76 -	}
   16.77 -
   16.78 -	rb_link_node(node, parent, p);
   16.79 -
   16.80 -	return NULL;
   16.81 -}
   16.82 -
   16.83 -static inline struct page * rb_insert_page_cache(struct inode * inode,
   16.84 -						 unsigned long offset,
   16.85 -						 struct rb_node * node)
   16.86 -{
   16.87 -	struct page * ret;
   16.88 -	if ((ret = __rb_insert_page_cache(inode, offset, node)))
   16.89 -		goto out;
   16.90 -	rb_insert_color(node, &inode->i_rb_page_cache);
   16.91 - out:
   16.92 -	return ret;
   16.93 -}
   16.94 ------------------------------------------------------------------------
   16.95 -*/
   16.96 -
   16.97 -#ifndef	_LINUX_RBTREE_H
   16.98 -#define	_LINUX_RBTREE_H
   16.99 -
  16.100 -#include <linux/kernel.h>
  16.101 -#include <linux/stddef.h>
  16.102 -
  16.103 -struct rb_node
  16.104 -{
  16.105 -	struct rb_node *rb_parent;
  16.106 -	int rb_color;
  16.107 -#define	RB_RED		0
  16.108 -#define	RB_BLACK	1
  16.109 -	struct rb_node *rb_right;
  16.110 -	struct rb_node *rb_left;
  16.111 -};
  16.112 -
  16.113 -struct rb_root
  16.114 -{
  16.115 -	struct rb_node *rb_node;
  16.116 -};
  16.117 -
  16.118 -#define RB_ROOT	(struct rb_root) { NULL, }
  16.119 -#define	rb_entry(ptr, type, member) container_of(ptr, type, member)
  16.120 -
  16.121 -extern void rb_insert_color(struct rb_node *, struct rb_root *);
  16.122 -extern void rb_erase(struct rb_node *, struct rb_root *);
  16.123 -
  16.124 -/* Find logical next and previous nodes in a tree */
  16.125 -extern struct rb_node *rb_next(struct rb_node *);
  16.126 -extern struct rb_node *rb_prev(struct rb_node *);
  16.127 -extern struct rb_node *rb_first(struct rb_root *);
  16.128 -extern struct rb_node *rb_last(struct rb_root *);
  16.129 -
  16.130 -/* Fast replacement of a single node without remove/rebalance/add/rebalance */
  16.131 -extern void rb_replace_node(struct rb_node *victim, struct rb_node *new, 
  16.132 -			    struct rb_root *root);
  16.133 -
  16.134 -static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,
  16.135 -				struct rb_node ** rb_link)
  16.136 -{
  16.137 -	node->rb_parent = parent;
  16.138 -	node->rb_color = RB_RED;
  16.139 -	node->rb_left = node->rb_right = NULL;
  16.140 -
  16.141 -	*rb_link = node;
  16.142 -}
  16.143 -
  16.144 -#endif	/* _LINUX_RBTREE_H */
    17.1 --- a/xen/include/asm-ia64/mm.h	Thu Mar 16 12:22:37 2006 -0700
    17.2 +++ b/xen/include/asm-ia64/mm.h	Fri Mar 17 13:23:01 2006 -0700
    17.3 @@ -10,8 +10,6 @@
    17.4  #include <xen/perfc.h>
    17.5  #include <xen/sched.h>
    17.6  
    17.7 -#include <linux/rbtree.h>
    17.8 -
    17.9  #include <asm/processor.h>
   17.10  #include <asm/atomic.h>
   17.11  #include <asm/flushtlb.h>