aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include/mem.h
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2005-09-10 13:44:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 15:00:18 -0400
commitd99c4022f60a9aa3a8dc6b7d71f3d0998c696912 (patch)
treed02de9d131b3d45a21ce60e4b5d3380497f86daf /arch/um/include/mem.h
parent4413a511f22ec771edc0b7c93e5b34e05511acb5 (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/include/mem.h')
-rw-r--r--arch/um/include/mem.h12
1 files changed, 11 insertions, 1 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);
13extern int is_remapped(void *virt); 13extern int is_remapped(void *virt);
14extern int physmem_remove_mapping(void *virt); 14extern int physmem_remove_mapping(void *virt);
15extern void physmem_forget_descriptor(int fd); 15extern void physmem_forget_descriptor(int fd);
16extern unsigned long to_phys(void *virt); 16
17extern unsigned long uml_physmem;
18static inline unsigned long to_phys(void *virt)
19{
20 return(((unsigned long) virt) - uml_physmem);
21}
22
23static inline void *to_virt(unsigned long phys)
24{
25 return((void *) uml_physmem + phys);
26}
17 27
18#endif 28#endif
19 29