VirtualBox

Changeset 35855 in vbox


Ignore:
Timestamp:
Feb 4, 2011 5:02:44 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69856
Message:

PCI: start of driver communication infrastructure

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/cdefs.h

    r31508 r35855  
    6060#define IN_INTNET_R0
    6161#define IN_INTNET_R3
     62#define IN_PCIRAW_R0
     63#define IN_PCIRAW_R3
    6264#define IN_REM_R3
    6365#define IN_SUP_R0
     
    145147#endif
    146148
     149/** @def IN_PCIRAW_R3
     150 * Used to indicate whether we're inside the same link module as the Ring-3
     151 * PCI passthrough support.
     152 */
     153/** @def PCIRAWR3DECL(type)
     154 * PCI passthrough export or import declaration.
     155 * @param   type    The return type of the function declaration.
     156 */
     157#ifdef IN_PCIRAW_R3
     158# define PCIRAWR3DECL(type) DECLEXPORT(type) VBOXCALL
     159#else
     160# define PCIRAWR3DECL(type) DECLIMPORT(type) VBOXCALL
     161#endif
     162
     163/** @def IN_PCIRAW_R0
     164 * Used to indicate whether we're inside the same link module as the R0
     165 * PCI passthrough support.
     166 */
     167/** @def PCIRAWR0DECL(type)
     168 * PCI passthroug export or import declaration.
     169 * @param   type    The return type of the function declaration.
     170 */
     171#ifdef IN_PCIRAW_R0
     172# define PCIRAWR0DECL(type) DECLEXPORT(type) VBOXCALL
     173#else
     174# define PCIRAWR0DECL(type) DECLIMPORT(type) VBOXCALL
     175#endif
    147176
    148177
  • trunk/include/VBox/sup.h

    r35191 r35855  
    11171117    /** Multiple release event semaphore. */
    11181118    SUPDRVOBJTYPE_SEM_EVENT_MULTI,
     1119    /** Raw PCI device. */
     1120    SUPDRVOBJTYPE_RAW_PCI_DEVICE,
    11191121    /** The first invalid object type in this end. */
    11201122    SUPDRVOBJTYPE_END,
  • trunk/include/VBox/vmm/vmm.h

    r35361 r35855  
    376376    /** Call IntNetR0IfAbortWait(). */
    377377    VMMR0_DO_INTNET_IF_ABORT_WAIT,
     378
     379    /** Forward call to the PCI driver */
     380    VMMR0_DO_PCIRAW_REQ,
     381
    378382    /** The end of the R0 service operations. */
    379383    VMMR0_DO_SRV_END,
     
    456460
    457461#endif
    458 
  • trunk/src/VBox/Devices/Makefile.kmk

    r35685 r35855  
    11201120 #
    11211121 ServicesR0_TEMPLATE  = VBoxR0
    1122  ServicesR0_DEFS      = IN_INTNET_R0 IN_RT_R0
     1122 ServicesR0_DEFS      = IN_INTNET_R0 IN_RT_R0 $(if $(VBOX_WITH_PCI_PASSTHROUGH),IN_PCIRAW_R0,)
    11231123 ServicesR0_SOURCES   = \
    1124         Network/SrvIntNetR0.cpp
    1125 
     1124        Network/SrvIntNetR0.cpp \
     1125        $(if $(VBOX_WITH_PCI_PASSTHROUGH),Bus/SrvPciRawR0.cpp,)
    11261126
    11271127 #
  • trunk/src/VBox/VMM/Makefile.kmk

    r35572 r35855  
    437437  VMMR0_DEFS    += VBOX_WITH_VMMR0_DISABLE_PREEMPTION
    438438 endif
     439 ifdef VBOX_WITH_PCI_PASSTHROUGH
     440  VMMR0_DEFS    += VBOX_WITH_PCI_PASSTHROUGH IN_PCIRAW_R0
     441 endif
    439442 VMMR0_DEFS.darwin = VMM_R0_SWITCH_STACK
    440443 VMMR0_DEFS.darwin.x86 = \
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r35810 r35855  
    3030#include "VMMInternal.h"
    3131#include <VBox/vmm/vm.h>
     32#ifdef VBOX_WITH_PCI_PASSTHROUGH
     33#include <VBox/vmm/pdmpci.h>
     34#endif
    3235
    3336#include <VBox/vmm/gvmm.h>
     
    3942#include <VBox/version.h>
    4043#include <VBox/log.h>
     44
    4145
    4246#include <iprt/asm-amd64-x86.h>
     
    127131                        if (RT_SUCCESS(rc))
    128132                        {
    129                             rc = CPUMR0ModuleInit();
     133#ifdef VBOX_WITH_PCI_PASSTHROUGH
     134                            rc = PciRawR0Init();
     135#endif
    130136                            if (RT_SUCCESS(rc))
    131137                            {
    132                                 LogFlow(("ModuleInit: returns success.\n"));
    133                                 return VINF_SUCCESS;
     138                                rc = CPUMR0ModuleInit();
     139                                if (RT_SUCCESS(rc))
     140                                {
     141                                    LogFlow(("ModuleInit: returns success.\n"));
     142                                    return VINF_SUCCESS;
     143                                }
    134144                            }
     145                           
     146                            /* bail out */
     147                            LogFlow(("ModuleTerm: returns %Rrc\n", rc));
     148#ifdef VBOX_WITH_PCI_PASSTHROUGH
     149                            PciRawR0Term();
     150#endif
     151#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE
     152                            PGMR0DynMapTerm();
     153#endif
    135154                        }
    136 
    137                         /* bail out */
    138                         LogFlow(("ModuleTerm: returns %Rrc\n", rc));
    139 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE
    140                         PGMR0DynMapTerm();
    141 #endif
    142155                    }
    143156                    PGMDeregisterStringFormatTypes();
     
    178191#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE
    179192    PGMR0DynMapTerm();
     193#endif
     194       
     195#ifdef VBOX_WITH_PCI_PASSTHROUGH
     196    /*
     197     * Terminate PCI passthrough service.
     198     */
     199    PciRawR0Term();
    180200#endif
    181201    PGMDeregisterStringFormatTypes();
     
    11551175            return IntNetR0IfAbortWaitReq(pSession, (PINTNETIFABORTWAITREQ)pReqHdr);
    11561176
     1177#ifdef VBOX_WITH_PCI_PASSTHROUGH
     1178        /*
     1179         * Requests to host PCI driver service.
     1180         */
     1181        case VMMR0_DO_PCIRAW_REQ:
     1182            if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PPCIRAWSENDREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID)
     1183                return VERR_INVALID_PARAMETER;
     1184            return PciRawR0ProcessReq(pSession, (PPCIRAWSENDREQ)pReqHdr);
     1185#endif
    11571186        /*
    11581187         * For profiling.
     
    11781207        default:
    11791208            /*
    1180              * We're returning VERR_NOT_SUPPORT here so we've got something else
     1209             * We're returning VERR_NOT_SUPPORT here s we've got something else
    11811210             * than -1 which the interrupt gate glue code might return.
    11821211             */
     
    15271556    RTAssertMsg2V(pszFormat, va);
    15281557}
    1529 
Note: See TracChangeset for help on using the changeset viewer.

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