treewide: Move device_tree to commonlib
[coreboot2.git] / payloads / libpayload / include / mock / arch / virtual.h
blobbf786d52564dd22597d138cd363cc7a4d4499d3e
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef _ARCH_VIRTUAL_H
4 #define _ARCH_VIRTUAL_H
6 /* virtual_offset has to be declared if used */
7 extern unsigned long virtual_offset;
9 #define virt_to_phys(virt) ((unsigned long)(virt) + virtual_offset)
10 #define phys_to_virt(phys) ((void *)((unsigned long)(phys) - virtual_offset))
12 #define virt_to_bus(addr) virt_to_phys(addr)
13 #define bus_to_virt(addr) phys_to_virt(addr)
15 #endif