hv: rename hypercall for hv-emulated device management

Coding style cleanup, use add/remove instead of create/destroy.

Tracked-On: #5586
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Yonghua Huang 2020-12-05 21:41:51 +08:00 committed by wenlingz
parent d5bf1a76ff
commit 08c42f91c9
4 changed files with 15 additions and 15 deletions

View File

@ -65,10 +65,10 @@ static const struct hc_dispatch hc_dispatch_table[] = {
.handler = hcall_assign_mmiodev}, .handler = hcall_assign_mmiodev},
[HC_IDX(HC_DEASSIGN_MMIODEV)] = { [HC_IDX(HC_DEASSIGN_MMIODEV)] = {
.handler = hcall_deassign_mmiodev}, .handler = hcall_deassign_mmiodev},
[HC_IDX(HC_CREATE_VDEV)] = { [HC_IDX(HC_ADD_VDEV)] = {
.handler = hcall_create_vdev}, .handler = hcall_add_vdev},
[HC_IDX(HC_DESTROY_VDEV)] = { [HC_IDX(HC_REMOVE_VDEV)] = {
.handler = hcall_destroy_vdev}, .handler = hcall_remove_vdev},
[HC_IDX(HC_SET_PTDEV_INTR_INFO)] = { [HC_IDX(HC_SET_PTDEV_INTR_INFO)] = {
.handler = hcall_set_ptdev_intr_info}, .handler = hcall_set_ptdev_intr_info},
[HC_IDX(HC_RESET_PTDEV_INTR_INFO)] = { [HC_IDX(HC_RESET_PTDEV_INTR_INFO)] = {

View File

@ -1186,7 +1186,7 @@ static struct emul_dev_ops *find_emul_dev_ops(struct acrn_emul_dev *dev)
} }
/** /**
* @brief Create an emulated device in hypervisor. * @brief Add an emulated device in hypervisor.
* *
* @param vm pointer to VM data structure * @param vm pointer to VM data structure
* @param vmid ID of the VM * @param vmid ID of the VM
@ -1196,7 +1196,7 @@ static struct emul_dev_ops *find_emul_dev_ops(struct acrn_emul_dev *dev)
* @pre Pointer vm shall point to SOS_VM * @pre Pointer vm shall point to SOS_VM
* @return 0 on success, non-zero on error. * @return 0 on success, non-zero on error.
*/ */
int32_t hcall_create_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, __unused uint64_t param1, uint64_t param2) int32_t hcall_add_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, __unused uint64_t param1, uint64_t param2)
{ {
int32_t ret = -EINVAL; int32_t ret = -EINVAL;
struct acrn_emul_dev dev; struct acrn_emul_dev dev;
@ -1217,7 +1217,7 @@ int32_t hcall_create_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, __unuse
} }
/** /**
* @brief Destroy an emulated device in hypervisor. * @brief Remove an emulated device in hypervisor.
* *
* @param vm pointer to VM data structure * @param vm pointer to VM data structure
* @param vmid ID of the VM * @param vmid ID of the VM
@ -1227,7 +1227,7 @@ int32_t hcall_create_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, __unuse
* @pre Pointer vm shall point to SOS_VM * @pre Pointer vm shall point to SOS_VM
* @return 0 on success, non-zero on error. * @return 0 on success, non-zero on error.
*/ */
int32_t hcall_destroy_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, __unused uint64_t param1, uint64_t param2) int32_t hcall_remove_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, __unused uint64_t param1, uint64_t param2)
{ {
int32_t ret = -EINVAL; int32_t ret = -EINVAL;
struct acrn_emul_dev dev; struct acrn_emul_dev dev;

View File

@ -334,7 +334,7 @@ int32_t hcall_assign_mmiodev(struct acrn_vm *vm, struct acrn_vm *target_vm, uint
int32_t hcall_deassign_mmiodev(struct acrn_vm *vm, struct acrn_vm *target_vm, uint64_t param1, uint64_t param2); int32_t hcall_deassign_mmiodev(struct acrn_vm *vm, struct acrn_vm *target_vm, uint64_t param1, uint64_t param2);
/** /**
* @brief Create an emulated device in hypervisor. * @brief Add an emulated device in hypervisor.
* *
* @param vm Pointer to VM data structure * @param vm Pointer to VM data structure
* @param target_vm Pointer to target VM data structure * @param target_vm Pointer to target VM data structure
@ -345,10 +345,10 @@ int32_t hcall_deassign_mmiodev(struct acrn_vm *vm, struct acrn_vm *target_vm, ui
* @pre Pointer vm shall point to SOS_VM * @pre Pointer vm shall point to SOS_VM
* @return 0 on success, non-zero on error. * @return 0 on success, non-zero on error.
*/ */
int32_t hcall_create_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, uint64_t param1, uint64_t param2); int32_t hcall_add_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, uint64_t param1, uint64_t param2);
/** /**
* @brief Destroy an emulated device in hypervisor. * @brief Remove an emulated device in hypervisor.
* *
* @param vm Pointer to VM data structure * @param vm Pointer to VM data structure
* @param target_vm Pointer to target VM data structure * @param target_vm Pointer to target VM data structure
@ -359,7 +359,7 @@ int32_t hcall_create_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, uint64_
* @pre Pointer vm shall point to SOS_VM * @pre Pointer vm shall point to SOS_VM
* @return 0 on success, non-zero on error. * @return 0 on success, non-zero on error.
*/ */
int32_t hcall_destroy_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, uint64_t param1, uint64_t param2); int32_t hcall_remove_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, uint64_t param1, uint64_t param2);
/** /**
* @brief Set interrupt mapping info of ptdev. * @brief Set interrupt mapping info of ptdev.

View File

@ -69,8 +69,8 @@
#define HC_DEASSIGN_PCIDEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x06UL) #define HC_DEASSIGN_PCIDEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x06UL)
#define HC_ASSIGN_MMIODEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x07UL) #define HC_ASSIGN_MMIODEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x07UL)
#define HC_DEASSIGN_MMIODEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x08UL) #define HC_DEASSIGN_MMIODEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x08UL)
#define HC_CREATE_VDEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x09UL) #define HC_ADD_VDEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x09UL)
#define HC_DESTROY_VDEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x0AUL) #define HC_REMOVE_VDEV BASE_HC_ID(HC_ID, HC_ID_PCI_BASE + 0x0AUL)
/* DEBUG */ /* DEBUG */
#define HC_ID_DBG_BASE 0x60UL #define HC_ID_DBG_BASE 0x60UL
@ -328,7 +328,7 @@ struct acrn_mmiodev {
/** /**
* @brief Info to create or destroy a virtual PCI or legacy device for a VM * @brief Info to create or destroy a virtual PCI or legacy device for a VM
* *
* the parameter for HC_CREATE_VDEV or HC_DESTROY_VDEV hypercall * the parameter for HC_ADD_VDEV or HC_REMOVE_VDEV hypercall
*/ */
struct acrn_emul_dev { struct acrn_emul_dev {
/* /*