mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-13 13:56:19 +00:00
HV: fix vmptable "Casting operation to a pointer"
ACRN Coding guidelines requires two different types pointer can't convert to each other, except void *. Tracked-On: #861 Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
This commit is contained in:
parent
9063504bc8
commit
79d033027b
@ -85,10 +85,9 @@ static uint8_t mpt_compute_checksum(const void *base, size_t len)
|
|||||||
*/
|
*/
|
||||||
int32_t mptable_build(struct acrn_vm *vm)
|
int32_t mptable_build(struct acrn_vm *vm)
|
||||||
{
|
{
|
||||||
char *startaddr;
|
|
||||||
char *curraddr;
|
|
||||||
struct mpcth *mpch;
|
struct mpcth *mpch;
|
||||||
struct mpfps *mpfp;
|
struct mpfps *mpfp;
|
||||||
|
struct mptable_info *mpinfo;
|
||||||
size_t mptable_length;
|
size_t mptable_length;
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
uint16_t vcpu_num;
|
uint16_t vcpu_num;
|
||||||
@ -127,14 +126,11 @@ int32_t mptable_build(struct acrn_vm *vm)
|
|||||||
/* Copy mptable info into guest memory */
|
/* Copy mptable info into guest memory */
|
||||||
(void)copy_to_gpa(vm, (void *)mptable, MPTABLE_BASE, mptable_length);
|
(void)copy_to_gpa(vm, (void *)mptable, MPTABLE_BASE, mptable_length);
|
||||||
|
|
||||||
startaddr = (char *)gpa2hva(vm, MPTABLE_BASE);
|
mpinfo = (struct mptable_info *) gpa2hva(vm, MPTABLE_BASE);
|
||||||
curraddr = startaddr;
|
|
||||||
stac();
|
stac();
|
||||||
mpfp = (struct mpfps *)curraddr;
|
mpfp = &mpinfo->mpfp;
|
||||||
mpfp->checksum = mpt_compute_checksum(mpfp, sizeof(struct mpfps));
|
mpfp->checksum = mpt_compute_checksum(mpfp, sizeof(struct mpfps));
|
||||||
curraddr += sizeof(struct mpfps);
|
mpch = &mpinfo->mpch;
|
||||||
|
|
||||||
mpch = (struct mpcth *)curraddr;
|
|
||||||
mpch->checksum = mpt_compute_checksum(mpch, mpch->base_table_length);
|
mpch->checksum = mpt_compute_checksum(mpch, mpch->base_table_length);
|
||||||
clac();
|
clac();
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user