ia64/linux-2.6.18-xen.hg

view include/asm-m68k/motorola_pgalloc.h @ 452:c7ed6fe5dca0

kexec: dont initialise regions in reserve_memory()

There is no need to initialise efi_memmap_res and boot_param_res in
reserve_memory() for the initial xen domain as it is done in
machine_kexec_setup_resources() using values from the kexec hypercall.

Signed-off-by: Simon Horman <horms@verge.net.au>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 28 10:55:18 2008 +0000 (2008-02-28)
parents 831230e53067
children
line source
1 #ifndef _MOTOROLA_PGALLOC_H
2 #define _MOTOROLA_PGALLOC_H
4 #include <asm/tlb.h>
5 #include <asm/tlbflush.h>
7 extern pmd_t *get_pointer_table(void);
8 extern int free_pointer_table(pmd_t *);
11 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
12 {
13 pte_t *pte;
15 pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
16 if (pte) {
17 __flush_page_to_ram(pte);
18 flush_tlb_kernel_page(pte);
19 nocache_page(pte);
20 }
22 return pte;
23 }
25 static inline void pte_free_kernel(pte_t *pte)
26 {
27 cache_page(pte);
28 free_page((unsigned long) pte);
29 }
31 static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
32 {
33 struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
34 pte_t *pte;
36 if(!page)
37 return NULL;
39 pte = kmap(page);
40 if (pte) {
41 __flush_page_to_ram(pte);
42 flush_tlb_kernel_page(pte);
43 nocache_page(pte);
44 }
45 kunmap(pte);
47 return page;
48 }
50 static inline void pte_free(struct page *page)
51 {
52 cache_page(kmap(page));
53 kunmap(page);
54 __free_page(page);
55 }
57 static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *page)
58 {
59 cache_page(kmap(page));
60 kunmap(page);
61 __free_page(page);
62 }
65 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
66 {
67 return get_pointer_table();
68 }
70 static inline int pmd_free(pmd_t *pmd)
71 {
72 return free_pointer_table(pmd);
73 }
75 static inline int __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
76 {
77 return free_pointer_table(pmd);
78 }
81 static inline void pgd_free(pgd_t *pgd)
82 {
83 pmd_free((pmd_t *)pgd);
84 }
86 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
87 {
88 return (pgd_t *)get_pointer_table();
89 }
92 static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
93 {
94 pmd_set(pmd, pte);
95 }
97 static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *page)
98 {
99 pmd_set(pmd, page_address(page));
100 }
102 static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
103 {
104 pgd_set(pgd, pmd);
105 }
107 #endif /* _MOTOROLA_PGALLOC_H */