diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2005-09-10 13:44:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-10 15:00:18 -0400 |
commit | d99c4022f60a9aa3a8dc6b7d71f3d0998c696912 (patch) | |
tree | d02de9d131b3d45a21ce60e4b5d3380497f86daf /arch/um | |
parent | 4413a511f22ec771edc0b7c93e5b34e05511acb5 (diff) |
[PATCH] uml: inline mk_pte and various friends
Turns out that, for UML, a *lot* of VM-related trivial functions are not
inlined but rather normal functions.
In other sections of UML code, this is justified by having files which
interact with the host and cannot therefore include kernel headers, but in
this case there's no such justification.
I've had to turn many of them to macros because of missing declarations. While
doing this, I've decided to reuse some already existing macros.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/include/mem.h | 12 | ||||
-rw-r--r-- | arch/um/kernel/ksyms.c | 5 | ||||
-rw-r--r-- | arch/um/kernel/physmem.c | 35 |
3 files changed, 11 insertions, 41 deletions
diff --git a/arch/um/include/mem.h b/arch/um/include/mem.h index 99d3ad4a03e5..e8ff0d8fa610 100644 --- a/arch/um/include/mem.h +++ b/arch/um/include/mem.h | |||
@@ -13,7 +13,17 @@ extern int physmem_subst_mapping(void *virt, int fd, __u64 offset, int w); | |||
13 | extern int is_remapped(void *virt); | 13 | extern int is_remapped(void *virt); |
14 | extern int physmem_remove_mapping(void *virt); | 14 | extern int physmem_remove_mapping(void *virt); |
15 | extern void physmem_forget_descriptor(int fd); | 15 | extern void physmem_forget_descriptor(int fd); |
16 | extern unsigned long to_phys(void *virt); | 16 | |
17 | extern unsigned long uml_physmem; | ||
18 | static inline unsigned long to_phys(void *virt) | ||
19 | { | ||
20 | return(((unsigned long) virt) - uml_physmem); | ||
21 | } | ||
22 | |||
23 | static inline void *to_virt(unsigned long phys) | ||
24 | { | ||
25 | return((void *) uml_physmem + phys); | ||
26 | } | ||
17 | 27 | ||
18 | #endif | 28 | #endif |
19 | 29 | ||
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c index 32d3076dd220..a97a72e516aa 100644 --- a/arch/um/kernel/ksyms.c +++ b/arch/um/kernel/ksyms.c | |||
@@ -34,14 +34,9 @@ EXPORT_SYMBOL(host_task_size); | |||
34 | EXPORT_SYMBOL(arch_validate); | 34 | EXPORT_SYMBOL(arch_validate); |
35 | EXPORT_SYMBOL(get_kmem_end); | 35 | EXPORT_SYMBOL(get_kmem_end); |
36 | 36 | ||
37 | EXPORT_SYMBOL(page_to_phys); | ||
38 | EXPORT_SYMBOL(phys_to_page); | ||
39 | EXPORT_SYMBOL(high_physmem); | 37 | EXPORT_SYMBOL(high_physmem); |
40 | EXPORT_SYMBOL(empty_zero_page); | 38 | EXPORT_SYMBOL(empty_zero_page); |
41 | EXPORT_SYMBOL(um_virt_to_phys); | 39 | EXPORT_SYMBOL(um_virt_to_phys); |
42 | EXPORT_SYMBOL(__virt_to_page); | ||
43 | EXPORT_SYMBOL(to_phys); | ||
44 | EXPORT_SYMBOL(to_virt); | ||
45 | EXPORT_SYMBOL(mode_tt); | 40 | EXPORT_SYMBOL(mode_tt); |
46 | EXPORT_SYMBOL(handle_page_fault); | 41 | EXPORT_SYMBOL(handle_page_fault); |
47 | EXPORT_SYMBOL(find_iomem); | 42 | EXPORT_SYMBOL(find_iomem); |
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index a24e3b7f4bf0..ea670fcc8af5 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c | |||
@@ -248,16 +248,6 @@ unsigned long high_physmem; | |||
248 | 248 | ||
249 | extern unsigned long physmem_size; | 249 | extern unsigned long physmem_size; |
250 | 250 | ||
251 | void *to_virt(unsigned long phys) | ||
252 | { | ||
253 | return((void *) uml_physmem + phys); | ||
254 | } | ||
255 | |||
256 | unsigned long to_phys(void *virt) | ||
257 | { | ||
258 | return(((unsigned long) virt) - uml_physmem); | ||
259 | } | ||
260 | |||
261 | int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem) | 251 | int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem) |
262 | { | 252 | { |
263 | struct page *p, *map; | 253 | struct page *p, *map; |
@@ -298,31 +288,6 @@ int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem) | |||
298 | return(0); | 288 | return(0); |
299 | } | 289 | } |
300 | 290 | ||
301 | struct page *phys_to_page(const unsigned long phys) | ||
302 | { | ||
303 | return(&mem_map[phys >> PAGE_SHIFT]); | ||
304 | } | ||
305 | |||
306 | struct page *__virt_to_page(const unsigned long virt) | ||
307 | { | ||
308 | return(&mem_map[__pa(virt) >> PAGE_SHIFT]); | ||
309 | } | ||
310 | |||
311 | phys_t page_to_phys(struct page *page) | ||
312 | { | ||
313 | return((page - mem_map) << PAGE_SHIFT); | ||
314 | } | ||
315 | |||
316 | pte_t mk_pte(struct page *page, pgprot_t pgprot) | ||
317 | { | ||
318 | pte_t pte; | ||
319 | |||
320 | pte_set_val(pte, page_to_phys(page), pgprot); | ||
321 | if(pte_present(pte)) | ||
322 | pte_mknewprot(pte_mknewpage(pte)); | ||
323 | return(pte); | ||
324 | } | ||
325 | |||
326 | /* Changed during early boot */ | 291 | /* Changed during early boot */ |
327 | static unsigned long kmem_top = 0; | 292 | static unsigned long kmem_top = 0; |
328 | 293 | ||