| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /*  | 
 | 2 |  * Copyright (C) 2002, 2003 Jeff Dike (jdike@addtoit.com) | 
 | 3 |  * Licensed under the GPL | 
 | 4 |  */ | 
 | 5 |  | 
 | 6 | #ifndef __MEM_H__ | 
 | 7 | #define __MEM_H__ | 
 | 8 |  | 
 | 9 | #include "linux/types.h" | 
 | 10 |  | 
 | 11 | extern int phys_mapping(unsigned long phys, __u64 *offset_out); | 
 | 12 | extern int physmem_subst_mapping(void *virt, int fd, __u64 offset, int w); | 
 | 13 | extern int is_remapped(void *virt); | 
 | 14 | extern int physmem_remove_mapping(void *virt); | 
 | 15 | extern void physmem_forget_descriptor(int fd); | 
| Paolo 'Blaisorblade' Giarrusso | d99c402 | 2005-09-10 19:44:56 +0200 | [diff] [blame] | 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 | } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 |  | 
 | 28 | #endif | 
 | 29 |  | 
 | 30 | /* | 
 | 31 |  * Overrides for Emacs so that we follow Linus's tabbing style. | 
 | 32 |  * Emacs will notice this stuff at the end of the file and automatically | 
 | 33 |  * adjust the settings for this buffer only.  This must remain at the end | 
 | 34 |  * of the file. | 
 | 35 |  * --------------------------------------------------------------------------- | 
 | 36 |  * Local variables: | 
 | 37 |  * c-file-style: "linux" | 
 | 38 |  * End: | 
 | 39 |  */ |