haiku/headers/private/kernel/arch/riscv64/arch_vm_translation_map.h
X512 7ef006297e kernel/arch/vm: implement for riscv64
Change-Id: I0b463f3d2bca9f31b0aabacbf70a9774493d3467
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4051
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-08-06 14:47:32 +00:00

30 lines
632 B
C

/*
** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_ARCH_RISCV64_VM_TRANSLATION_MAP_H
#define _KERNEL_ARCH_RISCV64_VM_TRANSLATION_MAP_H
#include <arch/vm_translation_map.h>
//gVirtFromPhysOffset = virtAdr - physAdr;
extern ssize_t gVirtFromPhysOffset;
static inline void*
VirtFromPhys(phys_addr_t physAdr)
{
return (void*)(physAdr + gVirtFromPhysOffset);
}
static inline phys_addr_t
PhysFromVirt(void* virtAdr)
{
return (phys_addr_t)virtAdr - gVirtFromPhysOffset;
}
#endif /* _KERNEL_ARCH_RISCV64_VM_TRANSLATION_MAP_H */