VirtualBox

Ignore:
Timestamp:
Dec 13, 2024 8:09:39 AM (5 weeks ago)
Author:
vboxsync
Message:

VMM: bugref:10759 Refactor GIC for use with different backends.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/GICR3Nem-linux.cpp

    r105687 r107308  
    3434#include "GICInternal.h"
    3535#include "NEMInternal.h" /* Need access to the VM file descriptor. */
    36 #include <VBox/vmm/gic.h>
     36#include <VBox/vmm/pdmgic.h>
    3737#include <VBox/vmm/cpum.h>
    3838#include <VBox/vmm/hm.h>
     
    101101
    102102/**
    103  * Common worker for GICR3KvmSpiSet() and GICR3KvmPpiSet().
     103 * Common worker for gicR3KvmSpiSet() and gicR3KvmPpiSet().
    104104 *
    105105 * @returns VBox status code.
     
    138138 * @param   fAsserted   Flag whether the interrupt is asserted (true) or not (false).
    139139 */
    140 VMMR3_INT_DECL(int) GICR3NemSpiSet(PVMCC pVM, uint32_t uIntId, bool fAsserted)
     140static DECLCALLBACK(int) gicR3KvmSetSpi(PVMCC pVM, uint32_t uIntId, bool fAsserted)
    141141{
    142142    PGIC pGic = VM_TO_GIC(pVM);
     
    157157 * @param   fAsserted   Flag whether the interrupt is asserted (true) or not (false).
    158158 */
    159 VMMR3_INT_DECL(int) GICR3NemPpiSet(PVMCPUCC pVCpu, uint32_t uIntId, bool fAsserted)
     159static DECLCALLBACK(int) gicR3KvmSetPpi(PVMCPUCC pVCpu, uint32_t uIntId, bool fAsserted)
    160160{
    161161    PPDMDEVINS pDevIns = VMCPU_TO_DEVINS(pVCpu);
    162162
    163     return gicR3KvmSetIrq(pDevIns, pVCpu->idCpu, KVM_ARM_IRQ_TYPE_SPI,
     163    return gicR3KvmSetIrq(pDevIns, pVCpu->idCpu, KVM_ARM_IRQ_TYPE_PPI,
    164164                          uIntId + GIC_INTID_RANGE_PPI_START, fAsserted);
    165165}
     
    294294     * Register the GIC with PDM.
    295295     */
    296     rc = PDMDevHlpApicRegister(pDevIns);
     296    rc = PDMDevHlpIcRegister(pDevIns);
     297    AssertLogRelRCReturn(rc, rc);
     298
     299    rc = PDMGicRegisterBackend(pVM, PDMGICBACKENDTYPE_KVM, &g_GicKvmBackend);
    297300    AssertLogRelRCReturn(rc, rc);
    298301
     
    405408};
    406409
     410/**
     411 * The KVM GIC backend.
     412 */
     413const PDMGICBACKEND g_GicKvmBackend =
     414{
     415    /* .pfnReadSysReg = */  NULL,
     416    /* .pfnWriteSysReg = */ NULL,
     417    /* .pfnSetSpi = */      gicR3KvmSetSpi,
     418    /* .pfnSetPpi = */      gicR3KvmSetPpi,
     419};
     420
    407421#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
    408422
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette