summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include/mock/arch/virtual.h
blob: bf786d52564dd22597d138cd363cc7a4d4499d3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef _ARCH_VIRTUAL_H
#define _ARCH_VIRTUAL_H

/* virtual_offset has to be declared if used */
extern unsigned long virtual_offset;

#define virt_to_phys(virt) ((unsigned long)(virt) + virtual_offset)
#define phys_to_virt(phys) ((void *)((unsigned long)(phys) - virtual_offset))

#define virt_to_bus(addr) virt_to_phys(addr)
#define bus_to_virt(addr) phys_to_virt(addr)

#endif