VirtualBox

source: vbox/trunk/src/VBox/Devices/testcase/tstDevicePdmDevHlpR0.cpp@ 93956

Last change on this file since 93956 was 93491, checked in by vboxsync, 3 years ago

Devices/testcases/tstDevice: Quick and dirty testcase to debug individual device SSM loading issues (requires converting the hexdump of the unit from VBox.log to a binary)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 59.7 KB
Line 
1/* $Id: tstDevicePdmDevHlpR0.cpp 93491 2022-01-31 09:38:35Z vboxsync $ */
2/** @file
3 * tstDevice - Test framework for PDM devices/drivers, PDM fake R0 helper implementation.
4 */
5
6/*
7 * Copyright (C) 2021-2022 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*********************************************************************************************************************************
20* Header Files *
21*********************************************************************************************************************************/
22#define LOG_GROUP LOG_GROUP_DEFAULT /** @todo */
23#undef IN_RING3
24#undef IN_SUP_R3
25#define IN_RING0
26#define IN_SUP_R0
27#define LINUX_VERSION_CODE 0
28#define KERNEL_VERSION(a,b,c) 1
29#include <iprt/linux/version.h>
30#include <VBox/types.h>
31#include <VBox/version.h>
32#include <VBox/vmm/pdmpci.h>
33
34#include <iprt/assert.h>
35#include <iprt/mem.h>
36#include <iprt/rand.h>
37#include <iprt/string.h>
38
39#include "tstDeviceInternal.h"
40
41
42/*********************************************************************************************************************************
43* Defined Constants And Macros *
44*********************************************************************************************************************************/
45
46/* Temporarily until the stubs got implemented. */
47#define VBOX_TSTDEV_NOT_IMPLEMENTED_STUBS_FAKE_SUCCESS 1
48
49/** @def PDMDEV_ASSERT_DEVINS
50 * Asserts the validity of the device instance.
51 */
52#ifdef VBOX_STRICT
53# define PDMDEV_ASSERT_DEVINS(pDevIns) \
54 do { \
55 AssertPtr(pDevIns); \
56 Assert(pDevIns->u32Version == PDM_DEVINS_VERSION); \
57 Assert(pDevIns->CTX_SUFF(pvInstanceDataFor) == (void *)&pDevIns->achInstanceData[0]); \
58 } while (0)
59#else
60# define PDMDEV_ASSERT_DEVINS(pDevIns) do { } while (0)
61#endif
62
63
64/** Frequency of the real clock. */
65#define TMCLOCK_FREQ_REAL UINT32_C(1000)
66/** Frequency of the virtual clock. */
67#define TMCLOCK_FREQ_VIRTUAL UINT32_C(1000000000)
68
69#undef RT_VALID_PTR
70#define RT_VALID_PTR(ptr) true
71
72
73/*********************************************************************************************************************************
74* Structures and Typedefs *
75*********************************************************************************************************************************/
76
77
78
79/*********************************************************************************************************************************
80* Global Variables *
81*********************************************************************************************************************************/
82
83
84
85/*********************************************************************************************************************************
86* Internal Functions *
87*********************************************************************************************************************************/
88
89/** @interface_method_impl{PDMDEVHLPR0,pfnIoPortSetUpContextEx} */
90static DECLCALLBACK(int) pdmR0DevHlp_IoPortSetUpContextEx(PPDMDEVINS pDevIns, IOMIOPORTHANDLE hIoPorts,
91 PFNIOMIOPORTNEWOUT pfnOut, PFNIOMIOPORTNEWIN pfnIn,
92 PFNIOMIOPORTNEWOUTSTRING pfnOutStr, PFNIOMIOPORTNEWINSTRING pfnInStr,
93 void *pvUser)
94{
95 PDMDEV_ASSERT_DEVINS(pDevIns);
96 LogFlow(("pdmR0DevHlp_IoPortSetUpContextEx: caller='%s'/%d: hIoPorts=%#x pfnOut=%p pfnIn=%p pfnOutStr=%p pfnInStr=%p pvUser=%p\n",
97 pDevIns->pReg->szName, pDevIns->iInstance, hIoPorts, pfnOut, pfnIn, pfnOutStr, pfnInStr, pvUser));
98
99 int rc = VINF_SUCCESS;
100 PRTDEVDUTIOPORT pIoPort = (PRTDEVDUTIOPORT)hIoPorts;
101 if (RT_LIKELY(pIoPort))
102 {
103 pIoPort->pvUserR0 = pvUser;
104 pIoPort->pfnOutR0 = pfnOut;
105 pIoPort->pfnInR0 = pfnIn;
106 pIoPort->pfnOutStrR0 = pfnOutStr;
107 pIoPort->pfnInStrR0 = pfnInStr;
108 }
109 else
110 AssertReleaseFailed();
111
112 LogFlow(("pdmR0DevHlp_IoPortSetUpContextEx: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
113 return rc;
114}
115
116
117/** @interface_method_impl{PDMDEVHLPR0,pfnMmioSetUpContextEx} */
118static DECLCALLBACK(int) pdmR0DevHlp_MmioSetUpContextEx(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, PFNIOMMMIONEWWRITE pfnWrite,
119 PFNIOMMMIONEWREAD pfnRead, PFNIOMMMIONEWFILL pfnFill, void *pvUser)
120{
121 PDMDEV_ASSERT_DEVINS(pDevIns);
122 LogFlow(("pdmR0DevHlp_MmioSetUpContextEx: caller='%s'/%d: hRegion=%#x pfnWrite=%p pfnRead=%p pfnFill=%p pvUser=%p\n",
123 pDevIns->pReg->szName, pDevIns->iInstance, hRegion, pfnWrite, pfnRead, pfnFill, pvUser));
124
125 int rc = VINF_SUCCESS;
126 PRTDEVDUTMMIO pMmio = (PRTDEVDUTMMIO)hRegion;
127 if (RT_LIKELY(pMmio))
128 {
129 pMmio->pvUserR0 = pvUser;
130 pMmio->pfnWriteR0 = pfnWrite;
131 pMmio->pfnReadR0 = pfnRead;
132 pMmio->pfnFillR0 = pfnFill;
133 }
134 else
135 AssertReleaseFailed();
136
137 LogFlow(("pdmR0DevHlp_MmioSetUpContextEx: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
138 return rc;
139}
140
141
142/** @interface_method_impl{PDMDEVHLPR0,pfnMmio2SetUpContext} */
143static DECLCALLBACK(int) pdmR0DevHlp_Mmio2SetUpContext(PPDMDEVINS pDevIns, PGMMMIO2HANDLE hRegion,
144 size_t offSub, size_t cbSub, void **ppvMapping)
145{
146 PDMDEV_ASSERT_DEVINS(pDevIns);
147 LogFlow(("pdmR0DevHlp_Mmio2SetUpContext: caller='%s'/%d: hRegion=%#x offSub=%#zx cbSub=%#zx ppvMapping=%p\n",
148 pDevIns->pReg->szName, pDevIns->iInstance, hRegion, offSub, cbSub, ppvMapping));
149 *ppvMapping = NULL;
150
151 int rc = VERR_NOT_IMPLEMENTED;
152 AssertFailed();
153
154 LogFlow(("pdmR0DevHlp_Mmio2SetUpContext: caller='%s'/%d: returns %Rrc (%p)\n", pDevIns->pReg->szName, pDevIns->iInstance, rc, *ppvMapping));
155 return rc;
156}
157
158
159/** @interface_method_impl{PDMDEVHLPR0,pfnPCIPhysRead} */
160static DECLCALLBACK(int) pdmR0DevHlp_PCIPhysRead(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys,
161 void *pvBuf, size_t cbRead, uint32_t fFlags)
162{
163 PDMDEV_ASSERT_DEVINS(pDevIns);
164 if (!pPciDev) /* NULL is an alias for the default PCI device. */
165 pPciDev = pDevIns->apPciDevs[0];
166 AssertReturn(pPciDev, VERR_PDM_NOT_PCI_DEVICE);
167 PDMPCIDEV_ASSERT_VALID_AND_REGISTERED(pDevIns, pPciDev);
168
169#ifndef PDM_DO_NOT_RESPECT_PCI_BM_BIT
170 /*
171 * Just check the busmaster setting here and forward the request to the generic read helper.
172 */
173 if (PCIDevIsBusmaster(pPciDev))
174 { /* likely */ }
175 else
176 {
177 LogFunc(("caller=%p/%d: returns %Rrc - Not bus master! GCPhys=%RGp cbRead=%#zx\n", pDevIns, pDevIns->iInstance,
178 VERR_PDM_NOT_PCI_BUS_MASTER, GCPhys, cbRead));
179 memset(pvBuf, 0xff, cbRead);
180 return VERR_PDM_NOT_PCI_BUS_MASTER;
181 }
182#endif
183
184 return pDevIns->pHlpR0->pfnPhysRead(pDevIns, GCPhys, pvBuf, cbRead, fFlags);
185}
186
187
188/** @interface_method_impl{PDMDEVHLPR0,pfnPCIPhysWrite} */
189static DECLCALLBACK(int) pdmR0DevHlp_PCIPhysWrite(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys,
190 const void *pvBuf, size_t cbWrite, uint32_t fFlags)
191{
192 PDMDEV_ASSERT_DEVINS(pDevIns);
193 if (!pPciDev) /* NULL is an alias for the default PCI device. */
194 pPciDev = pDevIns->apPciDevs[0];
195 AssertReturn(pPciDev, VERR_PDM_NOT_PCI_DEVICE);
196 PDMPCIDEV_ASSERT_VALID_AND_REGISTERED(pDevIns, pPciDev);
197
198#ifndef PDM_DO_NOT_RESPECT_PCI_BM_BIT
199 /*
200 * Just check the busmaster setting here and forward the request to the generic read helper.
201 */
202 if (PCIDevIsBusmaster(pPciDev))
203 { /* likely */ }
204 else
205 {
206 LogFunc(("caller=%p/%d: returns %Rrc - Not bus master! GCPhys=%RGp cbWrite=%#zx\n", pDevIns, pDevIns->iInstance,
207 VERR_PDM_NOT_PCI_BUS_MASTER, GCPhys, cbWrite));
208 return VERR_PDM_NOT_PCI_BUS_MASTER;
209 }
210#endif
211
212 return pDevIns->pHlpR0->pfnPhysWrite(pDevIns, GCPhys, pvBuf, cbWrite, fFlags);
213}
214
215
216/** @interface_method_impl{PDMDEVHLPR0,pfnPCISetIrq} */
217static DECLCALLBACK(void) pdmR0DevHlp_PCISetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel)
218{
219 PDMDEV_ASSERT_DEVINS(pDevIns);
220 if (!pPciDev) /* NULL is an alias for the default PCI device. */
221 pPciDev = pDevIns->apPciDevs[0];
222 AssertReturnVoid(pPciDev);
223 LogFlow(("pdmR0DevHlp_PCISetIrq: caller=%p/%d: pPciDev=%p:{%#x} iIrq=%d iLevel=%d\n",
224 pDevIns, pDevIns->iInstance, pPciDev, pPciDev->uDevFn, iIrq, iLevel));
225 PDMPCIDEV_ASSERT_VALID_AND_REGISTERED(pDevIns, pPciDev);
226
227 AssertFailed();
228
229 LogFlow(("pdmR0DevHlp_PCISetIrq: caller=%p/%d: returns void; uTagSrc=%#x\n", pDevIns, pDevIns->iInstance, 0 /*uTagSrc*/));
230}
231
232
233/** @interface_method_impl{PDMDEVHLPR0,pfnISASetIrq} */
234static DECLCALLBACK(void) pdmR0DevHlp_ISASetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel)
235{
236 PDMDEV_ASSERT_DEVINS(pDevIns);
237 LogFlow(("pdmR0DevHlp_ISASetIrq: caller=%p/%d: iIrq=%d iLevel=%d\n", pDevIns, pDevIns->iInstance, iIrq, iLevel));
238
239 AssertFailed();
240
241 LogFlow(("pdmR0DevHlp_ISASetIrq: caller=%p/%d: returns void; uTagSrc=%#x\n", pDevIns, pDevIns->iInstance, 0 /*uTagSrc*/));
242}
243
244
245/** @interface_method_impl{PDMDEVHLPR0,pfnPhysRead} */
246static DECLCALLBACK(int) pdmR0DevHlp_PhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead, uint32_t fFlags)
247{
248 RT_NOREF(fFlags);
249
250 PDMDEV_ASSERT_DEVINS(pDevIns);
251 LogFlow(("pdmR0DevHlp_PhysRead: caller=%p/%d: GCPhys=%RGp pvBuf=%p cbRead=%#x\n",
252 pDevIns, pDevIns->iInstance, GCPhys, pvBuf, cbRead));
253
254 VBOXSTRICTRC rcStrict = VERR_NOT_IMPLEMENTED;
255 AssertFailed();
256
257 Log(("pdmR0DevHlp_PhysRead: caller=%p/%d: returns %Rrc\n", pDevIns, pDevIns->iInstance, VBOXSTRICTRC_VAL(rcStrict) ));
258 return VBOXSTRICTRC_VAL(rcStrict);
259}
260
261
262/** @interface_method_impl{PDMDEVHLPR0,pfnPhysWrite} */
263static DECLCALLBACK(int) pdmR0DevHlp_PhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite, uint32_t fFlags)
264{
265 RT_NOREF(fFlags);
266
267 PDMDEV_ASSERT_DEVINS(pDevIns);
268 LogFlow(("pdmR0DevHlp_PhysWrite: caller=%p/%d: GCPhys=%RGp pvBuf=%p cbWrite=%#x\n",
269 pDevIns, pDevIns->iInstance, GCPhys, pvBuf, cbWrite));
270
271 VBOXSTRICTRC rcStrict = VERR_NOT_IMPLEMENTED;
272 AssertFailed();
273
274 Log(("pdmR0DevHlp_PhysWrite: caller=%p/%d: returns %Rrc\n", pDevIns, pDevIns->iInstance, VBOXSTRICTRC_VAL(rcStrict) ));
275 return VBOXSTRICTRC_VAL(rcStrict);
276}
277
278
279/** @interface_method_impl{PDMDEVHLPR0,pfnA20IsEnabled} */
280static DECLCALLBACK(bool) pdmR0DevHlp_A20IsEnabled(PPDMDEVINS pDevIns)
281{
282 PDMDEV_ASSERT_DEVINS(pDevIns);
283 LogFlow(("pdmR0DevHlp_A20IsEnabled: caller=%p/%d:\n", pDevIns, pDevIns->iInstance));
284
285 bool fEnabled = false;
286 AssertFailed();
287
288 Log(("pdmR0DevHlp_A20IsEnabled: caller=%p/%d: returns %RTbool\n", pDevIns, pDevIns->iInstance, fEnabled));
289 return fEnabled;
290}
291
292
293/** @interface_method_impl{PDMDEVHLPR0,pfnVMState} */
294static DECLCALLBACK(VMSTATE) pdmR0DevHlp_VMState(PPDMDEVINS pDevIns)
295{
296 PDMDEV_ASSERT_DEVINS(pDevIns);
297
298 VMSTATE enmVMState = VMSTATE_CREATING;// pDevIns->Internal.s.pGVM->enmVMState;
299
300 LogFlow(("pdmR0DevHlp_VMState: caller=%p/%d: returns %d\n", pDevIns, pDevIns->iInstance, enmVMState));
301 return enmVMState;
302}
303
304
305/** @interface_method_impl{PDMDEVHLPR0,pfnGetVM} */
306static DECLCALLBACK(PVMCC) pdmR0DevHlp_GetVM(PPDMDEVINS pDevIns)
307{
308 PDMDEV_ASSERT_DEVINS(pDevIns);
309 LogFlow(("pdmR0DevHlp_GetVM: caller='%p'/%d\n", pDevIns, pDevIns->iInstance));
310 AssertFailed();
311 return NULL; //pDevIns->Internal.s.pGVM;
312}
313
314
315/** @interface_method_impl{PDMDEVHLPR0,pfnGetVMCPU} */
316static DECLCALLBACK(PVMCPUCC) pdmR0DevHlp_GetVMCPU(PPDMDEVINS pDevIns)
317{
318 PDMDEV_ASSERT_DEVINS(pDevIns);
319 LogFlow(("pdmR0DevHlp_GetVMCPU: caller='%p'/%d\n", pDevIns, pDevIns->iInstance));
320 AssertFailed();
321 return NULL; //VMMGetCpu(pDevIns->Internal.s.pGVM);
322}
323
324
325/** @interface_method_impl{PDMDEVHLPRC,pfnGetCurrentCpuId} */
326static DECLCALLBACK(VMCPUID) pdmR0DevHlp_GetCurrentCpuId(PPDMDEVINS pDevIns)
327{
328 PDMDEV_ASSERT_DEVINS(pDevIns);
329 LogFlow(("pdmR0DevHlp_GetCurrentCpuId: caller='%p'/%d for CPU %u\n", pDevIns, pDevIns->iInstance, 0 /*idCpu*/));
330 AssertFailed();
331 return 0; //idCpu;
332}
333
334
335/** @interface_method_impl{PDMDEVHLPR0,pfnGetMainExecutionEngine} */
336static DECLCALLBACK(uint8_t) pdmR0DevHlp_GetMainExecutionEngine(PPDMDEVINS pDevIns)
337{
338 PDMDEV_ASSERT_DEVINS(pDevIns);
339 LogFlow(("pdmR0DevHlp_GetMainExecutionEngine: caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance));
340 return VM_EXEC_ENGINE_NOT_SET;
341}
342
343
344/** @interface_method_impl{PDMDEVHLPR0,pfnTimerFromMicro} */
345static DECLCALLBACK(uint64_t) pdmR0DevHlp_TimerFromMicro(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t cMicroSecs)
346{
347 PDMDEV_ASSERT_DEVINS(pDevIns);
348 AssertFailed();
349 return 0; //TMTimerFromMicro(pDevIns->Internal.s.pGVM, hTimer, cMicroSecs);
350}
351
352
353/** @interface_method_impl{PDMDEVHLPR0,pfnTimerFromMilli} */
354static DECLCALLBACK(uint64_t) pdmR0DevHlp_TimerFromMilli(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t cMilliSecs)
355{
356 PDMDEV_ASSERT_DEVINS(pDevIns);
357 AssertFailed();
358 return 0;
359}
360
361
362/** @interface_method_impl{PDMDEVHLPR0,pfnTimerFromNano} */
363static DECLCALLBACK(uint64_t) pdmR0DevHlp_TimerFromNano(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t cNanoSecs)
364{
365 PDMDEV_ASSERT_DEVINS(pDevIns);
366 AssertFailed();
367 return 0;
368}
369
370/** @interface_method_impl{PDMDEVHLPR0,pfnTimerGet} */
371static DECLCALLBACK(uint64_t) pdmR0DevHlp_TimerGet(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)
372{
373 PDMDEV_ASSERT_DEVINS(pDevIns);
374 AssertFailed();
375 return 0;
376}
377
378
379/** @interface_method_impl{PDMDEVHLPR0,pfnTimerGetFreq} */
380static DECLCALLBACK(uint64_t) pdmR0DevHlp_TimerGetFreq(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)
381{
382 PDMDEV_ASSERT_DEVINS(pDevIns);
383 AssertFailed();
384 return 0;
385}
386
387
388/** @interface_method_impl{PDMDEVHLPR0,pfnTimerGetNano} */
389static DECLCALLBACK(uint64_t) pdmR0DevHlp_TimerGetNano(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)
390{
391 PDMDEV_ASSERT_DEVINS(pDevIns);
392 AssertFailed();
393 return 0;
394}
395
396
397/** @interface_method_impl{PDMDEVHLPR0,pfnTimerIsActive} */
398static DECLCALLBACK(bool) pdmR0DevHlp_TimerIsActive(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)
399{
400 PDMDEV_ASSERT_DEVINS(pDevIns);
401 AssertFailed();
402 return false;
403}
404
405
406/** @interface_method_impl{PDMDEVHLPR0,pfnTimerIsLockOwner} */
407static DECLCALLBACK(bool) pdmR0DevHlp_TimerIsLockOwner(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)
408{
409 PDMDEV_ASSERT_DEVINS(pDevIns);
410 AssertFailed();
411 return false;
412}
413
414
415/** @interface_method_impl{PDMDEVHLPR0,pfnTimerLockClock} */
416static DECLCALLBACK(VBOXSTRICTRC) pdmR0DevHlp_TimerLockClock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy)
417{
418 PDMDEV_ASSERT_DEVINS(pDevIns);
419 AssertFailed();
420 return VERR_NOT_IMPLEMENTED;
421}
422
423
424/** @interface_method_impl{PDMDEVHLPR0,pfnTimerLockClock2} */
425static DECLCALLBACK(VBOXSTRICTRC) pdmR0DevHlp_TimerLockClock2(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer,
426 PPDMCRITSECT pCritSect, int rcBusy)
427{
428 PDMDEV_ASSERT_DEVINS(pDevIns);
429 AssertFailed();
430 return VERR_NOT_IMPLEMENTED;
431}
432
433
434/** @interface_method_impl{PDMDEVHLPR0,pfnTimerSet} */
435static DECLCALLBACK(int) pdmR0DevHlp_TimerSet(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t uExpire)
436{
437 PDMDEV_ASSERT_DEVINS(pDevIns);
438 AssertFailed();
439 return VERR_NOT_IMPLEMENTED;
440}
441
442
443/** @interface_method_impl{PDMDEVHLPR0,pfnTimerSetFrequencyHint} */
444static DECLCALLBACK(int) pdmR0DevHlp_TimerSetFrequencyHint(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint32_t uHz)
445{
446 PDMDEV_ASSERT_DEVINS(pDevIns);
447 AssertFailed();
448 return VERR_NOT_IMPLEMENTED;
449}
450
451
452/** @interface_method_impl{PDMDEVHLPR0,pfnTimerSetMicro} */
453static DECLCALLBACK(int) pdmR0DevHlp_TimerSetMicro(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t cMicrosToNext)
454{
455 PDMDEV_ASSERT_DEVINS(pDevIns);
456 AssertFailed();
457 return VERR_NOT_IMPLEMENTED;
458}
459
460
461/** @interface_method_impl{PDMDEVHLPR0,pfnTimerSetMillies} */
462static DECLCALLBACK(int) pdmR0DevHlp_TimerSetMillies(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t cMilliesToNext)
463{
464 PDMDEV_ASSERT_DEVINS(pDevIns);
465 AssertFailed();
466 return VERR_NOT_IMPLEMENTED;
467}
468
469
470/** @interface_method_impl{PDMDEVHLPR0,pfnTimerSetNano} */
471static DECLCALLBACK(int) pdmR0DevHlp_TimerSetNano(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t cNanosToNext)
472{
473 PDMDEV_ASSERT_DEVINS(pDevIns);
474 AssertFailed();
475 return VERR_NOT_IMPLEMENTED;
476}
477
478
479/** @interface_method_impl{PDMDEVHLPR0,pfnTimerSetRelative} */
480static DECLCALLBACK(int) pdmR0DevHlp_TimerSetRelative(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t cTicksToNext, uint64_t *pu64Now)
481{
482 PDMDEV_ASSERT_DEVINS(pDevIns);
483 AssertFailed();
484 return VERR_NOT_IMPLEMENTED;
485}
486
487
488/** @interface_method_impl{PDMDEVHLPR0,pfnTimerStop} */
489static DECLCALLBACK(int) pdmR0DevHlp_TimerStop(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)
490{
491 PDMDEV_ASSERT_DEVINS(pDevIns);
492 AssertFailed();
493 return VERR_NOT_IMPLEMENTED;
494}
495
496
497/** @interface_method_impl{PDMDEVHLPR0,pfnTimerUnlockClock} */
498static DECLCALLBACK(void) pdmR0DevHlp_TimerUnlockClock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)
499{
500 PDMDEV_ASSERT_DEVINS(pDevIns);
501 AssertFailed();
502}
503
504
505/** @interface_method_impl{PDMDEVHLPR0,pfnTimerUnlockClock2} */
506static DECLCALLBACK(void) pdmR0DevHlp_TimerUnlockClock2(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect)
507{
508 PDMDEV_ASSERT_DEVINS(pDevIns);
509 AssertFailed();
510}
511
512
513/** @interface_method_impl{PDMDEVHLPR0,pfnTMTimeVirtGet} */
514static DECLCALLBACK(uint64_t) pdmR0DevHlp_TMTimeVirtGet(PPDMDEVINS pDevIns)
515{
516 PDMDEV_ASSERT_DEVINS(pDevIns);
517 LogFlow(("pdmR0DevHlp_TMTimeVirtGet: caller='%p'/%d\n", pDevIns, pDevIns->iInstance));
518 AssertFailed();
519 return 0;
520}
521
522
523/** @interface_method_impl{PDMDEVHLPR0,pfnTMTimeVirtGetFreq} */
524static DECLCALLBACK(uint64_t) pdmR0DevHlp_TMTimeVirtGetFreq(PPDMDEVINS pDevIns)
525{
526 PDMDEV_ASSERT_DEVINS(pDevIns);
527 LogFlow(("pdmR0DevHlp_TMTimeVirtGetFreq: caller='%p'/%d\n", pDevIns, pDevIns->iInstance));
528 AssertFailed();
529 return 0;
530}
531
532
533/** @interface_method_impl{PDMDEVHLPR0,pfnTMTimeVirtGetNano} */
534static DECLCALLBACK(uint64_t) pdmR0DevHlp_TMTimeVirtGetNano(PPDMDEVINS pDevIns)
535{
536 PDMDEV_ASSERT_DEVINS(pDevIns);
537 LogFlow(("pdmR0DevHlp_TMTimeVirtGetNano: caller='%p'/%d\n", pDevIns, pDevIns->iInstance));
538 AssertFailed();
539 return 0;
540}
541
542
543/** Converts a queue handle to a ring-0 queue pointer. */
544DECLINLINE(PPDMQUEUE) pdmR0DevHlp_QueueToPtr(PPDMDEVINS pDevIns, PDMQUEUEHANDLE hQueue)
545{
546 PDMDEV_ASSERT_DEVINS(pDevIns);
547 AssertFailed();
548 return NULL;
549}
550
551
552/** @interface_method_impl{PDMDEVHLPR0,pfnQueueAlloc} */
553static DECLCALLBACK(PPDMQUEUEITEMCORE) pdmR0DevHlp_QueueAlloc(PPDMDEVINS pDevIns, PDMQUEUEHANDLE hQueue)
554{
555 AssertFailed();
556 return NULL; //PDMQueueAlloc(pdmR0DevHlp_QueueToPtr(pDevIns, hQueue));
557}
558
559
560/** @interface_method_impl{PDMDEVHLPR0,pfnQueueInsert} */
561static DECLCALLBACK(void) pdmR0DevHlp_QueueInsert(PPDMDEVINS pDevIns, PDMQUEUEHANDLE hQueue, PPDMQUEUEITEMCORE pItem)
562{
563 AssertFailed();
564 //return PDMQueueInsert(pdmR0DevHlp_QueueToPtr(pDevIns, hQueue), pItem);
565}
566
567
568/** @interface_method_impl{PDMDEVHLPR0,pfnQueueFlushIfNecessary} */
569static DECLCALLBACK(bool) pdmR0DevHlp_QueueFlushIfNecessary(PPDMDEVINS pDevIns, PDMQUEUEHANDLE hQueue)
570{
571 AssertFailed();
572 return false; //PDMQueueFlushIfNecessary(pdmR0DevHlp_QueueToPtr(pDevIns, hQueue));
573}
574
575
576/** @interface_method_impl{PDMDEVHLPR0,pfnTaskTrigger} */
577static DECLCALLBACK(int) pdmR0DevHlp_TaskTrigger(PPDMDEVINS pDevIns, PDMTASKHANDLE hTask)
578{
579 PDMDEV_ASSERT_DEVINS(pDevIns);
580 LogFlow(("pdmR0DevHlp_TaskTrigger: caller='%s'/%d: hTask=%RU64\n", pDevIns->pReg->szName, pDevIns->iInstance, hTask));
581
582 AssertFailed();
583 int rc = VERR_NOT_IMPLEMENTED; //PDMTaskTrigger(pDevIns->Internal.s.pGVM, PDMTASKTYPE_DEV, pDevIns->pDevInsForR3, hTask);
584
585 LogFlow(("pdmR0DevHlp_TaskTrigger: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
586 return rc;
587}
588
589
590/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventSignal} */
591static DECLCALLBACK(int) pdmR0DevHlp_SUPSemEventSignal(PPDMDEVINS pDevIns, SUPSEMEVENT hEvent)
592{
593 PDMDEV_ASSERT_DEVINS(pDevIns);
594 LogFlow(("pdmR0DevHlp_SUPSemEventSignal: caller='%s'/%d: hEvent=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, hEvent));
595
596 AssertFailed();
597 int rc = VERR_NOT_IMPLEMENTED; //SUPSemEventSignal(pDevIns->Internal.s.pGVM->pSession, hEvent);
598
599 LogFlow(("pdmR0DevHlp_SUPSemEventSignal: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
600 return rc;
601}
602
603
604/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventWaitNoResume} */
605static DECLCALLBACK(int) pdmR0DevHlp_SUPSemEventWaitNoResume(PPDMDEVINS pDevIns, SUPSEMEVENT hEvent, uint32_t cMillies)
606{
607 PDMDEV_ASSERT_DEVINS(pDevIns);
608 LogFlow(("pdmR0DevHlp_SUPSemEventWaitNoResume: caller='%s'/%d: hEvent=%p cNsTimeout=%RU32\n",
609 pDevIns->pReg->szName, pDevIns->iInstance, hEvent, cMillies));
610
611 AssertFailed();
612 int rc = VERR_NOT_IMPLEMENTED; //SUPSemEventWaitNoResume(pDevIns->Internal.s.pGVM->pSession, hEvent, cMillies);
613
614 LogFlow(("pdmR0DevHlp_SUPSemEventWaitNoResume: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
615 return rc;
616}
617
618
619/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventWaitNsAbsIntr} */
620static DECLCALLBACK(int) pdmR0DevHlp_SUPSemEventWaitNsAbsIntr(PPDMDEVINS pDevIns, SUPSEMEVENT hEvent, uint64_t uNsTimeout)
621{
622 PDMDEV_ASSERT_DEVINS(pDevIns);
623 LogFlow(("pdmR0DevHlp_SUPSemEventWaitNsAbsIntr: caller='%s'/%d: hEvent=%p uNsTimeout=%RU64\n",
624 pDevIns->pReg->szName, pDevIns->iInstance, hEvent, uNsTimeout));
625
626 AssertFailed();
627 int rc = VERR_NOT_IMPLEMENTED; //SUPSemEventWaitNsAbsIntr(pDevIns->Internal.s.pGVM->pSession, hEvent, uNsTimeout);
628
629 LogFlow(("pdmR0DevHlp_SUPSemEventWaitNsAbsIntr: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
630 return rc;
631}
632
633
634/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventWaitNsRelIntr} */
635static DECLCALLBACK(int) pdmR0DevHlp_SUPSemEventWaitNsRelIntr(PPDMDEVINS pDevIns, SUPSEMEVENT hEvent, uint64_t cNsTimeout)
636{
637 PDMDEV_ASSERT_DEVINS(pDevIns);
638 LogFlow(("pdmR0DevHlp_SUPSemEventWaitNsRelIntr: caller='%s'/%d: hEvent=%p cNsTimeout=%RU64\n",
639 pDevIns->pReg->szName, pDevIns->iInstance, hEvent, cNsTimeout));
640
641 AssertFailed();
642 int rc = VERR_NOT_IMPLEMENTED; //SUPSemEventWaitNsRelIntr(pDevIns->Internal.s.pGVM->pSession, hEvent, cNsTimeout);
643
644 LogFlow(("pdmR0DevHlp_SUPSemEventWaitNsRelIntr: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
645 return rc;
646}
647
648
649/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventGetResolution} */
650static DECLCALLBACK(uint32_t) pdmR0DevHlp_SUPSemEventGetResolution(PPDMDEVINS pDevIns)
651{
652 PDMDEV_ASSERT_DEVINS(pDevIns);
653 LogFlow(("pdmR0DevHlp_SUPSemEventGetResolution: caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance));
654
655 AssertFailed();
656 uint32_t cNsResolution = 0; //SUPSemEventGetResolution(pDevIns->Internal.s.pGVM->pSession);
657
658 LogFlow(("pdmR0DevHlp_SUPSemEventGetResolution: caller='%s'/%d: returns %u\n", pDevIns->pReg->szName, pDevIns->iInstance, cNsResolution));
659 return cNsResolution;
660}
661
662
663/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventMultiSignal} */
664static DECLCALLBACK(int) pdmR0DevHlp_SUPSemEventMultiSignal(PPDMDEVINS pDevIns, SUPSEMEVENTMULTI hEventMulti)
665{
666 PDMDEV_ASSERT_DEVINS(pDevIns);
667 LogFlow(("pdmR0DevHlp_SUPSemEventMultiSignal: caller='%s'/%d: hEventMulti=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, hEventMulti));
668
669 AssertFailed();
670 int rc = VERR_NOT_IMPLEMENTED; //SUPSemEventMultiSignal(pDevIns->Internal.s.pGVM->pSession, hEventMulti);
671
672 LogFlow(("pdmR0DevHlp_SUPSemEventMultiSignal: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
673 return rc;
674}
675
676
677/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventMultiReset} */
678static DECLCALLBACK(int) pdmR0DevHlp_SUPSemEventMultiReset(PPDMDEVINS pDevIns, SUPSEMEVENTMULTI hEventMulti)
679{
680 PDMDEV_ASSERT_DEVINS(pDevIns);
681 LogFlow(("pdmR0DevHlp_SUPSemEventMultiReset: caller='%s'/%d: hEventMulti=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, hEventMulti));
682
683 AssertFailed();
684 int rc = VERR_NOT_IMPLEMENTED; //SUPSemEventMultiReset(pDevIns->Internal.s.pGVM->pSession, hEventMulti);
685
686 LogFlow(("pdmR0DevHlp_SUPSemEventMultiReset: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
687 return rc;
688}
689
690
691/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventMultiWaitNoResume} */
692static DECLCALLBACK(int) pdmR0DevHlp_SUPSemEventMultiWaitNoResume(PPDMDEVINS pDevIns, SUPSEMEVENTMULTI hEventMulti,
693 uint32_t cMillies)
694{
695 PDMDEV_ASSERT_DEVINS(pDevIns);
696 LogFlow(("pdmR0DevHlp_SUPSemEventMultiWaitNoResume: caller='%s'/%d: hEventMulti=%p cMillies=%RU32\n",
697 pDevIns->pReg->szName, pDevIns->iInstance, hEventMulti, cMillies));
698
699 AssertFailed();
700 int rc = VERR_NOT_IMPLEMENTED; //SUPSemEventMultiWaitNoResume(pDevIns->Internal.s.pGVM->pSession, hEventMulti, cMillies);
701
702 LogFlow(("pdmR0DevHlp_SUPSemEventMultiWaitNoResume: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
703 return rc;
704}
705
706
707/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventMultiWaitNsAbsIntr} */
708static DECLCALLBACK(int) pdmR0DevHlp_SUPSemEventMultiWaitNsAbsIntr(PPDMDEVINS pDevIns, SUPSEMEVENTMULTI hEventMulti,
709 uint64_t uNsTimeout)
710{
711 PDMDEV_ASSERT_DEVINS(pDevIns);
712 LogFlow(("pdmR0DevHlp_SUPSemEventMultiWaitNsAbsIntr: caller='%s'/%d: hEventMulti=%p uNsTimeout=%RU64\n",
713 pDevIns->pReg->szName, pDevIns->iInstance, hEventMulti, uNsTimeout));
714
715 AssertFailed();
716 int rc = VERR_NOT_IMPLEMENTED; //SUPSemEventMultiWaitNsAbsIntr(pDevIns->Internal.s.pGVM->pSession, hEventMulti, uNsTimeout);
717
718 LogFlow(("pdmR0DevHlp_SUPSemEventMultiWaitNsAbsIntr: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
719 return rc;
720}
721
722
723/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventMultiWaitNsRelIntr} */
724static DECLCALLBACK(int) pdmR0DevHlp_SUPSemEventMultiWaitNsRelIntr(PPDMDEVINS pDevIns, SUPSEMEVENTMULTI hEventMulti,
725 uint64_t cNsTimeout)
726{
727 PDMDEV_ASSERT_DEVINS(pDevIns);
728 LogFlow(("pdmR0DevHlp_SUPSemEventMultiWaitNsRelIntr: caller='%s'/%d: hEventMulti=%p cNsTimeout=%RU64\n",
729 pDevIns->pReg->szName, pDevIns->iInstance, hEventMulti, cNsTimeout));
730
731 AssertFailed();
732 int rc = VERR_NOT_IMPLEMENTED; //SUPSemEventMultiWaitNsRelIntr(pDevIns->Internal.s.pGVM->pSession, hEventMulti, cNsTimeout);
733
734 LogFlow(("pdmR0DevHlp_SUPSemEventMultiWaitNsRelIntr: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
735 return rc;
736}
737
738
739/** @interface_method_impl{PDMDEVHLPR0,pfnSUPSemEventMultiGetResolution} */
740static DECLCALLBACK(uint32_t) pdmR0DevHlp_SUPSemEventMultiGetResolution(PPDMDEVINS pDevIns)
741{
742 PDMDEV_ASSERT_DEVINS(pDevIns);
743 LogFlow(("pdmR0DevHlp_SUPSemEventMultiGetResolution: caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance));
744
745 AssertFailed();
746 uint32_t cNsResolution = 0; //SUPSemEventMultiGetResolution(pDevIns->Internal.s.pGVM->pSession);
747
748 LogFlow(("pdmR0DevHlp_SUPSemEventMultiGetResolution: caller='%s'/%d: returns %u\n", pDevIns->pReg->szName, pDevIns->iInstance, cNsResolution));
749 return cNsResolution;
750}
751
752
753/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectGetNop} */
754static DECLCALLBACK(PPDMCRITSECT) pdmR0DevHlp_CritSectGetNop(PPDMDEVINS pDevIns)
755{
756 PDMDEV_ASSERT_DEVINS(pDevIns);
757
758 PPDMCRITSECT pCritSect = &pDevIns->Internal.s.pDut->CritSectNop;
759 LogFlow(("pdmR0DevHlp_CritSectGetNop: caller='%s'/%d: return %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pCritSect));
760 return pCritSect;
761}
762
763
764/** @interface_method_impl{PDMDEVHLPR0,pfnSetDeviceCritSect} */
765static DECLCALLBACK(int) pdmR0DevHlp_SetDeviceCritSect(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect)
766{
767 /*
768 * Validate input.
769 *
770 * Note! We only allow the automatically created default critical section
771 * to be replaced by this API.
772 */
773 PDMDEV_ASSERT_DEVINS(pDevIns);
774 AssertPtrReturn(pCritSect, VERR_INVALID_POINTER);
775 LogFlow(("pdmR0DevHlp_SetDeviceCritSect: caller='%s'/%d: pCritSect=%p\n",
776 pDevIns->pReg->szName, pDevIns->iInstance, pCritSect));
777 AssertReturn(RTCritSectIsInitialized(&pCritSect->s.CritSect), VERR_INVALID_PARAMETER);
778
779 pDevIns->pCritSectRoR0 = pCritSect;
780
781 LogFlow(("pdmR0DevHlp_SetDeviceCritSect: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
782 return VINF_SUCCESS;
783}
784
785
786/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectEnter} */
787static DECLCALLBACK(int) pdmR0DevHlp_CritSectEnter(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, int rcBusy)
788{
789 PDMDEV_ASSERT_DEVINS(pDevIns);
790 AssertFailed();
791 return VERR_NOT_IMPLEMENTED; //PDMCritSectEnter(pDevIns->Internal.s.pGVM, pCritSect, rcBusy);
792}
793
794
795/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectEnterDebug} */
796static DECLCALLBACK(int) pdmR0DevHlp_CritSectEnterDebug(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, int rcBusy, RTHCUINTPTR uId, RT_SRC_POS_DECL)
797{
798 PDMDEV_ASSERT_DEVINS(pDevIns);
799 AssertFailed();
800 return VERR_NOT_IMPLEMENTED; //PDMCritSectEnterDebug(pDevIns->Internal.s.pGVM, pCritSect, rcBusy, uId, RT_SRC_POS_ARGS);
801}
802
803
804/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectTryEnter} */
805static DECLCALLBACK(int) pdmR0DevHlp_CritSectTryEnter(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect)
806{
807 PDMDEV_ASSERT_DEVINS(pDevIns);
808 AssertFailed();
809 return VERR_NOT_IMPLEMENTED; //PDMCritSectTryEnter(pDevIns->Internal.s.pGVM, pCritSect);
810}
811
812
813/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectTryEnterDebug} */
814static DECLCALLBACK(int) pdmR0DevHlp_CritSectTryEnterDebug(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, RTHCUINTPTR uId, RT_SRC_POS_DECL)
815{
816 PDMDEV_ASSERT_DEVINS(pDevIns);
817 AssertFailed();
818 return VERR_NOT_IMPLEMENTED; //PDMCritSectTryEnterDebug(pDevIns->Internal.s.pGVM, pCritSect, uId, RT_SRC_POS_ARGS);
819}
820
821
822/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectLeave} */
823static DECLCALLBACK(int) pdmR0DevHlp_CritSectLeave(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect)
824{
825 PDMDEV_ASSERT_DEVINS(pDevIns);
826 AssertFailed();
827 return VERR_NOT_IMPLEMENTED; //PDMCritSectLeave(pDevIns->Internal.s.pGVM, pCritSect);
828}
829
830
831/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectIsOwner} */
832static DECLCALLBACK(bool) pdmR0DevHlp_CritSectIsOwner(PPDMDEVINS pDevIns, PCPDMCRITSECT pCritSect)
833{
834 PDMDEV_ASSERT_DEVINS(pDevIns);
835 AssertFailed();
836 return VERR_NOT_IMPLEMENTED; //PDMCritSectIsOwner(pDevIns->Internal.s.pGVM, pCritSect);
837}
838
839
840/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectIsInitialized} */
841static DECLCALLBACK(bool) pdmR0DevHlp_CritSectIsInitialized(PPDMDEVINS pDevIns, PCPDMCRITSECT pCritSect)
842{
843 PDMDEV_ASSERT_DEVINS(pDevIns);
844 RT_NOREF(pDevIns);
845 AssertFailed();
846 return VERR_NOT_IMPLEMENTED; //PDMCritSectIsInitialized(pCritSect);
847}
848
849
850/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectHasWaiters} */
851static DECLCALLBACK(bool) pdmR0DevHlp_CritSectHasWaiters(PPDMDEVINS pDevIns, PCPDMCRITSECT pCritSect)
852{
853 PDMDEV_ASSERT_DEVINS(pDevIns);
854 AssertFailed();
855 return VERR_NOT_IMPLEMENTED; //PDMCritSectHasWaiters(pDevIns->Internal.s.pGVM, pCritSect);
856}
857
858
859/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectGetRecursion} */
860static DECLCALLBACK(uint32_t) pdmR0DevHlp_CritSectGetRecursion(PPDMDEVINS pDevIns, PCPDMCRITSECT pCritSect)
861{
862 PDMDEV_ASSERT_DEVINS(pDevIns);
863 RT_NOREF(pDevIns);
864 AssertFailed();
865 return VERR_NOT_IMPLEMENTED; //PDMCritSectGetRecursion(pCritSect);
866}
867
868
869/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectScheduleExitEvent} */
870static DECLCALLBACK(int) pdmR0DevHlp_CritSectScheduleExitEvent(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect,
871 SUPSEMEVENT hEventToSignal)
872{
873 PDMDEV_ASSERT_DEVINS(pDevIns);
874 RT_NOREF(pDevIns);
875 AssertFailed();
876 return VERR_NOT_IMPLEMENTED; //PDMHCCritSectScheduleExitEvent(pCritSect, hEventToSignal);
877}
878
879
880/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwEnterShared} */
881static DECLCALLBACK(int) pdmR0DevHlp_CritSectRwEnterShared(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect, int rcBusy)
882{
883 PDMDEV_ASSERT_DEVINS(pDevIns);
884 AssertFailed();
885 return VERR_NOT_IMPLEMENTED; //PDMCritSectRwEnterShared(pDevIns->Internal.s.pGVM, pCritSect, rcBusy);
886}
887
888
889/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwEnterSharedDebug} */
890static DECLCALLBACK(int) pdmR0DevHlp_CritSectRwEnterSharedDebug(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect, int rcBusy,
891 RTHCUINTPTR uId, RT_SRC_POS_DECL)
892{
893 PDMDEV_ASSERT_DEVINS(pDevIns);
894 AssertFailed();
895 return VERR_NOT_IMPLEMENTED; //PDMCritSectRwEnterSharedDebug(pDevIns->Internal.s.pGVM, pCritSect, rcBusy, uId, RT_SRC_POS_ARGS);
896}
897
898
899
900/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwTryEnterShared} */
901static DECLCALLBACK(int) pdmR0DevHlp_CritSectRwTryEnterShared(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect)
902{
903 PDMDEV_ASSERT_DEVINS(pDevIns);
904 AssertFailed();
905 return VERR_NOT_IMPLEMENTED; //PDMCritSectRwTryEnterShared(pDevIns->Internal.s.pGVM, pCritSect);
906}
907
908
909/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwTryEnterSharedDebug} */
910static DECLCALLBACK(int) pdmR0DevHlp_CritSectRwTryEnterSharedDebug(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect,
911 RTHCUINTPTR uId, RT_SRC_POS_DECL)
912{
913 PDMDEV_ASSERT_DEVINS(pDevIns);
914 AssertFailed();
915 return VERR_NOT_IMPLEMENTED; //PDMCritSectRwTryEnterSharedDebug(pDevIns->Internal.s.pGVM, pCritSect, uId, RT_SRC_POS_ARGS);
916}
917
918
919/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwLeaveShared} */
920static DECLCALLBACK(int) pdmR0DevHlp_CritSectRwLeaveShared(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect)
921{
922 PDMDEV_ASSERT_DEVINS(pDevIns);
923 AssertFailed();
924 return VERR_NOT_IMPLEMENTED; //PDMCritSectRwLeaveShared(pDevIns->Internal.s.pGVM, pCritSect);
925}
926
927
928/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwEnterExcl} */
929static DECLCALLBACK(int) pdmR0DevHlp_CritSectRwEnterExcl(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect, int rcBusy)
930{
931 PDMDEV_ASSERT_DEVINS(pDevIns);
932 AssertFailed();
933 return VERR_NOT_IMPLEMENTED; //PDMCritSectRwEnterExcl(pDevIns->Internal.s.pGVM, pCritSect, rcBusy);
934}
935
936
937/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwEnterExclDebug} */
938static DECLCALLBACK(int) pdmR0DevHlp_CritSectRwEnterExclDebug(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect, int rcBusy,
939 RTHCUINTPTR uId, RT_SRC_POS_DECL)
940{
941 PDMDEV_ASSERT_DEVINS(pDevIns);
942 AssertFailed();
943 return VERR_NOT_IMPLEMENTED; //PDMCritSectRwEnterExclDebug(pDevIns->Internal.s.pGVM, pCritSect, rcBusy, uId, RT_SRC_POS_ARGS);
944}
945
946
947/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwTryEnterExcl} */
948static DECLCALLBACK(int) pdmR0DevHlp_CritSectRwTryEnterExcl(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect)
949{
950 PDMDEV_ASSERT_DEVINS(pDevIns);
951 AssertFailed();
952 return VERR_NOT_IMPLEMENTED; //PDMCritSectRwTryEnterExcl(pDevIns->Internal.s.pGVM, pCritSect);
953}
954
955
956/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwTryEnterExclDebug} */
957static DECLCALLBACK(int) pdmR0DevHlp_CritSectRwTryEnterExclDebug(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect,
958 RTHCUINTPTR uId, RT_SRC_POS_DECL)
959{
960 PDMDEV_ASSERT_DEVINS(pDevIns);
961 AssertFailed();
962 return VERR_NOT_IMPLEMENTED; //PDMCritSectRwTryEnterExclDebug(pDevIns->Internal.s.pGVM, pCritSect, uId, RT_SRC_POS_ARGS);
963}
964
965
966/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwLeaveExcl} */
967static DECLCALLBACK(int) pdmR0DevHlp_CritSectRwLeaveExcl(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect)
968{
969 PDMDEV_ASSERT_DEVINS(pDevIns);
970 AssertFailed();
971 return VERR_NOT_IMPLEMENTED; //PDMCritSectRwLeaveExcl(pDevIns->Internal.s.pGVM, pCritSect);
972}
973
974
975/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwIsWriteOwner} */
976static DECLCALLBACK(bool) pdmR0DevHlp_CritSectRwIsWriteOwner(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect)
977{
978 PDMDEV_ASSERT_DEVINS(pDevIns);
979 AssertFailed();
980 return false; //PDMCritSectRwIsWriteOwner(pDevIns->Internal.s.pGVM, pCritSect);
981}
982
983
984/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwIsReadOwner} */
985static DECLCALLBACK(bool) pdmR0DevHlp_CritSectRwIsReadOwner(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect, bool fWannaHear)
986{
987 PDMDEV_ASSERT_DEVINS(pDevIns);
988 AssertFailed();
989 return false; //PDMCritSectRwIsReadOwner(pDevIns->Internal.s.pGVM, pCritSect, fWannaHear);
990}
991
992
993/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwGetWriteRecursion} */
994static DECLCALLBACK(uint32_t) pdmR0DevHlp_CritSectRwGetWriteRecursion(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect)
995{
996 PDMDEV_ASSERT_DEVINS(pDevIns);
997 RT_NOREF(pDevIns);
998 AssertFailed();
999 return 0; //PDMCritSectRwGetWriteRecursion(pCritSect);
1000}
1001
1002
1003/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwGetWriterReadRecursion} */
1004static DECLCALLBACK(uint32_t) pdmR0DevHlp_CritSectRwGetWriterReadRecursion(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect)
1005{
1006 PDMDEV_ASSERT_DEVINS(pDevIns);
1007 RT_NOREF(pDevIns);
1008 AssertFailed();
1009 return 0; //PDMCritSectRwGetWriterReadRecursion(pCritSect);
1010}
1011
1012
1013/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwGetReadCount} */
1014static DECLCALLBACK(uint32_t) pdmR0DevHlp_CritSectRwGetReadCount(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect)
1015{
1016 PDMDEV_ASSERT_DEVINS(pDevIns);
1017 RT_NOREF(pDevIns);
1018 AssertFailed();
1019 return 0; //PDMCritSectRwGetReadCount(pCritSect);
1020}
1021
1022
1023/** @interface_method_impl{PDMDEVHLPR0,pfnCritSectRwIsInitialized} */
1024static DECLCALLBACK(bool) pdmR0DevHlp_CritSectRwIsInitialized(PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect)
1025{
1026 PDMDEV_ASSERT_DEVINS(pDevIns);
1027 RT_NOREF(pDevIns);
1028 AssertFailed();
1029 return false; //PDMCritSectRwIsInitialized(pCritSect);
1030}
1031
1032
1033/** @interface_method_impl{PDMDEVHLPR0,pfnDBGFTraceBuf} */
1034static DECLCALLBACK(RTTRACEBUF) pdmR0DevHlp_DBGFTraceBuf(PPDMDEVINS pDevIns)
1035{
1036 PDMDEV_ASSERT_DEVINS(pDevIns);
1037 AssertFailed();
1038 RTTRACEBUF hTraceBuf = NULL; //pDevIns->Internal.s.pGVM->hTraceBufR0;
1039 LogFlow(("pdmR0DevHlp_DBGFTraceBuf: caller='%p'/%d: returns %p\n", pDevIns, pDevIns->iInstance, hTraceBuf));
1040 return hTraceBuf;
1041}
1042
1043
1044/** @interface_method_impl{PDMDEVHLPR0,pfnPCIBusSetUpContext} */
1045static DECLCALLBACK(int) pdmR0DevHlp_PCIBusSetUpContext(PPDMDEVINS pDevIns, PPDMPCIBUSREGR0 pPciBusReg, PCPDMPCIHLPR0 *ppPciHlp)
1046{
1047 PDMDEV_ASSERT_DEVINS(pDevIns);
1048 LogFlow(("pdmR0DevHlp_PCIBusSetUpContext: caller='%p'/%d: pPciBusReg=%p{.u32Version=%#x, .iBus=%#u, .pfnSetIrq=%p, u32EnvVersion=%#x} ppPciHlp=%p\n",
1049 pDevIns, pDevIns->iInstance, pPciBusReg, pPciBusReg->u32Version, pPciBusReg->iBus, pPciBusReg->pfnSetIrq,
1050 pPciBusReg->u32EndVersion, ppPciHlp));
1051#if 0
1052 PGVM pGVM = pDevIns->Internal.s.pGVM;
1053
1054 /*
1055 * Validate input.
1056 */
1057 AssertPtrReturn(pPciBusReg, VERR_INVALID_POINTER);
1058 AssertLogRelMsgReturn(pPciBusReg->u32Version == PDM_PCIBUSREGCC_VERSION,
1059 ("%#x vs %#x\n", pPciBusReg->u32Version, PDM_PCIBUSREGCC_VERSION), VERR_VERSION_MISMATCH);
1060 AssertPtrReturn(pPciBusReg->pfnSetIrq, VERR_INVALID_POINTER);
1061 AssertLogRelMsgReturn(pPciBusReg->u32EndVersion == PDM_PCIBUSREGCC_VERSION,
1062 ("%#x vs %#x\n", pPciBusReg->u32EndVersion, PDM_PCIBUSREGCC_VERSION), VERR_VERSION_MISMATCH);
1063
1064 AssertPtrReturn(ppPciHlp, VERR_INVALID_POINTER);
1065
1066 VM_ASSERT_STATE_RETURN(pGVM, VMSTATE_CREATING, VERR_WRONG_ORDER);
1067 VM_ASSERT_EMT0_RETURN(pGVM, VERR_VM_THREAD_NOT_EMT);
1068
1069 /* Check the shared bus data (registered earlier from ring-3): */
1070 uint32_t iBus = pPciBusReg->iBus;
1071 ASMCompilerBarrier();
1072 AssertLogRelMsgReturn(iBus < RT_ELEMENTS(pGVM->pdm.s.aPciBuses), ("iBus=%#x\n", iBus), VERR_OUT_OF_RANGE);
1073 PPDMPCIBUS pPciBusShared = &pGVM->pdm.s.aPciBuses[iBus];
1074 AssertLogRelMsgReturn(pPciBusShared->iBus == iBus, ("%u vs %u\n", pPciBusShared->iBus, iBus), VERR_INVALID_PARAMETER);
1075 AssertLogRelMsgReturn(pPciBusShared->pDevInsR3 == pDevIns->pDevInsForR3,
1076 ("%p vs %p (iBus=%u)\n", pPciBusShared->pDevInsR3, pDevIns->pDevInsForR3, iBus), VERR_NOT_OWNER);
1077
1078 /* Check that the bus isn't already registered in ring-0: */
1079 AssertCompile(RT_ELEMENTS(pGVM->pdm.s.aPciBuses) == RT_ELEMENTS(pGVM->pdmr0.s.aPciBuses));
1080 PPDMPCIBUSR0 pPciBusR0 = &pGVM->pdmr0.s.aPciBuses[iBus];
1081 AssertLogRelMsgReturn(pPciBusR0->pDevInsR0 == NULL,
1082 ("%p (caller pDevIns=%p, iBus=%u)\n", pPciBusR0->pDevInsR0, pDevIns, iBus),
1083 VERR_ALREADY_EXISTS);
1084
1085 /*
1086 * Do the registering.
1087 */
1088 pPciBusR0->iBus = iBus;
1089 pPciBusR0->uPadding0 = 0xbeefbeef;
1090 pPciBusR0->pfnSetIrqR0 = pPciBusReg->pfnSetIrq;
1091 pPciBusR0->pDevInsR0 = pDevIns;
1092#endif
1093
1094 AssertFailed();
1095 *ppPciHlp = NULL; //&g_pdmR0PciHlp;
1096
1097 LogFlow(("pdmR0DevHlp_PCIBusSetUpContext: caller='%p'/%d: returns VINF_SUCCESS\n", pDevIns, pDevIns->iInstance));
1098 return VINF_SUCCESS;
1099}
1100
1101
1102/** @interface_method_impl{PDMDEVHLPR0,pfnIommuSetUpContext} */
1103static DECLCALLBACK(int) pdmR0DevHlp_IommuSetUpContext(PPDMDEVINS pDevIns, PPDMIOMMUREGR0 pIommuReg, PCPDMIOMMUHLPR0 *ppIommuHlp)
1104{
1105 PDMDEV_ASSERT_DEVINS(pDevIns);
1106 LogFlow(("pdmR0DevHlp_IommuSetUpContext: caller='%p'/%d: pIommuReg=%p{.u32Version=%#x, u32TheEnd=%#x} ppIommuHlp=%p\n",
1107 pDevIns, pDevIns->iInstance, pIommuReg, pIommuReg->u32Version, pIommuReg->u32TheEnd, ppIommuHlp));
1108#if 0
1109 PGVM pGVM = pDevIns->Internal.s.pGVM;
1110
1111 /*
1112 * Validate input.
1113 */
1114 AssertPtrReturn(pIommuReg, VERR_INVALID_POINTER);
1115 AssertLogRelMsgReturn(pIommuReg->u32Version == PDM_IOMMUREGCC_VERSION,
1116 ("%#x vs %#x\n", pIommuReg->u32Version, PDM_IOMMUREGCC_VERSION), VERR_VERSION_MISMATCH);
1117 AssertPtrReturn(pIommuReg->pfnMemAccess, VERR_INVALID_POINTER);
1118 AssertPtrReturn(pIommuReg->pfnMemBulkAccess, VERR_INVALID_POINTER);
1119 AssertPtrReturn(pIommuReg->pfnMsiRemap, VERR_INVALID_POINTER);
1120 AssertLogRelMsgReturn(pIommuReg->u32TheEnd == PDM_IOMMUREGCC_VERSION,
1121 ("%#x vs %#x\n", pIommuReg->u32TheEnd, PDM_IOMMUREGCC_VERSION), VERR_VERSION_MISMATCH);
1122
1123 AssertPtrReturn(ppIommuHlp, VERR_INVALID_POINTER);
1124
1125 VM_ASSERT_STATE_RETURN(pGVM, VMSTATE_CREATING, VERR_WRONG_ORDER);
1126 VM_ASSERT_EMT0_RETURN(pGVM, VERR_VM_THREAD_NOT_EMT);
1127
1128 /* Check the IOMMU shared data (registered earlier from ring-3). */
1129 uint32_t const idxIommu = pIommuReg->idxIommu;
1130 ASMCompilerBarrier();
1131 AssertLogRelMsgReturn(idxIommu < RT_ELEMENTS(pGVM->pdm.s.aIommus), ("idxIommu=%#x\n", idxIommu), VERR_OUT_OF_RANGE);
1132 PPDMIOMMUR3 pIommuShared = &pGVM->pdm.s.aIommus[idxIommu];
1133 AssertLogRelMsgReturn(pIommuShared->idxIommu == idxIommu, ("%u vs %u\n", pIommuShared->idxIommu, idxIommu), VERR_INVALID_PARAMETER);
1134 AssertLogRelMsgReturn(pIommuShared->pDevInsR3 == pDevIns->pDevInsForR3,
1135 ("%p vs %p (idxIommu=%u)\n", pIommuShared->pDevInsR3, pDevIns->pDevInsForR3, idxIommu), VERR_NOT_OWNER);
1136
1137 /* Check that the IOMMU isn't already registered in ring-0. */
1138 AssertCompile(RT_ELEMENTS(pGVM->pdm.s.aIommus) == RT_ELEMENTS(pGVM->pdmr0.s.aIommus));
1139 PPDMIOMMUR0 pIommuR0 = &pGVM->pdmr0.s.aIommus[idxIommu];
1140 AssertLogRelMsgReturn(pIommuR0->pDevInsR0 == NULL,
1141 ("%p (caller pDevIns=%p, idxIommu=%u)\n", pIommuR0->pDevInsR0, pDevIns, idxIommu),
1142 VERR_ALREADY_EXISTS);
1143
1144 /*
1145 * Register.
1146 */
1147 pIommuR0->idxIommu = idxIommu;
1148 pIommuR0->uPadding0 = 0xdeaddead;
1149 pIommuR0->pDevInsR0 = pDevIns;
1150 pIommuR0->pfnMemAccess = pIommuReg->pfnMemAccess;
1151 pIommuR0->pfnMemBulkAccess = pIommuReg->pfnMemBulkAccess;
1152 pIommuR0->pfnMsiRemap = pIommuReg->pfnMsiRemap;
1153#endif
1154
1155 AssertFailed();
1156 *ppIommuHlp = NULL; //&g_pdmR0IommuHlp;
1157
1158 LogFlow(("pdmR0DevHlp_IommuSetUpContext: caller='%p'/%d: returns VINF_SUCCESS\n", pDevIns, pDevIns->iInstance));
1159 return VINF_SUCCESS;
1160}
1161
1162
1163/** @interface_method_impl{PDMDEVHLPR0,pfnPICSetUpContext} */
1164static DECLCALLBACK(int) pdmR0DevHlp_PICSetUpContext(PPDMDEVINS pDevIns, PPDMPICREG pPicReg, PCPDMPICHLP *ppPicHlp)
1165{
1166 PDMDEV_ASSERT_DEVINS(pDevIns);
1167 LogFlow(("pdmR0DevHlp_PICSetUpContext: caller='%s'/%d: pPicReg=%p:{.u32Version=%#x, .pfnSetIrq=%p, .pfnGetInterrupt=%p, .u32TheEnd=%#x } ppPicHlp=%p\n",
1168 pDevIns->pReg->szName, pDevIns->iInstance, pPicReg, pPicReg->u32Version, pPicReg->pfnSetIrq, pPicReg->pfnGetInterrupt, pPicReg->u32TheEnd, ppPicHlp));
1169#if 0
1170 PGVM pGVM = pDevIns->Internal.s.pGVM;
1171
1172 /*
1173 * Validate input.
1174 */
1175 AssertMsgReturn(pPicReg->u32Version == PDM_PICREG_VERSION,
1176 ("%s/%d: u32Version=%#x expected %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, pPicReg->u32Version, PDM_PICREG_VERSION),
1177 VERR_VERSION_MISMATCH);
1178 AssertPtrReturn(pPicReg->pfnSetIrq, VERR_INVALID_POINTER);
1179 AssertPtrReturn(pPicReg->pfnGetInterrupt, VERR_INVALID_POINTER);
1180 AssertMsgReturn(pPicReg->u32TheEnd == PDM_PICREG_VERSION,
1181 ("%s/%d: u32TheEnd=%#x expected %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, pPicReg->u32TheEnd, PDM_PICREG_VERSION),
1182 VERR_VERSION_MISMATCH);
1183 AssertPtrReturn(ppPicHlp, VERR_INVALID_POINTER);
1184
1185 VM_ASSERT_STATE_RETURN(pGVM, VMSTATE_CREATING, VERR_WRONG_ORDER);
1186 VM_ASSERT_EMT0_RETURN(pGVM, VERR_VM_THREAD_NOT_EMT);
1187
1188 /* Check that it's the same device as made the ring-3 registrations: */
1189 AssertLogRelMsgReturn(pGVM->pdm.s.Pic.pDevInsR3 == pDevIns->pDevInsForR3,
1190 ("%p vs %p\n", pGVM->pdm.s.Pic.pDevInsR3, pDevIns->pDevInsForR3), VERR_NOT_OWNER);
1191
1192 /* Check that it isn't already registered in ring-0: */
1193 AssertLogRelMsgReturn(pGVM->pdm.s.Pic.pDevInsR0 == NULL, ("%p (caller pDevIns=%p)\n", pGVM->pdm.s.Pic.pDevInsR0, pDevIns),
1194 VERR_ALREADY_EXISTS);
1195
1196 /*
1197 * Take down the callbacks and instance.
1198 */
1199 pGVM->pdm.s.Pic.pDevInsR0 = pDevIns;
1200 pGVM->pdm.s.Pic.pfnSetIrqR0 = pPicReg->pfnSetIrq;
1201 pGVM->pdm.s.Pic.pfnGetInterruptR0 = pPicReg->pfnGetInterrupt;
1202#endif
1203 Log(("PDM: Registered PIC device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
1204
1205 /* set the helper pointer and return. */
1206 AssertFailed();
1207 *ppPicHlp = NULL; //&g_pdmR0PicHlp;
1208 LogFlow(("pdmR0DevHlp_PICSetUpContext: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
1209 return VINF_SUCCESS;
1210}
1211
1212
1213/** @interface_method_impl{PDMDEVHLPR0,pfnApicSetUpContext} */
1214static DECLCALLBACK(int) pdmR0DevHlp_ApicSetUpContext(PPDMDEVINS pDevIns)
1215{
1216 PDMDEV_ASSERT_DEVINS(pDevIns);
1217 LogFlow(("pdmR0DevHlp_ApicSetUpContext: caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance));
1218#if 0
1219 PGVM pGVM = pDevIns->Internal.s.pGVM;
1220
1221 /*
1222 * Validate input.
1223 */
1224 VM_ASSERT_STATE_RETURN(pGVM, VMSTATE_CREATING, VERR_WRONG_ORDER);
1225 VM_ASSERT_EMT0_RETURN(pGVM, VERR_VM_THREAD_NOT_EMT);
1226
1227 /* Check that it's the same device as made the ring-3 registrations: */
1228 AssertLogRelMsgReturn(pGVM->pdm.s.Apic.pDevInsR3 == pDevIns->pDevInsForR3,
1229 ("%p vs %p\n", pGVM->pdm.s.Apic.pDevInsR3, pDevIns->pDevInsForR3), VERR_NOT_OWNER);
1230
1231 /* Check that it isn't already registered in ring-0: */
1232 AssertLogRelMsgReturn(pGVM->pdm.s.Apic.pDevInsR0 == NULL, ("%p (caller pDevIns=%p)\n", pGVM->pdm.s.Apic.pDevInsR0, pDevIns),
1233 VERR_ALREADY_EXISTS);
1234
1235 /*
1236 * Take down the instance.
1237 */
1238 pGVM->pdm.s.Apic.pDevInsR0 = pDevIns;
1239#endif
1240 Log(("PDM: Registered APIC device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
1241
1242 /* set the helper pointer and return. */
1243 LogFlow(("pdmR0DevHlp_ApicSetUpContext: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
1244 return VINF_SUCCESS;
1245}
1246
1247
1248/** @interface_method_impl{PDMDEVHLPR0,pfnIoApicSetUpContext} */
1249static DECLCALLBACK(int) pdmR0DevHlp_IoApicSetUpContext(PPDMDEVINS pDevIns, PPDMIOAPICREG pIoApicReg, PCPDMIOAPICHLP *ppIoApicHlp)
1250{
1251 PDMDEV_ASSERT_DEVINS(pDevIns);
1252 LogFlow(("pdmR0DevHlp_IoApicSetUpContext: caller='%s'/%d: pIoApicReg=%p:{.u32Version=%#x, .pfnSetIrq=%p, .pfnSendMsi=%p, .pfnSetEoi=%p, .u32TheEnd=%#x } ppIoApicHlp=%p\n",
1253 pDevIns->pReg->szName, pDevIns->iInstance, pIoApicReg, pIoApicReg->u32Version, pIoApicReg->pfnSetIrq, pIoApicReg->pfnSendMsi, pIoApicReg->pfnSetEoi, pIoApicReg->u32TheEnd, ppIoApicHlp));
1254#if 0
1255 PGVM pGVM = pDevIns->Internal.s.pGVM;
1256
1257 /*
1258 * Validate input.
1259 */
1260 AssertMsgReturn(pIoApicReg->u32Version == PDM_IOAPICREG_VERSION,
1261 ("%s/%d: u32Version=%#x expected %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, pIoApicReg->u32Version, PDM_IOAPICREG_VERSION),
1262 VERR_VERSION_MISMATCH);
1263 AssertPtrReturn(pIoApicReg->pfnSetIrq, VERR_INVALID_POINTER);
1264 AssertPtrReturn(pIoApicReg->pfnSendMsi, VERR_INVALID_POINTER);
1265 AssertPtrReturn(pIoApicReg->pfnSetEoi, VERR_INVALID_POINTER);
1266 AssertMsgReturn(pIoApicReg->u32TheEnd == PDM_IOAPICREG_VERSION,
1267 ("%s/%d: u32TheEnd=%#x expected %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, pIoApicReg->u32TheEnd, PDM_IOAPICREG_VERSION),
1268 VERR_VERSION_MISMATCH);
1269 AssertPtrReturn(ppIoApicHlp, VERR_INVALID_POINTER);
1270
1271 VM_ASSERT_STATE_RETURN(pGVM, VMSTATE_CREATING, VERR_WRONG_ORDER);
1272 VM_ASSERT_EMT0_RETURN(pGVM, VERR_VM_THREAD_NOT_EMT);
1273
1274 /* Check that it's the same device as made the ring-3 registrations: */
1275 AssertLogRelMsgReturn(pGVM->pdm.s.IoApic.pDevInsR3 == pDevIns->pDevInsForR3,
1276 ("%p vs %p\n", pGVM->pdm.s.IoApic.pDevInsR3, pDevIns->pDevInsForR3), VERR_NOT_OWNER);
1277
1278 /* Check that it isn't already registered in ring-0: */
1279 AssertLogRelMsgReturn(pGVM->pdm.s.IoApic.pDevInsR0 == NULL, ("%p (caller pDevIns=%p)\n", pGVM->pdm.s.IoApic.pDevInsR0, pDevIns),
1280 VERR_ALREADY_EXISTS);
1281
1282 /*
1283 * Take down the callbacks and instance.
1284 */
1285 pGVM->pdm.s.IoApic.pDevInsR0 = pDevIns;
1286 pGVM->pdm.s.IoApic.pfnSetIrqR0 = pIoApicReg->pfnSetIrq;
1287 pGVM->pdm.s.IoApic.pfnSendMsiR0 = pIoApicReg->pfnSendMsi;
1288 pGVM->pdm.s.IoApic.pfnSetEoiR0 = pIoApicReg->pfnSetEoi;
1289#endif
1290 Log(("PDM: Registered IOAPIC device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
1291
1292 /* set the helper pointer and return. */
1293 AssertFailed();
1294 *ppIoApicHlp = NULL; //&g_pdmR0IoApicHlp;
1295 LogFlow(("pdmR0DevHlp_IoApicSetUpContext: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
1296 return VINF_SUCCESS;
1297}
1298
1299
1300/** @interface_method_impl{PDMDEVHLPR0,pfnHpetSetUpContext} */
1301static DECLCALLBACK(int) pdmR0DevHlp_HpetSetUpContext(PPDMDEVINS pDevIns, PPDMHPETREG pHpetReg, PCPDMHPETHLPR0 *ppHpetHlp)
1302{
1303 PDMDEV_ASSERT_DEVINS(pDevIns);
1304 LogFlow(("pdmR0DevHlp_HpetSetUpContext: caller='%s'/%d: pHpetReg=%p:{.u32Version=%#x, } ppHpetHlp=%p\n",
1305 pDevIns->pReg->szName, pDevIns->iInstance, pHpetReg, pHpetReg->u32Version, ppHpetHlp));
1306#if 0
1307 PGVM pGVM = pDevIns->Internal.s.pGVM;
1308
1309 /*
1310 * Validate input.
1311 */
1312 AssertMsgReturn(pHpetReg->u32Version == PDM_HPETREG_VERSION,
1313 ("%s/%d: u32Version=%#x expected %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, pHpetReg->u32Version, PDM_HPETREG_VERSION),
1314 VERR_VERSION_MISMATCH);
1315 AssertPtrReturn(ppHpetHlp, VERR_INVALID_POINTER);
1316
1317 VM_ASSERT_STATE_RETURN(pGVM, VMSTATE_CREATING, VERR_WRONG_ORDER);
1318 VM_ASSERT_EMT0_RETURN(pGVM, VERR_VM_THREAD_NOT_EMT);
1319
1320 /* Check that it's the same device as made the ring-3 registrations: */
1321 AssertLogRelMsgReturn(pGVM->pdm.s.pHpet == pDevIns->pDevInsForR3, ("%p vs %p\n", pGVM->pdm.s.pHpet, pDevIns->pDevInsForR3),
1322 VERR_NOT_OWNER);
1323
1324 ///* Check that it isn't already registered in ring-0: */
1325 //AssertLogRelMsgReturn(pGVM->pdm.s.Hpet.pDevInsR0 == NULL, ("%p (caller pDevIns=%p)\n", pGVM->pdm.s.Hpet.pDevInsR0, pDevIns),
1326 // VERR_ALREADY_EXISTS);
1327#endif
1328 /*
1329 * Nothing to take down here at present.
1330 */
1331 Log(("PDM: Registered HPET device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
1332
1333 /* set the helper pointer and return. */
1334 AssertFailed();
1335 *ppHpetHlp = NULL; //&g_pdmR0HpetHlp;
1336 LogFlow(("pdmR0DevHlp_HpetSetUpContext: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
1337 return VINF_SUCCESS;
1338}
1339
1340
1341/** @interface_method_impl{PDMDEVHLPR0,pfnPGMHandlerPhysicalPageTempOff} */
1342static DECLCALLBACK(int) pdmR0DevHlp_PGMHandlerPhysicalPageTempOff(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPHYS GCPhysPage)
1343{
1344 PDMDEV_ASSERT_DEVINS(pDevIns);
1345 LogFlow(("pdmR0DevHlp_PGMHandlerPhysicalPageTempOff: caller='%s'/%d: GCPhys=%RGp\n", pDevIns->pReg->szName, pDevIns->iInstance, GCPhys));
1346
1347 AssertFailed();
1348 int rc = VERR_NOT_IMPLEMENTED; //PGMHandlerPhysicalPageTempOff(pDevIns->Internal.s.pGVM, GCPhys, GCPhysPage);
1349
1350 Log(("pdmR0DevHlp_PGMHandlerPhysicalPageTempOff: caller='%s'/%d: returns %Rrc\n",
1351 pDevIns->pReg->szName, pDevIns->iInstance, rc));
1352 return rc;
1353}
1354
1355
1356/** @interface_method_impl{PDMDEVHLPR0,pfnMmioMapMmio2Page} */
1357static DECLCALLBACK(int) pdmR0DevHlp_MmioMapMmio2Page(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion,
1358 uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags)
1359{
1360 PDMDEV_ASSERT_DEVINS(pDevIns);
1361 LogFlow(("pdmR0DevHlp_MmioMapMmio2Page: caller='%s'/%d: hRegion=%RX64 offRegion=%RGp hMmio2=%RX64 offMmio2=%RGp fPageFlags=%RX64\n",
1362 pDevIns->pReg->szName, pDevIns->iInstance, hRegion, offRegion, hMmio2, offMmio2, fPageFlags));
1363
1364 AssertFailed();
1365 int rc = VERR_NOT_IMPLEMENTED; //IOMMmioMapMmio2Page(pDevIns->Internal.s.pGVM, pDevIns, hRegion, offRegion, hMmio2, offMmio2, fPageFlags);
1366
1367 Log(("pdmR0DevHlp_MmioMapMmio2Page: caller='%s'/%d: returns %Rrc\n",
1368 pDevIns->pReg->szName, pDevIns->iInstance, rc));
1369 return rc;
1370}
1371
1372
1373/** @interface_method_impl{PDMDEVHLPR0,pfnMmioResetRegion} */
1374static DECLCALLBACK(int) pdmR0DevHlp_MmioResetRegion(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion)
1375{
1376 PDMDEV_ASSERT_DEVINS(pDevIns);
1377 LogFlow(("pdmR0DevHlp_MmioResetRegion: caller='%s'/%d: hRegion=%RX64\n",
1378 pDevIns->pReg->szName, pDevIns->iInstance, hRegion));
1379
1380 AssertFailed();
1381 int rc = VERR_NOT_IMPLEMENTED; //IOMMmioResetRegion(pDevIns->Internal.s.pGVM, pDevIns, hRegion);
1382
1383 Log(("pdmR0DevHlp_MmioResetRegion: caller='%s'/%d: returns %Rrc\n",
1384 pDevIns->pReg->szName, pDevIns->iInstance, rc));
1385 return rc;
1386}
1387
1388
1389/** @interface_method_impl{PDMDEVHLPR0,pfnGIMGetMmio2Regions} */
1390static DECLCALLBACK(PGIMMMIO2REGION) pdmR0DevHlp_GIMGetMmio2Regions(PPDMDEVINS pDevIns, uint32_t *pcRegions)
1391{
1392 PDMDEV_ASSERT_DEVINS(pDevIns);
1393
1394 LogFlow(("pdmR0DevHlp_GIMGetMmio2Regions: caller='%s'/%d: pcRegions=%p\n",
1395 pDevIns->pReg->szName, pDevIns->iInstance, pcRegions));
1396
1397 AssertFailed();
1398 PGIMMMIO2REGION pRegion = NULL; //GIMGetMmio2Regions(pDevIns->Internal.s.pGVM, pcRegions);
1399
1400 LogFlow(("pdmR0DevHlp_GIMGetMmio2Regions: caller='%s'/%d: returns %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pRegion));
1401 return pRegion;
1402}
1403
1404
1405/**
1406 * The Ring-0 Device Helper Callbacks.
1407 */
1408const PDMDEVHLPR0 g_tstDevPdmDevHlpR0 =
1409{
1410 PDM_DEVHLPR0_VERSION,
1411 pdmR0DevHlp_IoPortSetUpContextEx,
1412 pdmR0DevHlp_MmioSetUpContextEx,
1413 pdmR0DevHlp_Mmio2SetUpContext,
1414 pdmR0DevHlp_PCIPhysRead,
1415 pdmR0DevHlp_PCIPhysWrite,
1416 pdmR0DevHlp_PCISetIrq,
1417 pdmR0DevHlp_ISASetIrq,
1418 pdmR0DevHlp_PhysRead,
1419 pdmR0DevHlp_PhysWrite,
1420 pdmR0DevHlp_A20IsEnabled,
1421 pdmR0DevHlp_VMState,
1422 pdmR0DevHlp_GetVM,
1423 pdmR0DevHlp_GetVMCPU,
1424 pdmR0DevHlp_GetCurrentCpuId,
1425 pdmR0DevHlp_GetMainExecutionEngine,
1426 pdmR0DevHlp_TimerFromMicro,
1427 pdmR0DevHlp_TimerFromMilli,
1428 pdmR0DevHlp_TimerFromNano,
1429 pdmR0DevHlp_TimerGet,
1430 pdmR0DevHlp_TimerGetFreq,
1431 pdmR0DevHlp_TimerGetNano,
1432 pdmR0DevHlp_TimerIsActive,
1433 pdmR0DevHlp_TimerIsLockOwner,
1434 pdmR0DevHlp_TimerLockClock,
1435 pdmR0DevHlp_TimerLockClock2,
1436 pdmR0DevHlp_TimerSet,
1437 pdmR0DevHlp_TimerSetFrequencyHint,
1438 pdmR0DevHlp_TimerSetMicro,
1439 pdmR0DevHlp_TimerSetMillies,
1440 pdmR0DevHlp_TimerSetNano,
1441 pdmR0DevHlp_TimerSetRelative,
1442 pdmR0DevHlp_TimerStop,
1443 pdmR0DevHlp_TimerUnlockClock,
1444 pdmR0DevHlp_TimerUnlockClock2,
1445 pdmR0DevHlp_TMTimeVirtGet,
1446 pdmR0DevHlp_TMTimeVirtGetFreq,
1447 pdmR0DevHlp_TMTimeVirtGetNano,
1448 pdmR0DevHlp_QueueAlloc,
1449 pdmR0DevHlp_QueueInsert,
1450 pdmR0DevHlp_QueueFlushIfNecessary,
1451 pdmR0DevHlp_TaskTrigger,
1452 pdmR0DevHlp_SUPSemEventSignal,
1453 pdmR0DevHlp_SUPSemEventWaitNoResume,
1454 pdmR0DevHlp_SUPSemEventWaitNsAbsIntr,
1455 pdmR0DevHlp_SUPSemEventWaitNsRelIntr,
1456 pdmR0DevHlp_SUPSemEventGetResolution,
1457 pdmR0DevHlp_SUPSemEventMultiSignal,
1458 pdmR0DevHlp_SUPSemEventMultiReset,
1459 pdmR0DevHlp_SUPSemEventMultiWaitNoResume,
1460 pdmR0DevHlp_SUPSemEventMultiWaitNsAbsIntr,
1461 pdmR0DevHlp_SUPSemEventMultiWaitNsRelIntr,
1462 pdmR0DevHlp_SUPSemEventMultiGetResolution,
1463 pdmR0DevHlp_CritSectGetNop,
1464 pdmR0DevHlp_SetDeviceCritSect,
1465 pdmR0DevHlp_CritSectEnter,
1466 pdmR0DevHlp_CritSectEnterDebug,
1467 pdmR0DevHlp_CritSectTryEnter,
1468 pdmR0DevHlp_CritSectTryEnterDebug,
1469 pdmR0DevHlp_CritSectLeave,
1470 pdmR0DevHlp_CritSectIsOwner,
1471 pdmR0DevHlp_CritSectIsInitialized,
1472 pdmR0DevHlp_CritSectHasWaiters,
1473 pdmR0DevHlp_CritSectGetRecursion,
1474 pdmR0DevHlp_CritSectScheduleExitEvent,
1475 pdmR0DevHlp_CritSectRwEnterShared,
1476 pdmR0DevHlp_CritSectRwEnterSharedDebug,
1477 pdmR0DevHlp_CritSectRwTryEnterShared,
1478 pdmR0DevHlp_CritSectRwTryEnterSharedDebug,
1479 pdmR0DevHlp_CritSectRwLeaveShared,
1480 pdmR0DevHlp_CritSectRwEnterExcl,
1481 pdmR0DevHlp_CritSectRwEnterExclDebug,
1482 pdmR0DevHlp_CritSectRwTryEnterExcl,
1483 pdmR0DevHlp_CritSectRwTryEnterExclDebug,
1484 pdmR0DevHlp_CritSectRwLeaveExcl,
1485 pdmR0DevHlp_CritSectRwIsWriteOwner,
1486 pdmR0DevHlp_CritSectRwIsReadOwner,
1487 pdmR0DevHlp_CritSectRwGetWriteRecursion,
1488 pdmR0DevHlp_CritSectRwGetWriterReadRecursion,
1489 pdmR0DevHlp_CritSectRwGetReadCount,
1490 pdmR0DevHlp_CritSectRwIsInitialized,
1491 pdmR0DevHlp_DBGFTraceBuf,
1492 pdmR0DevHlp_PCIBusSetUpContext,
1493 pdmR0DevHlp_IommuSetUpContext,
1494 pdmR0DevHlp_PICSetUpContext,
1495 pdmR0DevHlp_ApicSetUpContext,
1496 pdmR0DevHlp_IoApicSetUpContext,
1497 pdmR0DevHlp_HpetSetUpContext,
1498 pdmR0DevHlp_PGMHandlerPhysicalPageTempOff,
1499 pdmR0DevHlp_MmioMapMmio2Page,
1500 pdmR0DevHlp_MmioResetRegion,
1501 pdmR0DevHlp_GIMGetMmio2Regions,
1502 NULL /*pfnReserved1*/,
1503 NULL /*pfnReserved2*/,
1504 NULL /*pfnReserved3*/,
1505 NULL /*pfnReserved4*/,
1506 NULL /*pfnReserved5*/,
1507 NULL /*pfnReserved6*/,
1508 NULL /*pfnReserved7*/,
1509 NULL /*pfnReserved8*/,
1510 NULL /*pfnReserved9*/,
1511 NULL /*pfnReserved10*/,
1512 PDM_DEVHLPR0_VERSION
1513};
Note: See TracBrowser for help on using the repository browser.

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