mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-04 14:36:55 +00:00
Convert HPA2HVA, HVA2HPA, GPA2HVA and HVA2GPA to inline functions. v1 -> v2: * Modify the following statement. rsdp = biosacpi_search_rsdp((char *)hpa2hva((uint64_t)(*addr << 4)), 0x400); Instead of "(uint64_t)(*addr << 4)", "(uint64_t)(*addr) << 4U" would be clearer. Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
46 lines
977 B
C
46 lines
977 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
/************************************************************************
|
|
*
|
|
* FILE NAME
|
|
*
|
|
* hypervisor.h
|
|
*
|
|
* DESCRIPTION
|
|
*
|
|
* This file includes hypervisor used header files.
|
|
* It should be included in all the source files.
|
|
*
|
|
*
|
|
************************************************************************/
|
|
#ifndef HYPERVISOR_H
|
|
#define HYPERVISOR_H
|
|
|
|
/* Include config header file containing config options */
|
|
#include <types.h>
|
|
#include "acrn_common.h"
|
|
#include <acrn_hv_defs.h>
|
|
#include <hv_lib.h>
|
|
#include <hv_arch.h>
|
|
#include <hv_debug.h>
|
|
|
|
#ifndef ASSEMBLER
|
|
/* gpa --> hpa -->hva */
|
|
static inline void *gpa2hva(const struct vm *vm, uint64_t x)
|
|
{
|
|
return hpa2hva(gpa2hpa(vm, x));
|
|
}
|
|
|
|
static inline uint64_t hva2gpa(const struct vm *vm, void *x)
|
|
{
|
|
return hpa2gpa(vm, hva2hpa(x));
|
|
}
|
|
|
|
#endif /* !ASSEMBLER */
|
|
|
|
#endif /* HYPERVISOR_H */
|