mem.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 2002, 2003 Jeff Dike (jdike@addtoit.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __MEM_H__
  6. #define __MEM_H__
  7. #include "linux/types.h"
  8. extern int phys_mapping(unsigned long phys, __u64 *offset_out);
  9. extern int physmem_subst_mapping(void *virt, int fd, __u64 offset, int w);
  10. extern int is_remapped(void *virt);
  11. extern int physmem_remove_mapping(void *virt);
  12. extern void physmem_forget_descriptor(int fd);
  13. extern unsigned long uml_physmem;
  14. static inline unsigned long to_phys(void *virt)
  15. {
  16. return(((unsigned long) virt) - uml_physmem);
  17. }
  18. static inline void *to_virt(unsigned long phys)
  19. {
  20. return((void *) uml_physmem + phys);
  21. }
  22. #endif
  23. /*
  24. * Overrides for Emacs so that we follow Linus's tabbing style.
  25. * Emacs will notice this stuff at the end of the file and automatically
  26. * adjust the settings for this buffer only. This must remain at the end
  27. * of the file.
  28. * ---------------------------------------------------------------------------
  29. * Local variables:
  30. * c-file-style: "linux"
  31. * End:
  32. */