diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-07-05 14:29:13 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-07-05 14:29:13 +0100 |
commit | 5edcddf706ed90180701eac5a15cff6f3cec614d (patch) | |
tree | 5b4da8b89d93261da2b644b9d94ce1e3f197e0ea /extras/mini-os/include/mm.h | |
parent | ecf0bebefa3b4ea160d99541bf15b5c47b82cca2 (diff) | |
download | xen-5edcddf706ed90180701eac5a15cff6f3cec614d.tar.gz xen-5edcddf706ed90180701eac5a15cff6f3cec614d.tar.bz2 xen-5edcddf706ed90180701eac5a15cff6f3cec614d.zip |
[MINIOS]Mapping page frames on demand added to the memory management.
Signed-off-by: Steven Smith <sos22@cam.ac.uk>
Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Diffstat (limited to 'extras/mini-os/include/mm.h')
-rw-r--r-- | extras/mini-os/include/mm.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/extras/mini-os/include/mm.h b/extras/mini-os/include/mm.h index 331b5b178c..4c820e07e4 100644 --- a/extras/mini-os/include/mm.h +++ b/extras/mini-os/include/mm.h @@ -196,9 +196,11 @@ static __inline__ paddr_t machine_to_phys(maddr_t machine) #define to_virt(x) ((void *)((unsigned long)(x)+VIRT_START)) #define virt_to_pfn(_virt) (PFN_DOWN(to_phys(_virt))) +#define virt_to_mfn(_virt) (pfn_to_mfn(virt_to_pfn(_virt))) #define mach_to_virt(_mach) (to_virt(machine_to_phys(_mach))) +#define virt_to_mach(_virt) (phys_to_machine(to_phys(_virt))) #define mfn_to_virt(_mfn) (to_virt(mfn_to_pfn(_mfn) << PAGE_SHIFT)) -#define pfn_to_virt(_pfn) (to_virt(_pfn << PAGE_SHIFT)) +#define pfn_to_virt(_pfn) (to_virt((_pfn) << PAGE_SHIFT)) /* Pagetable walking. */ #define pte_to_mfn(_pte) (((_pte) & (PADDR_MASK&PAGE_MASK)) >> L1_PAGETABLE_SHIFT) @@ -206,7 +208,7 @@ static __inline__ paddr_t machine_to_phys(maddr_t machine) void init_mm(void); unsigned long alloc_pages(int order); -#define alloc_page() alloc_pages(0); +#define alloc_page() alloc_pages(0) void free_pages(void *pointer, int order); static __inline__ int get_order(unsigned long size) @@ -219,4 +221,6 @@ static __inline__ int get_order(unsigned long size) } +void *map_frames(unsigned long *f, unsigned long n); + #endif /* _MM_H_ */ |