2018-03-07 20:57:14 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
|
|
*
|
2018-05-26 01:49:13 +08:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2018-03-07 20:57:14 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
*
|
|
|
|
* FILE NAME
|
|
|
|
*
|
|
|
|
* hypervisor.h
|
|
|
|
*
|
|
|
|
* DESCRIPTION
|
|
|
|
*
|
2018-05-22 23:24:07 +08:00
|
|
|
* This file includes hypervisor used header files.
|
2018-03-07 20:57:14 +08:00
|
|
|
* It should be included in all the source files.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef HYPERVISOR_H
|
|
|
|
#define HYPERVISOR_H
|
|
|
|
|
|
|
|
/* Include config header file containing config options */
|
2018-05-22 08:30:50 +08:00
|
|
|
#include <types.h>
|
2018-09-27 14:05:54 +08:00
|
|
|
#include <errno.h>
|
|
|
|
#include <rtl.h>
|
|
|
|
#include <spinlock.h>
|
|
|
|
#include <mem_mgt.h>
|
|
|
|
#include <util.h>
|
|
|
|
#include <list.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
#include <bits.h>
|
|
|
|
#include <sprintf.h>
|
2018-05-22 08:30:50 +08:00
|
|
|
#include "acrn_common.h"
|
|
|
|
#include <acrn_hv_defs.h>
|
|
|
|
#include <hv_arch.h>
|
|
|
|
#include <hv_debug.h>
|
2018-03-07 20:57:14 +08:00
|
|
|
|
|
|
|
#ifndef ASSEMBLER
|
|
|
|
/* gpa --> hpa -->hva */
|
2018-11-05 13:28:23 +08:00
|
|
|
static inline void *gpa2hva(struct acrn_vm *vm, uint64_t x)
|
2018-09-06 13:50:10 +08:00
|
|
|
{
|
|
|
|
return hpa2hva(gpa2hpa(vm, x));
|
|
|
|
}
|
|
|
|
|
2018-11-05 13:28:23 +08:00
|
|
|
static inline uint64_t hva2gpa(struct acrn_vm *vm, void *x)
|
2018-09-06 13:50:10 +08:00
|
|
|
{
|
2019-01-21 14:48:31 +08:00
|
|
|
return (is_sos_vm(vm)) ? sos_vm_hpa2gpa(hva2hpa(x)) : INVALID_GPA;
|
2018-09-06 13:50:10 +08:00
|
|
|
}
|
|
|
|
|
2018-03-07 20:57:14 +08:00
|
|
|
#endif /* !ASSEMBLER */
|
|
|
|
|
|
|
|
#endif /* HYPERVISOR_H */
|