From d99c4022f60a9aa3a8dc6b7d71f3d0998c696912 Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Date: Sat, 10 Sep 2005 19:44:56 +0200 Subject: [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> --- arch/um/include/mem.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'arch/um/include/mem.h') diff --git a/arch/um/include/mem.h b/arch/um/include/mem.h index 99d3ad4..e8ff0d8 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); extern int is_remapped(void *virt); extern int physmem_remove_mapping(void *virt); extern void physmem_forget_descriptor(int fd); -extern unsigned long to_phys(void *virt); + +extern unsigned long uml_physmem; +static inline unsigned long to_phys(void *virt) +{ + return(((unsigned long) virt) - uml_physmem); +} + +static inline void *to_virt(unsigned long phys) +{ + return((void *) uml_physmem + phys); +} #endif -- cgit v1.1