refine hypercall

-- use an array to fast locate the hypercall handler
   to replace switch case.
-- uniform hypercall handler as below:
   int32_t (*handler)(sos_vm, target_vm, param1, param2)

Tracked-On: #4958
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Mingqiang Chi
2020-08-13 17:34:06 +08:00
committed by wenlingz
parent 7935354864
commit 53b11d1048
8 changed files with 510 additions and 516 deletions

View File

@@ -93,10 +93,7 @@ bool is_postlaunched_vm(const struct acrn_vm *vm)
return (get_vm_config(vm->vm_id)->load_order == POST_LAUNCHED_VM);
}
bool is_valid_postlaunched_vmid(uint16_t vm_id)
{
return ((vm_id < CONFIG_MAX_VM_NUM) && is_postlaunched_vm(get_vm_from_vmid(vm_id)));
}
/**
* @pre vm != NULL
* @pre vm->vmid < CONFIG_MAX_VM_NUM