diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-02-01 16:28:50 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-02-01 16:28:50 +0100 |
commit | d8b61b1e9f8b719376779b41f29e01ca971c653d (patch) | |
tree | 1a4cac162f47222b184dad65cf3e90d942d93197 /xen/include/xen/mm.h | |
parent | 01f7c3a66cc11ac92bffc302e30053b5491884dc (diff) | |
download | xen-d8b61b1e9f8b719376779b41f29e01ca971c653d.tar.gz xen-d8b61b1e9f8b719376779b41f29e01ca971c653d.tar.bz2 xen-d8b61b1e9f8b719376779b41f29e01ca971c653d.zip |
Rename physical-address-related variables and functions
to follow a new ocnsistent naming scheme.
gpfn is a guest pseudophys frame number.
gmfn is a machine frame number (from guest p.o.v.)
mfn is a real bona fide machine number.
pfn is an arbitrary frame number (used in general-purpose
'polymorphic' functions).
pfn_info now called page_info.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/xen/mm.h')
-rw-r--r-- | xen/include/xen/mm.h | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index d3d7a21422..b478f91700 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -1,3 +1,29 @@ +/****************************************************************************** + * include/xen/mm.h + * + * Definitions for memory pages, frame numbers, addresses, allocations, etc. + * + * Note that Xen must handle several different physical 'address spaces' and + * there is a consistent terminology for these: + * + * 1. gpfn/gpaddr: A guest-specific pseudo-physical frame number or address. + * 2. gmfn/gmaddr: A machine address from the p.o.v. of a particular guest. + * 3. mfn/maddr: A real machine frame number or address. + * 4. pfn/paddr: Used in 'polymorphic' functions that work across all + * address spaces, depending on context. See the pagetable + * conversion macros in asm-x86/page.h for examples. + * Also 'paddr_t' is big enough to store any physical address. + * + * This scheme provides consistent function and variable names even when + * different guests are running in different memory-management modes. + * 1. A guest running in auto-translated mode (e.g., shadow_mode_translate()) + * will have gpfn == gmfn and gmfn != mfn. + * 2. A paravirtualised x86 guest will have gpfn != gmfn and gmfn == mfn. + * 3. A paravirtualised guest with no pseudophysical overlay will have + * gpfn == gpmfn == mfn. + * + * Copyright (c) 2002-2006, K A Fraser <keir@xensource.com> + */ #ifndef __XEN_MM_H__ #define __XEN_MM_H__ @@ -8,34 +34,34 @@ #include <xen/spinlock.h> struct domain; -struct pfn_info; +struct page_info; /* Boot-time allocator. Turns into generic allocator after bootstrap. */ -physaddr_t init_boot_allocator(physaddr_t bitmap_start); -void init_boot_pages(physaddr_t ps, physaddr_t pe); +paddr_t init_boot_allocator(paddr_t bitmap_start); +void init_boot_pages(paddr_t ps, paddr_t pe); unsigned long alloc_boot_pages(unsigned long nr_pfns, unsigned long pfn_align); void end_boot_allocator(void); /* Generic allocator. These functions are *not* interrupt-safe. */ void init_heap_pages( - unsigned int zone, struct pfn_info *pg, unsigned long nr_pages); -struct pfn_info *alloc_heap_pages(unsigned int zone, unsigned int order); + unsigned int zone, struct page_info *pg, unsigned long nr_pages); +struct page_info *alloc_heap_pages(unsigned int zone, unsigned int order); void free_heap_pages( - unsigned int zone, struct pfn_info *pg, unsigned int order); + unsigned int zone, struct page_info *pg, unsigned int order); void scrub_heap_pages(void); /* Xen suballocator. These functions are interrupt-safe. */ -void init_xenheap_pages(physaddr_t ps, physaddr_t pe); +void init_xenheap_pages(paddr_t ps, paddr_t pe); void *alloc_xenheap_pages(unsigned int order); void free_xenheap_pages(void *v, unsigned int order); #define alloc_xenheap_page() (alloc_xenheap_pages(0)) #define free_xenheap_page(v) (free_xenheap_pages(v,0)) /* Domain suballocator. These functions are *not* interrupt-safe.*/ -void init_domheap_pages(physaddr_t ps, physaddr_t pe); -struct pfn_info *alloc_domheap_pages( +void init_domheap_pages(paddr_t ps, paddr_t pe); +struct page_info *alloc_domheap_pages( struct domain *d, unsigned int order, unsigned int flags); -void free_domheap_pages(struct pfn_info *pg, unsigned int order); +void free_domheap_pages(struct page_info *pg, unsigned int order); unsigned long avail_domheap_pages(void); #define alloc_domheap_page(d) (alloc_domheap_pages(d,0,0)) #define free_domheap_page(p) (free_domheap_pages(p,0)) |