mem.h 455 B

1234567891011121314151617181920212223
  1. /*
  2. * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __MEM_H__
  6. #define __MEM_H__
  7. extern int phys_mapping(unsigned long phys, unsigned long long *offset_out);
  8. extern unsigned long uml_physmem;
  9. static inline unsigned long to_phys(void *virt)
  10. {
  11. return(((unsigned long) virt) - uml_physmem);
  12. }
  13. static inline void *to_virt(unsigned long phys)
  14. {
  15. return((void *) uml_physmem + phys);
  16. }
  17. #endif