HV:vcpu fix "Pointer param should be declared pointer to const"

Fix violations whose parameter can be read-only.
This patch only fix the parameter whose name is vcpu.

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Huihuang Shi
2018-10-23 13:36:25 +08:00
committed by wenlingz
parent ea32c34ae1
commit 46d198244f
15 changed files with 31 additions and 31 deletions

View File

@@ -248,7 +248,7 @@ struct vcpu_dump {
int str_max;
};
static inline bool is_vcpu_bsp(struct vcpu *vcpu)
static inline bool is_vcpu_bsp(const struct vcpu *vcpu)
{
return (vcpu->vcpu_id == BOOT_CPU_ID);
}
@@ -266,7 +266,7 @@ vcpu_vlapic(struct vcpu *vcpu)
}
/* External Interfaces */
uint64_t vcpu_get_gpreg(struct vcpu *vcpu, uint32_t reg);
uint64_t vcpu_get_gpreg(const struct vcpu *vcpu, uint32_t reg);
void vcpu_set_gpreg(struct vcpu *vcpu, uint32_t reg, uint64_t val);
uint64_t vcpu_get_rip(struct vcpu *vcpu);
void vcpu_set_rip(struct vcpu *vcpu, uint64_t val);
@@ -282,7 +282,7 @@ uint64_t vcpu_get_cr2(struct vcpu *vcpu);
void vcpu_set_cr2(struct vcpu *vcpu, uint64_t val);
uint64_t vcpu_get_cr4(struct vcpu *vcpu);
void vcpu_set_cr4(struct vcpu *vcpu, uint64_t val);
uint64_t vcpu_get_pat_ext(struct vcpu *vcpu);
uint64_t vcpu_get_pat_ext(const struct vcpu *vcpu);
void vcpu_set_pat_ext(struct vcpu *vcpu, uint64_t val);
void set_vcpu_regs(struct vcpu *vcpu, struct acrn_vcpu_regs *vcpu_regs);
void reset_vcpu_regs(struct vcpu *vcpu);

View File

@@ -121,7 +121,7 @@ int register_mmio_emulation_handler(struct vm *vm,
uint64_t end, void *handler_private_data);
void unregister_mmio_emulation_handler(struct vm *vm, uint64_t start,
uint64_t end);
void emulate_mmio_post(struct vcpu *vcpu, const struct io_request *io_req);
void emulate_mmio_post(const struct vcpu *vcpu, const struct io_request *io_req);
void dm_emulate_mmio_post(struct vcpu *vcpu);
int32_t emulate_io(struct vcpu *vcpu, struct io_request *io_req);

View File

@@ -88,7 +88,7 @@ int check_vmx_mmu_cap(void);
uint16_t allocate_vpid(void);
void flush_vpid_single(uint16_t vpid);
void flush_vpid_global(void);
void invept(struct vcpu *vcpu);
void invept(const struct vcpu *vcpu);
bool check_continuous_hpa(struct vm *vm, uint64_t gpa_arg, uint64_t size_arg);
/**
*@pre (pml4_page != NULL) && (pg_size != NULL)

View File

@@ -45,7 +45,7 @@ struct mtrr_state {
};
void mtrr_wrmsr(struct vcpu *vcpu, uint32_t msr, uint64_t value);
uint64_t mtrr_rdmsr(struct vcpu *vcpu, uint32_t msr);
uint64_t mtrr_rdmsr(const struct vcpu *vcpu, uint32_t msr);
void init_mtrr(struct vcpu *vcpu);
#endif /* MTRR_H */

View File

@@ -458,7 +458,7 @@ void vmx_off(uint16_t pcpu_id);
void exec_vmclear(void *addr);
void exec_vmptrld(void *addr);
uint64_t vmx_rdmsr_pat(struct vcpu *vcpu);
uint64_t vmx_rdmsr_pat(const struct vcpu *vcpu);
int vmx_wrmsr_pat(struct vcpu *vcpu, uint64_t value);
void vmx_write_cr0(struct vcpu *vcpu, uint64_t cr0);