HV: Rename functions, variables starting with "_"

In order to comply with MISRA C rules, renamed vairables
and function names starting with "_".
The major changes invloves mostly static function
names, as they are being called inside the same file
by a wrapper function.

Signed-off-by: Arindam Roy <arindam.roy@intel.com>
This commit is contained in:
Arindam Roy
2018-08-01 13:42:40 -07:00
committed by lijinxia
parent a71dedecd4
commit 37026590c9
14 changed files with 51 additions and 51 deletions

View File

@@ -134,7 +134,7 @@ enum vm_paging_mode get_vcpu_paging_mode(struct vcpu *vcpu)
/* TODO: Add code to check for Revserved bits, SMAP and PKE when do translation
* during page walk */
static int _gva2gpa_common(struct vcpu *vcpu, struct page_walk_info *pw_info,
static int local_gva2gpa_common(struct vcpu *vcpu, struct page_walk_info *pw_info,
uint64_t gva, uint64_t *gpa, uint32_t *err_code)
{
uint32_t i;
@@ -220,7 +220,7 @@ out:
return ret;
}
static int _gva2gpa_pae(struct vcpu *vcpu, struct page_walk_info *pw_info,
static int local_gva2gpa_pae(struct vcpu *vcpu, struct page_walk_info *pw_info,
uint64_t gva, uint64_t *gpa, uint32_t *err_code)
{
int index;
@@ -246,7 +246,7 @@ static int _gva2gpa_pae(struct vcpu *vcpu, struct page_walk_info *pw_info,
pw_info->level = 2U;
pw_info->top_entry = entry;
ret = _gva2gpa_common(vcpu, pw_info, gva, gpa, err_code);
ret = local_gva2gpa_common(vcpu, pw_info, gva, gpa, err_code);
out:
return ret;
@@ -298,15 +298,15 @@ int gva2gpa(struct vcpu *vcpu, uint64_t gva, uint64_t *gpa,
if (pm == PAGING_MODE_4_LEVEL) {
pw_info.width = 9U;
ret = _gva2gpa_common(vcpu, &pw_info, gva, gpa, err_code);
ret = local_gva2gpa_common(vcpu, &pw_info, gva, gpa, err_code);
} else if(pm == PAGING_MODE_3_LEVEL) {
pw_info.width = 9U;
ret = _gva2gpa_pae(vcpu, &pw_info, gva, gpa, err_code);
ret = local_gva2gpa_pae(vcpu, &pw_info, gva, gpa, err_code);
} else if (pm == PAGING_MODE_2_LEVEL) {
pw_info.width = 10U;
pw_info.pse = ((cur_context->cr4 & CR4_PSE) != 0UL);
pw_info.nxe = false;
ret = _gva2gpa_common(vcpu, &pw_info, gva, gpa, err_code);
ret = local_gva2gpa_common(vcpu, &pw_info, gva, gpa, err_code);
} else {
*gpa = gva;
}
@@ -320,14 +320,14 @@ int gva2gpa(struct vcpu *vcpu, uint64_t gva, uint64_t *gpa,
return ret;
}
static inline uint32_t _copy_gpa(struct vm *vm, void *h_ptr, uint64_t gpa,
static inline uint32_t local_copy_gpa(struct vm *vm, void *h_ptr, uint64_t gpa,
uint32_t size, uint32_t fix_pg_size, bool cp_from_vm)
{
uint64_t hpa;
uint32_t offset_in_pg, len, pg_size;
void *g_ptr;
hpa = _gpa2hpa(vm, gpa, &pg_size);
hpa = local_gpa2hpa(vm, gpa, &pg_size);
if (pg_size == 0U) {
pr_err("GPA2HPA not found");
return 0;
@@ -366,7 +366,7 @@ static inline int copy_gpa(struct vm *vm, void *h_ptr_arg, uint64_t gpa_arg,
}
while (size > 0U) {
len = _copy_gpa(vm, h_ptr, gpa, size, 0U, cp_from_vm);
len = local_copy_gpa(vm, h_ptr, gpa, size, 0U, cp_from_vm);
if (len == 0U) {
return -EINVAL;
}
@@ -406,7 +406,7 @@ static inline int copy_gva(struct vcpu *vcpu, void *h_ptr_arg, uint64_t gva_arg,
return ret;
}
len = _copy_gpa(vcpu->vm, h_ptr, gpa, size,
len = local_copy_gpa(vcpu->vm, h_ptr, gpa, size,
PAGE_SIZE_4K, cp_from_vm);
if (len == 0U) {

View File

@@ -2151,7 +2151,7 @@ decode_moffset(struct instr_emul_vie *vie)
}
int
__decode_instruction(enum vm_cpu_mode cpu_mode, bool cs_d, struct instr_emul_vie *vie)
local_decode_instruction(enum vm_cpu_mode cpu_mode, bool cs_d, struct instr_emul_vie *vie)
{
if (decode_prefixes(vie, cpu_mode, cs_d) != 0) {
return -1;

View File

@@ -89,7 +89,7 @@ int vie_init(struct instr_emul_vie *vie, struct vcpu *vcpu);
*/
#define VIE_INVALID_GLA (1UL << 63) /* a non-canonical address */
int
__decode_instruction(enum vm_cpu_mode cpu_mode, bool cs_d, struct instr_emul_vie *vie);
local_decode_instruction(enum vm_cpu_mode cpu_mode, bool cs_d, struct instr_emul_vie *vie);
int emulate_instruction(struct vcpu *vcpu);
int decode_instruction(struct vcpu *vcpu);

View File

@@ -358,7 +358,7 @@ int decode_instruction(struct vcpu *vcpu)
get_guest_paging_info(vcpu, emul_ctxt, csar);
cpu_mode = get_vcpu_mode(vcpu);
retval = __decode_instruction(cpu_mode, SEG_DESC_DEF32(csar),
retval = local_decode_instruction(cpu_mode, SEG_DESC_DEF32(csar),
&emul_ctxt->vie);
if (retval != 0) {