mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 10:17:28 +00:00
HV:treewide:C99-friendly per_cpu implementation change the per_cpu method
The current implementation of per_cpu relies on several non-c99 features, and in additional involves arbitrary pointer arithmetic which is not MIS- RA C friendly. This patch introduces struct per_cpu_region which holds all the per_cpu variables. Allocation of per_cpu data regions and access to per_cpu vari- ables are greatly simplified, at the cost of making all per_cpu varaibl- es accessible in files. Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
This commit is contained in:
@@ -9,14 +9,6 @@
|
||||
#include "instr_emul_wrapper.h"
|
||||
#include "instr_emul.h"
|
||||
|
||||
struct emul_cnx {
|
||||
struct vie vie;
|
||||
struct vm_guest_paging paging;
|
||||
struct vcpu *vcpu;
|
||||
};
|
||||
|
||||
static DEFINE_CPU_DATA(struct emul_cnx, g_inst_ctxt);
|
||||
|
||||
static int
|
||||
encode_vmcs_seg_desc(int seg, uint32_t *base, uint32_t *lim, uint32_t *acc);
|
||||
|
||||
|
@@ -133,6 +133,12 @@ struct vm_guest_paging {
|
||||
enum vm_paging_mode paging_mode;
|
||||
};
|
||||
|
||||
struct emul_cnx {
|
||||
struct vie vie;
|
||||
struct vm_guest_paging paging;
|
||||
struct vcpu *vcpu;
|
||||
};
|
||||
|
||||
/*
|
||||
* Identifiers for architecturally defined registers.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user