2019-08-25 17:49:19 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
2007-10-16 16:27:05 +08:00
|
|
|
* Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MEM_H__
|
|
|
|
#define __MEM_H__
|
|
|
|
|
2007-10-16 16:27:05 +08:00
|
|
|
extern int phys_mapping(unsigned long phys, unsigned long long *offset_out);
|
2005-09-11 01:44:56 +08:00
|
|
|
|
|
|
|
extern unsigned long uml_physmem;
|
2022-07-15 02:46:00 +08:00
|
|
|
static inline unsigned long uml_to_phys(void *virt)
|
2005-09-11 01:44:56 +08:00
|
|
|
{
|
|
|
|
return(((unsigned long) virt) - uml_physmem);
|
|
|
|
}
|
|
|
|
|
2022-07-15 02:46:00 +08:00
|
|
|
static inline void *uml_to_virt(unsigned long phys)
|
2005-09-11 01:44:56 +08:00
|
|
|
{
|
|
|
|
return((void *) uml_physmem + phys);
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#endif
|