mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-17 15:51:34 +00:00
hv: vmsi: name vmsi with verb-object style
Name vmsi and vmsix function with verb-object style: For external APIs, using MODULE_NAME_verb-object style; For internal APIs, using verb-object style. Tracked-On: #3475 Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
parent
6ee076f7df
commit
2c4ebdc695
@ -111,7 +111,7 @@ static void vdev_pt_map_mem_vbar(struct pci_vdev *vdev, uint32_t idx)
|
||||
|
||||
addr_lo = round_page_down(addr_lo);
|
||||
addr_hi = round_page_up(addr_hi);
|
||||
register_mmio_emulation_handler(vm, vmsix_table_mmio_access_handler,
|
||||
register_mmio_emulation_handler(vm, vmsix_handle_table_mmio_access,
|
||||
addr_lo, addr_hi, vdev);
|
||||
ept_del_mr(vm, (uint64_t *)vm->arch_vm.nworld_eptp, addr_lo, addr_hi - addr_lo);
|
||||
msix->mmio_gpa = vbar->base;
|
||||
|
@ -40,7 +40,7 @@
|
||||
* @pre vdev->vpci->vm != NULL
|
||||
* @pre vdev->pdev != NULL
|
||||
*/
|
||||
static int32_t vmsi_remap(const struct pci_vdev *vdev, bool enable)
|
||||
static int32_t remap_vmsi(const struct pci_vdev *vdev, bool enable)
|
||||
{
|
||||
struct ptirq_msi_info info;
|
||||
union pci_bdf pbdf = vdev->pdev->bdf;
|
||||
@ -135,10 +135,10 @@ void vmsi_write_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint
|
||||
if (((offset - vdev->msi.capoff) == PCIR_MSI_CTRL) &&
|
||||
(((msgctrl ^ val) & PCIM_MSICTRL_MSI_ENABLE) != 0U)) {
|
||||
enable = ((val & PCIM_MSICTRL_MSI_ENABLE) != 0U);
|
||||
(void)vmsi_remap(vdev, enable);
|
||||
(void)remap_vmsi(vdev, enable);
|
||||
} else {
|
||||
if (message_changed && ((msgctrl & PCIM_MSICTRL_MSI_ENABLE) != 0U)) {
|
||||
(void)vmsi_remap(vdev, true);
|
||||
(void)remap_vmsi(vdev, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ static inline bool msixtable_access(const struct pci_vdev *vdev, uint32_t offset
|
||||
* @pre vdev->vpci->vm != NULL
|
||||
* @pre vdev->pdev != NULL
|
||||
*/
|
||||
static int32_t vmsix_remap_entry(const struct pci_vdev *vdev, uint32_t index, bool enable)
|
||||
static int32_t remap_vmsix_entry(const struct pci_vdev *vdev, uint32_t index, bool enable)
|
||||
{
|
||||
struct msix_table_entry *pentry;
|
||||
struct ptirq_msi_info info;
|
||||
@ -107,7 +107,7 @@ static inline void enable_disable_msix(const struct pci_vdev *vdev, bool enable)
|
||||
* @pre vdev != NULL
|
||||
* @pre vdev->pdev != NULL
|
||||
*/
|
||||
static int32_t vmsix_remap(const struct pci_vdev *vdev, bool enable)
|
||||
static int32_t remap_vmsix(const struct pci_vdev *vdev, bool enable)
|
||||
{
|
||||
uint32_t index;
|
||||
int32_t ret = 0;
|
||||
@ -116,7 +116,7 @@ static int32_t vmsix_remap(const struct pci_vdev *vdev, bool enable)
|
||||
enable_disable_msix(vdev, false);
|
||||
|
||||
for (index = 0U; index < vdev->msix.table_count; index++) {
|
||||
ret = vmsix_remap_entry(vdev, index, enable);
|
||||
ret = remap_vmsix_entry(vdev, index, enable);
|
||||
if (ret != 0) {
|
||||
break;
|
||||
}
|
||||
@ -138,7 +138,7 @@ static int32_t vmsix_remap(const struct pci_vdev *vdev, bool enable)
|
||||
* @pre vdev != NULL
|
||||
* @pre vdev->pdev != NULL
|
||||
*/
|
||||
static int32_t vmsix_remap_one_entry(const struct pci_vdev *vdev, uint32_t index, bool enable)
|
||||
static int32_t remap_one_vmsx_entry(const struct pci_vdev *vdev, uint32_t index, bool enable)
|
||||
{
|
||||
uint32_t msgctrl;
|
||||
int32_t ret;
|
||||
@ -146,7 +146,7 @@ static int32_t vmsix_remap_one_entry(const struct pci_vdev *vdev, uint32_t index
|
||||
/* disable MSI-X during configuration */
|
||||
enable_disable_msix(vdev, false);
|
||||
|
||||
ret = vmsix_remap_entry(vdev, index, enable);
|
||||
ret = remap_vmsix_entry(vdev, index, enable);
|
||||
if (ret == 0) {
|
||||
/* If MSI Enable is being set, make sure INTxDIS bit is set */
|
||||
if (enable) {
|
||||
@ -191,9 +191,9 @@ void vmsix_write_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uin
|
||||
if ((offset - vdev->msix.capoff) == PCIR_MSIX_CTRL) {
|
||||
if (((msgctrl ^ val) & PCIM_MSIXCTRL_MSIX_ENABLE) != 0U) {
|
||||
if ((val & PCIM_MSIXCTRL_MSIX_ENABLE) != 0U) {
|
||||
(void)vmsix_remap(vdev, true);
|
||||
(void)remap_vmsix(vdev, true);
|
||||
} else {
|
||||
(void)vmsix_remap(vdev, false);
|
||||
(void)remap_vmsix(vdev, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ void vmsix_write_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uin
|
||||
* @pre vdev != NULL
|
||||
* @pre mmio != NULL
|
||||
*/
|
||||
static void vmsix_table_rw(const struct pci_vdev *vdev, struct mmio_request *mmio, uint32_t offset)
|
||||
static void rw_vmsix_table(const struct pci_vdev *vdev, struct mmio_request *mmio, uint32_t offset)
|
||||
{
|
||||
const struct msix_table_entry *entry;
|
||||
uint32_t vector_control, entry_offset, table_offset, index;
|
||||
@ -262,7 +262,7 @@ static void vmsix_table_rw(const struct pci_vdev *vdev, struct mmio_request *mmi
|
||||
if ((((entry->vector_control ^ vector_control) & PCIM_MSIX_VCTRL_MASK) != 0U)
|
||||
|| message_changed) {
|
||||
unmasked = ((entry->vector_control & PCIM_MSIX_VCTRL_MASK) == 0U);
|
||||
(void)vmsix_remap_one_entry(vdev, index, unmasked);
|
||||
(void)remap_one_vmsx_entry(vdev, index, unmasked);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -280,7 +280,7 @@ static void vmsix_table_rw(const struct pci_vdev *vdev, struct mmio_request *mmi
|
||||
* @pre io_req != NULL
|
||||
* @pre handler_private_data != NULL
|
||||
*/
|
||||
int32_t vmsix_table_mmio_access_handler(struct io_request *io_req, void *handler_private_data)
|
||||
int32_t vmsix_handle_table_mmio_access(struct io_request *io_req, void *handler_private_data)
|
||||
{
|
||||
struct mmio_request *mmio = &io_req->reqs.mmio;
|
||||
struct pci_vdev *vdev;
|
||||
@ -296,7 +296,7 @@ int32_t vmsix_table_mmio_access_handler(struct io_request *io_req, void *handler
|
||||
offset = mmio->address - vdev->msix.mmio_gpa;
|
||||
|
||||
if (msixtable_access(vdev, (uint32_t)offset)) {
|
||||
vmsix_table_rw(vdev, mmio, (uint32_t)offset);
|
||||
rw_vmsix_table(vdev, mmio, (uint32_t)offset);
|
||||
} else {
|
||||
hva = hpa2hva(vdev->msix.mmio_hpa + offset);
|
||||
|
||||
|
@ -134,7 +134,7 @@ void vmsi_write_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint
|
||||
void deinit_vmsi(const struct pci_vdev *vdev);
|
||||
|
||||
void init_vmsix(struct pci_vdev *vdev);
|
||||
int32_t vmsix_table_mmio_access_handler(struct io_request *io_req, void *handler_private_data);
|
||||
int32_t vmsix_handle_table_mmio_access(struct io_request *io_req, void *handler_private_data);
|
||||
void vmsix_read_cfg(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
|
||||
void vmsix_write_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||
void deinit_vmsix(const struct pci_vdev *vdev);
|
||||
|
Loading…
Reference in New Issue
Block a user