xref: /linux/arch/um/include/shared/mem.h (revision f2f4bf5aabadd6575f5daabcb0a2f506e3f5f68c)
1*f2f4bf5aSAlex Dewar /* SPDX-License-Identifier: GPL-2.0 */
28569c914SAl Viro /*
38569c914SAl Viro  * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
48569c914SAl Viro  */
58569c914SAl Viro 
68569c914SAl Viro #ifndef __MEM_H__
78569c914SAl Viro #define __MEM_H__
88569c914SAl Viro 
98569c914SAl Viro extern int phys_mapping(unsigned long phys, unsigned long long *offset_out);
108569c914SAl Viro 
118569c914SAl Viro extern unsigned long uml_physmem;
128569c914SAl Viro static inline unsigned long to_phys(void *virt)
138569c914SAl Viro {
148569c914SAl Viro 	return(((unsigned long) virt) - uml_physmem);
158569c914SAl Viro }
168569c914SAl Viro 
178569c914SAl Viro static inline void *to_virt(unsigned long phys)
188569c914SAl Viro {
198569c914SAl Viro 	return((void *) uml_physmem + phys);
208569c914SAl Viro }
218569c914SAl Viro 
228569c914SAl Viro #endif
23