blob: 4862c91d4213c4f6d1c1e9430ca902e080aae0a2 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0 */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00004 */
5
6#ifndef __MEM_H__
7#define __MEM_H__
8
9extern int phys_mapping(unsigned long phys, unsigned long long *offset_out);
10
11extern unsigned long uml_physmem;
12static inline unsigned long to_phys(void *virt)
13{
14 return(((unsigned long) virt) - uml_physmem);
15}
16
17static inline void *to_virt(unsigned long phys)
18{
19 return((void *) uml_physmem + phys);
20}
21
22#endif