本文整理汇总了C++中PDMINS_2_DATA函数的典型用法代码示例。如果您正苦于以下问题:C++ PDMINS_2_DATA函数的具体用法?C++ PDMINS_2_DATA怎么用?C++ PDMINS_2_DATA使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PDMINS_2_DATA函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: drvscsiAsyncIOLoopWakeup
static int drvscsiAsyncIOLoopWakeup(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
{
PDRVSCSI pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSI);
PRTREQ pReq;
int rc;
AssertMsgReturn(pThis->hQueueRequests != NIL_RTREQQUEUE, ("hQueueRequests is NULL\n"), VERR_INVALID_STATE);
if (!drvscsiAsyncIOLoopNoPendingDummy(pThis, 10000 /* 10 sec */))
{
LogRel(("drvscsiAsyncIOLoopWakeup#%u: previous dummy request is still pending\n", pDrvIns->iInstance));
return VERR_TIMEOUT;
}
rc = RTReqQueueCall(pThis->hQueueRequests, &pReq, 10000 /* 10 sec. */, (PFNRT)drvscsiAsyncIOLoopWakeupFunc, 1, pThis);
if (RT_SUCCESS(rc))
RTReqRelease(pReq);
else
{
pThis->pPendingDummyReq = pReq;
LogRel(("drvscsiAsyncIOLoopWakeup#%u: %Rrc pReq=%p\n", pDrvIns->iInstance, rc, pReq));
}
return rc;
}
开发者ID:stefano-garzarella,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:25,代码来源:DrvSCSI.cpp
示例2: DECLCALLBACK
/**
* Destruct a driver instance.
*
* Most VM resources are freed by the VM. This callback is provided so that any non-VM
* resources can be freed correctly.
*
* @param pDrvIns The driver instance data.
*/
static DECLCALLBACK(void) drvscsiDestruct(PPDMDRVINS pDrvIns)
{
PDRVSCSI pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSI);
PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
if (pThis->hQueueRequests != NIL_RTREQQUEUE)
{
if (!drvscsiAsyncIOLoopNoPendingDummy(pThis, 100 /*ms*/))
LogRel(("drvscsiDestruct#%u: previous dummy request is still pending\n", pDrvIns->iInstance));
int rc = RTReqQueueDestroy(pThis->hQueueRequests);
AssertMsgRC(rc, ("Failed to destroy queue rc=%Rrc\n", rc));
pThis->hQueueRequests = NIL_RTREQQUEUE;
}
/* Free the VSCSI device and LUN handle. */
if (pThis->hVScsiDevice)
{
VSCSILUN hVScsiLun;
int rc = VSCSIDeviceLunDetach(pThis->hVScsiDevice, 0, &hVScsiLun);
AssertRC(rc);
Assert(hVScsiLun == pThis->hVScsiLun);
rc = VSCSILunDestroy(hVScsiLun);
AssertRC(rc);
rc = VSCSIDeviceDestroy(pThis->hVScsiDevice);
AssertRC(rc);
pThis->hVScsiDevice = NULL;
pThis->hVScsiLun = NULL;
}
}
开发者ID:stefano-garzarella,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:40,代码来源:DrvSCSI.cpp
示例3: DECLCALLBACK
/**
* @interface_method_impl(PDMDRVREG,pfnConstruct)
*/
DECLCALLBACK(int) Nvram::drvNvram_Construct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
{
LogFlowFunc(("iInstance/#d, pCfg:%p, fFlags:%x\n", pDrvIns->iInstance, pCfg, fFlags));
PNVRAM pThis = PDMINS_2_DATA(pDrvIns, PNVRAM);
if (!CFGMR3AreValuesValid(pCfg, "Object\0"
"PermanentSave\0"))
return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
("Configuration error: Not possible to attach anything to this driver!\n"),
VERR_PDM_DRVINS_NO_ATTACH);
void *pv;
int rc = CFGMR3QueryPtr(pCfg, "Object", &pv);
AssertMsgRCReturn(rc, ("Configuration error: No/bad \"Object\" value! rc=%Rrc\n", rc), rc);
pThis->pNvram = (Nvram *)pv;
bool fPermanentSave = false;
rc = CFGMR3QueryBool(pCfg, "PermanentSave", &fPermanentSave);
if ( RT_SUCCESS(rc)
|| rc == VERR_CFGM_VALUE_NOT_FOUND)
pThis->fPermanentSave = fPermanentSave;
else
AssertRCReturn(rc, rc);
pDrvIns->IBase.pfnQueryInterface = Nvram::drvNvram_QueryInterface;
pThis->INvram.pfnFlushNvramStorage = drvNvram_pfnFlushNvramStorage;
pThis->INvram.pfnStoreNvramValue = drvNvram_pfnStoreNvramValue;
pThis->INvram.pfnLoadNvramValue = drvNvram_pfnLoadNvramValue;
return VINF_SUCCESS;
}
开发者ID:leopucci,项目名称:VirtualMonitor,代码行数:35,代码来源:Nvram.cpp
示例4: DECLCALLBACK
/**
* @copydoc FNPDMDRVDESTRUCT
*/
static DECLCALLBACK(void) drvdiskintDestruct(PPDMDRVINS pDrvIns)
{
PDRVDISKINTEGRITY pThis = PDMINS_2_DATA(pDrvIns, PDRVDISKINTEGRITY);
if (pThis->pTreeSegments)
{
RTAvlrFileOffsetDestroy(pThis->pTreeSegments, drvdiskintTreeDestroy, NULL);
RTMemFree(pThis->pTreeSegments);
}
if (pThis->fTraceRequests)
{
pThis->fRunning = false;
RTSemEventSignal(pThis->SemEvent);
RTSemEventDestroy(pThis->SemEvent);
}
if (pThis->fCheckDoubleCompletion)
{
/* Free all requests */
while (pThis->papIoReq[pThis->iEntry])
{
RTMemFree(pThis->papIoReq[pThis->iEntry]);
pThis->papIoReq[pThis->iEntry] = NULL;
pThis->iEntry = (pThis->iEntry+1) % pThis->cEntries;
}
}
if (pThis->hIoLogger)
VDDbgIoLogDestroy(pThis->hIoLogger);
}
开发者ID:mutoso-mirrors,项目名称:vbox,代码行数:34,代码来源:DrvDiskIntegrity.cpp
示例5: drvR0HostParallelReqWriteControl
/**
* R0 mode function to write byte value to parallel port control
* register.
* @returns VBox status code.
* @param pDrvIns Driver instance.
* @param u64Arg Data to be written to control register.
*/
static int drvR0HostParallelReqWriteControl(PPDMDRVINS pDrvIns, uint64_t u64Arg)
{
PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
LogFlowFunc(("write to ctrl port=%#x val=%#x\n", pThis->u32LptAddrControl, u64Arg));
ASMOutU8(pThis->u32LptAddrControl, (uint8_t)(u64Arg));
return VINF_SUCCESS;
}
开发者ID:Klanly,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:14,代码来源:DrvHostParallel.cpp
示例6: pic_get_irq
/* return the pic wanted interrupt. return -1 if none */
static int pic_get_irq(PicState *s)
{
PicState *pics = &(PDMINS_2_DATA(s->CTX_SUFF(pDevIns), PDEVPIC))->aPics[0];
int mask, cur_priority, priority;
Log(("pic_get_irq%d: mask=%x\n", (s == pics) ? 0 : 1, s->irr & ~s->imr));
DumpPICState(s, "pic_get_irq");
mask = s->irr & ~s->imr;
priority = get_priority(s, mask);
Log(("pic_get_irq: priority=%x\n", priority));
if (priority == 8)
return -1;
/* compute current priority. If special fully nested mode on the
master, the IRQ coming from the slave is not taken into account
for the priority computation. */
mask = s->isr;
if (s->special_fully_nested_mode && s == &pics[0])
mask &= ~(1 << 2);
cur_priority = get_priority(s, mask);
Log(("pic_get_irq%d: cur_priority=%x pending=%d\n", (s == pics) ? 0 : 1, cur_priority, (priority == 8) ? -1 : (priority + s->priority_add) & 7));
if (priority < cur_priority) {
/* higher priority found: an irq should be generated */
return (priority + s->priority_add) & 7;
} else {
return -1;
}
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:28,代码来源:DevPIC.cpp
示例7: DECLCALLBACK
static DECLCALLBACK(void) drvNicPowerOn(PPDMDRVINS pDrvIns)
{
PDRVNIC pThis = PDMINS_2_DATA(pDrvIns, PDRVNIC);
if (pThis && pThis->nic_client)
pThis->nic_client->enable_signals();
}
开发者ID:0xxx,项目名称:genode,代码行数:7,代码来源:network.cpp
示例8: usbProxyVrdpUrbQueue
static int usbProxyVrdpUrbQueue(PVUSBURB pUrb)
{
LogFlow(("usbProxyVrdpUrbQueue: pUrb=%p\n", pUrb));
/** @todo implement isochronous transfers for USB over VRDP. */
if (pUrb->enmType == VUSBXFERTYPE_ISOC)
{
Log(("usbproxy: isochronous transfers aren't implemented yet.\n"));
return false;
}
PUSBPROXYDEV pProxyDev = PDMINS_2_DATA(pUrb->pUsbIns, PUSBPROXYDEV);
PUSBPROXYDEVVRDP pDevVrdp = (PUSBPROXYDEVVRDP)pProxyDev->Backend.pv;
int rc = pDevVrdp->pCallback->pfnQueueURB (pDevVrdp->pDevice, pUrb->enmType, pUrb->EndPt, pUrb->enmDir, pUrb->cbData,
pUrb->abData, pUrb, (PREMOTEUSBQURB *)&pUrb->Dev.pvPrivate);
if (rc == VERR_VUSB_DEVICE_NOT_ATTACHED)
{
Log(("usb-vrdp: remote device %p unplugged!!\n", pDevVrdp->pDevice));
pProxyDev->fDetached = true;
}
return RT_SUCCESS(rc);
}
开发者ID:eaas-framework,项目名称:virtualbox,代码行数:25,代码来源:USBProxyDevice-vrdp.cpp
示例9: DECLCALLBACK
/**
* Power off a TCP socket stream driver instance.
*
* This does most of the destruction work, to avoid ordering dependencies.
*
* @param pDrvIns The driver instance data.
*/
static DECLCALLBACK(void) drvTCPPowerOff(PPDMDRVINS pDrvIns)
{
PDRVTCP pThis = PDMINS_2_DATA(pDrvIns, PDRVTCP);
LogFlow(("%s: %s\n", __FUNCTION__, pThis->pszLocation));
drvTCPShutdownListener(pThis);
}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:14,代码来源:DrvTCP.cpp
示例10: DECLCALLBACK
/**
* Queue callback for processing a queued item.
*
* @returns Success indicator.
* If false the item will not be removed and the flushing will stop.
* @param pDrvIns The driver instance.
* @param pItemCore Pointer to the queue item to process.
*/
static DECLCALLBACK(bool) drvKbdQueueConsumer(PPDMDRVINS pDrvIns, PPDMQUEUEITEMCORE pItemCore)
{
PDRVKBDQUEUE pThis = PDMINS_2_DATA(pDrvIns, PDRVKBDQUEUE);
PDRVKBDQUEUEITEM pItem = (PDRVKBDQUEUEITEM)pItemCore;
int rc = pThis->pUpPort->pfnPutEventHid(pThis->pUpPort, pItem->u32UsageCode);
return RT_SUCCESS(rc);
}
开发者ID:jeppeter,项目名称:vbox,代码行数:15,代码来源:DrvKeyboardQueue.cpp
示例11: DECLINLINE
DECLINLINE(void) DumpPICState(PPICSTATE pPic, const char *pszFn)
{
PDEVPIC pThis = PDMINS_2_DATA(pPic->CTX_SUFF(pDevIns), PDEVPIC);
Log2(("%s: pic%d: elcr=%x last_irr=%x irr=%x imr=%x isr=%x irq_base=%x\n",
pszFn, (&pThis->aPics[0] == pPic) ? 0 : 1,
pPic->elcr, pPic->last_irr, pPic->irr, pPic->imr, pPic->isr, pPic->irq_base));
}
开发者ID:miguelinux,项目名称:vbox,代码行数:8,代码来源:DevPIC.cpp
示例12: DECLCALLBACK
/** @callback_method_impl{FNSSMDEVSAVEEXEC} */
static DECLCALLBACK(int) smcSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
{
PDEVSMC pThis = PDMINS_2_DATA(pDevIns, PDEVSMC);
/** @todo */
return VINF_SUCCESS;
}
开发者ID:eaas-framework,项目名称:virtualbox,代码行数:9,代码来源:DevSmc.cpp
示例13: DECLCALLBACK
/**
* @interface_method_impl{PDMDRVREG,pfnPowerOn}
*/
static DECLCALLBACK(void) drvR3DedicatedNicPowerOn(PPDMDRVINS pDrvIns)
{
LogFlow(("drvR3DedicatedNicPowerOn\n"));
PDRVDEDICATEDNIC pThis = PDMINS_2_DATA(pDrvIns, PDRVDEDICATEDNIC);
int rc = PDMDrvHlpCallR0(pDrvIns, DRVDEDICATEDNICR0OP_RESUME, 0);
AssertRC(rc);
}
开发者ID:VirtualMonitor,项目名称:VirtualMonitor,代码行数:11,代码来源:DrvDedicatedNic.cpp
示例14: DECLCALLBACK
/**
* @interface_method_impl(PDMDRVREG,pfnDestruct)
*/
DECLCALLBACK(void) Nvram::drvNvram_Destruct(PPDMDRVINS pDrvIns)
{
PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
LogFlowFunc(("iInstance/#%d\n", pDrvIns->iInstance));
PNVRAM pThis = PDMINS_2_DATA(pDrvIns, PNVRAM);
if (pThis->pNvram != NULL)
pThis->pNvram->mpDrv = NULL;
}
开发者ID:rickysarraf,项目名称:virtualbox,代码行数:11,代码来源:Nvram.cpp
示例15: DumpPICState
static inline void DumpPICState(PicState *s, const char *szFn)
{
PDEVPIC pThis = PDMINS_2_DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
Log2(("%s: pic%d: elcr=%x last_irr=%x irr=%x imr=%x isr=%x irq_base=%x\n",
szFn, (&pThis->aPics[0] == s) ? 0 : 1,
s->elcr, s->last_irr, s->irr, s->imr, s->isr, s->irq_base));
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:8,代码来源:DevPIC.cpp
示例16: DECLCALLBACK
/**
* @interface_method_impl{PDMIBASE,pfnQueryInterface}
*/
DECLCALLBACK(void *) AudioSniffer::drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
{
PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
PDRVAUDIOSNIFFER pDrv = PDMINS_2_DATA(pDrvIns, PDRVAUDIOSNIFFER);
PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
PDMIBASE_RETURN_INTERFACE(pszIID, PDMIAUDIOSNIFFERCONNECTOR, &pDrv->Connector);
return NULL;
}
开发者ID:ryenus,项目名称:vbox,代码行数:11,代码来源:AudioSnifferInterface.cpp
示例17: DECLCALLBACK
/**
* @interface_method_impl{PDMDRVREG,pfnReset}
*/
DECLCALLBACK(void) PCIRawDev::drvDestruct(PPDMDRVINS pDrvIns)
{
PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
PDRVMAINPCIRAWDEV pThis = PDMINS_2_DATA(pDrvIns, PDRVMAINPCIRAWDEV);
if (pThis->pPCIRawDev)
pThis->pPCIRawDev->mpDrv = NULL;
}
开发者ID:bayasist,项目名称:vbox,代码行数:11,代码来源:PCIRawDevImpl.cpp
示例18: PDMBOTHCBDECL
/**
* Read a MMIO register.
*
* @returns VBox status code suitable for scheduling.
* @param pDevIns The device instance.
* @param pvUser A user argument (ignored).
* @param GCPhysAddr The physical address being written to. (This is within our MMIO memory range.)
* @param pv Where to put the data we read.
* @param cb The size of the read.
*/
PDMBOTHCBDECL(int) ox958MmioRead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb)
{
PDEVOX958 pThis = PDMINS_2_DATA(pDevIns, PDEVOX958);
uint32_t offReg = (GCPhysAddr - pThis->GCPhysMMIO);
int rc = VINF_SUCCESS;
RT_NOREF(pThis, pvUser);
if (offReg < OX958_REG_UART_REGION_OFFSET)
{
uint32_t *pu32 = (uint32_t *)pv;
Assert(cb == 4);
switch (offReg)
{
case OX958_REG_CC_REV_ID:
*pu32 = 0x00070002;
break;
case OX958_REG_UART_CNT:
*pu32 = pThis->cUarts;
break;
case OX958_REG_UART_IRQ_STS:
*pu32 = ASMAtomicReadU32(&pThis->u32RegIrqStsGlob);
break;
case OX958_REG_UART_IRQ_ENABLE:
*pu32 = ASMAtomicReadU32(&pThis->u32RegIrqEnGlob);
break;
case OX958_REG_UART_IRQ_DISABLE:
*pu32 = ~ASMAtomicReadU32(&pThis->u32RegIrqEnGlob);
break;
case OX958_REG_UART_WAKE_IRQ_ENABLE:
*pu32 = ASMAtomicReadU32(&pThis->u32RegIrqEnWake);
break;
case OX958_REG_UART_WAKE_IRQ_DISABLE:
*pu32 = ~ASMAtomicReadU32(&pThis->u32RegIrqEnWake);
break;
default:
rc = VINF_IOM_MMIO_UNUSED_00;
}
}
else
{
/* Figure out the UART accessed from the offset. */
offReg -= OX958_REG_UART_REGION_OFFSET;
uint32_t iUart = offReg / OX958_REG_UART_REGION_SIZE;
uint32_t offUartReg = offReg % OX958_REG_UART_REGION_SIZE;
if (iUart < pThis->cUarts)
{
POX958UART pUart = &pThis->aUarts[iUart];
rc = ox958UartRegRead(pThis, pUart, offUartReg, pv, cb);
if (rc == VINF_IOM_R3_IOPORT_READ)
rc = VINF_IOM_R3_MMIO_READ;
}
else
rc = VINF_IOM_MMIO_UNUSED_00;
}
return rc;
}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:68,代码来源:DevOxPcie958.cpp
示例19: usbProxyVrdpUrbCancel
static void usbProxyVrdpUrbCancel(PVUSBURB pUrb)
{
LogFlow(("usbProxyVrdpUrbCancel: pUrb=%p\n", pUrb));
PUSBPROXYDEV pProxyDev = PDMINS_2_DATA(pUrb->pUsbIns, PUSBPROXYDEV);
PUSBPROXYDEVVRDP pDevVrdp = (PUSBPROXYDEVVRDP)pProxyDev->Backend.pv;
pDevVrdp->pCallback->pfnCancelURB (pDevVrdp->pDevice, (PREMOTEUSBQURB)pUrb->Dev.pvPrivate);
}
开发者ID:eaas-framework,项目名称:virtualbox,代码行数:9,代码来源:USBProxyDevice-vrdp.cpp
示例20: DECLCALLBACK
/**
* @interface_method_impl{PDMIBASE,pfnQueryInterface}
*/
static DECLCALLBACK(void *) drvCharQueryInterface(PPDMIBASE pInterface, const char *pszIID)
{
PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
PDRVCHAR pThis = PDMINS_2_DATA(pDrvIns, PDRVCHAR);
PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
PDMIBASE_RETURN_INTERFACE(pszIID, PDMICHARCONNECTOR, &pThis->ICharConnector);
return NULL;
}
开发者ID:stefano-garzarella,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:12,代码来源:DrvChar.cpp
注:本文中的PDMINS_2_DATA函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论