VirtualBox

source: vbox/trunk/src/VBox/Devices/testcase/tstDeviceVMMStubs.cpp@ 69288

Last change on this file since 69288 was 69183, checked in by vboxsync, 7 years ago

Devices/testcase: Updates for the PDM unit test framework

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.2 KB
Line 
1/* $Id: tstDeviceVMMStubs.cpp 69183 2017-10-23 18:47:18Z vboxsync $ */
2/** @file
3 * tstDevice - Test framework for PDM devices/drivers, shim library exporting methods
4 * originally for VBoxVMM for intercepting (we don't want to use the PDM module
5 * to use the originals from VBoxVMM).
6 */
7
8/*
9 * Copyright (C) 2017 Oracle Corporation
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 */
19/* Methods imported from VBoxVMM by VBoxDD are extracted with:
20 * objdump -T VBoxDD.so | grep "UND" | awk -F ' ' '{print $5}' | grep -E "^TM|^PGM|^PDM|^CFGM|^IOM|^MM|^VM|^PDM|^SUP" | sort
21 */
22
23/*********************************************************************************************************************************
24* Header Files *
25*********************************************************************************************************************************/
26#define LOG_GROUP LOG_GROUP_DEFAULT /** @todo */
27#include <iprt/assert.h>
28#include <iprt/mem.h>
29
30#include <VBox/err.h>
31#include <VBox/cdefs.h>
32
33#include "tstDeviceVMMInternal.h"
34
35/*********************************************************************************************************************************
36* Defined Constants And Macros *
37*********************************************************************************************************************************/
38
39
40/*********************************************************************************************************************************
41* Structures and Typedefs *
42*********************************************************************************************************************************/
43
44
45/*********************************************************************************************************************************
46* Global Variables *
47*********************************************************************************************************************************/
48
49
50/*********************************************************************************************************************************
51* Internal Functions *
52*********************************************************************************************************************************/
53
54
55/**
56 * @copydoc CFGMR3AreValuesValid
57 */
58VMMR3DECL(bool) CFGMR3AreValuesValid(PCFGMNODE pNode, const char *pszzValid)
59{
60 return pNode->pVmmCallbacks->pfnCFGMR3AreValuesValid(pNode, pszzValid);
61}
62
63
64/**
65 * @copydoc CFGMR3Dump
66 */
67VMMR3DECL(void) CFGMR3Dump(PCFGMNODE pRoot)
68{
69 pRoot->pVmmCallbacks->pfnCFGMR3Dump(pRoot);
70}
71
72
73/**
74 * @copydoc CFGMR3GetChild
75 */
76VMMR3DECL(PCFGMNODE) CFGMR3GetChild(PCFGMNODE pNode, const char *pszPath)
77{
78 return pNode->pVmmCallbacks->pfnCFGMR3GetChild(pNode, pszPath);
79}
80
81
82/**
83 * @copydoc CFGMR3GetChildF
84 */
85VMMR3DECL(PCFGMNODE) CFGMR3GetChildF(PCFGMNODE pNode, const char *pszPathFormat, ...) RT_IPRT_FORMAT_ATTR(2, 3)
86{
87 va_list Args;
88 va_start(Args, pszPathFormat);
89 PCFGMNODE pChild = pNode->pVmmCallbacks->pfnCFGMR3GetChildFV(pNode, pszPathFormat, Args);
90 va_end(Args);
91
92 return pChild;
93}
94
95
96/**
97 * @copydoc CFGMR3GetFirstChild
98 */
99VMMR3DECL(PCFGMNODE) CFGMR3GetFirstChild(PCFGMNODE pNode)
100{
101 return pNode->pVmmCallbacks->pfnCFGMR3GetFirstChild(pNode);
102}
103
104
105/**
106 * @copydoc CFGMR3GetName
107 */
108VMMR3DECL(int) CFGMR3GetName(PCFGMNODE pCur, char *pszName, size_t cchName)
109{
110 return pCur->pVmmCallbacks->pfnCFGMR3GetName(pCur, pszName, cchName);
111}
112
113
114/**
115 * @copydoc CFGMR3GetFirstChild
116 */
117VMMR3DECL(PCFGMNODE) CFGMR3GetNextChild(PCFGMNODE pNode)
118{
119 return pNode->pVmmCallbacks->pfnCFGMR3GetNextChild(pNode);
120}
121
122
123/**
124 * @copydoc CFGMR3GetParent
125 */
126VMMR3DECL(PCFGMNODE) CFGMR3GetParent(PCFGMNODE pNode)
127{
128 return pNode->pVmmCallbacks->pfnCFGMR3GetParent(pNode);
129}
130
131
132/**
133 * @copydoc CFGMR3GetRoot
134 */
135VMMR3DECL(PCFGMNODE) CFGMR3GetRoot(PVM pVM)
136{
137 return pVM->vm.s.pVmmCallbacks->pfnCFGMR3GetRoot(pVM);
138}
139
140
141/**
142 * @copydoc CFGMR3InsertNode
143 */
144VMMR3DECL(int) CFGMR3InsertNode(PCFGMNODE pNode, const char *pszName, PCFGMNODE *ppChild)
145{
146 return pNode->pVmmCallbacks->pfnCFGMR3InsertNode(pNode, pszName, ppChild);
147}
148
149
150/**
151 * @copydoc CFGMR3InsertNodeF
152 */
153VMMR3DECL(int) CFGMR3InsertNodeF(PCFGMNODE pNode, PCFGMNODE *ppChild,
154 const char *pszNameFormat, ...) RT_IPRT_FORMAT_ATTR(3, 4)
155{
156 va_list Args;
157 va_start(Args, pszNameFormat);
158 int rc = pNode->pVmmCallbacks->pfnCFGMR3InsertNodeFV(pNode, ppChild, pszNameFormat, Args);
159 va_end(Args);
160
161 return rc;
162}
163
164
165/**
166 * @copydoc CFGMR3InsertString
167 */
168VMMR3DECL(int) CFGMR3InsertString(PCFGMNODE pNode, const char *pszName, const char *pszString)
169{
170 return pNode->pVmmCallbacks->pfnCFGMR3InsertString(pNode, pszName, pszString);
171}
172
173
174/**
175 * @copydoc CFGMR3QueryBool
176 */
177VMMR3DECL(int) CFGMR3QueryBool(PCFGMNODE pNode, const char *pszName, bool *pf)
178{
179 uint64_t u64;
180 int rc = CFGMR3QueryInteger(pNode, pszName, &u64);
181 if (RT_SUCCESS(rc))
182 *pf = u64 ? true : false;
183 return rc;
184}
185
186
187/**
188 * @copydoc CFGMR3QueryBoolDef
189 */
190VMMR3DECL(int) CFGMR3QueryBoolDef(PCFGMNODE pNode, const char *pszName, bool *pf, bool fDef)
191{
192 uint64_t u64;
193 int rc = CFGMR3QueryIntegerDef(pNode, pszName, &u64, fDef);
194 *pf = u64 ? true : false;
195 return rc;
196}
197
198
199/**
200 * @copydoc CFGMR3QueryBytes
201 */
202VMMR3DECL(int) CFGMR3QueryBytes(PCFGMNODE pNode, const char *pszName, void *pvData, size_t cbData)
203{
204 return pNode->pVmmCallbacks->pfnCFGMR3QueryBytes(pNode, pszName, pvData, cbData);
205}
206
207
208/**
209 * @copydoc CFGMR3QueryInteger
210 */
211VMMR3DECL(int) CFGMR3QueryInteger(PCFGMNODE pNode, const char *pszName, uint64_t *pu64)
212{
213 return pNode->pVmmCallbacks->pfnCFGMR3QueryInteger(pNode, pszName, pu64);
214}
215
216
217/**
218 * @copydoc CFGMR3QueryIntegerDef
219 */
220VMMR3DECL(int) CFGMR3QueryIntegerDef(PCFGMNODE pNode, const char *pszName, uint64_t *pu64, uint64_t u64Def)
221{
222 int rc = CFGMR3QueryInteger(pNode, pszName, pu64);
223 if (RT_FAILURE(rc))
224 {
225 *pu64 = u64Def;
226 if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
227 rc = VINF_SUCCESS;
228 }
229
230 return rc;
231}
232
233
234/**
235 * @copydoc CFGMR3QueryPortDef
236 */
237VMMR3DECL(int) CFGMR3QueryPortDef(PCFGMNODE pNode, const char *pszName, PRTIOPORT pPort, RTIOPORT PortDef)
238{
239 AssertCompileSize(RTIOPORT, 2);
240 return CFGMR3QueryU16Def(pNode, pszName, pPort, PortDef);
241}
242
243
244/**
245 * @copydoc CFGMR3QueryPtr
246 */
247VMMR3DECL(int) CFGMR3QueryPtr(PCFGMNODE pNode, const char *pszName, void **ppv)
248{
249 uint64_t u64;
250 int rc = CFGMR3QueryInteger(pNode, pszName, &u64);
251 if (RT_SUCCESS(rc))
252 {
253 uintptr_t u = (uintptr_t)u64;
254 if (u64 == u)
255 *ppv = (void *)u;
256 else
257 rc = VERR_CFGM_INTEGER_TOO_BIG;
258 }
259 return rc;
260}
261
262
263/**
264 * @copydoc CFGMR3QueryS32
265 */
266VMMR3DECL(int) CFGMR3QueryS32(PCFGMNODE pNode, const char *pszName, int32_t *pi32)
267{
268 uint64_t u64;
269 int rc = CFGMR3QueryInteger(pNode, pszName, &u64);
270 if (RT_SUCCESS(rc))
271 {
272 if ( !(u64 & UINT64_C(0xffffffff80000000))
273 || (u64 & UINT64_C(0xffffffff80000000)) == UINT64_C(0xffffffff80000000))
274 *pi32 = (int32_t)u64;
275 else
276 rc = VERR_CFGM_INTEGER_TOO_BIG;
277 }
278 return rc;
279}
280
281
282/**
283 * @copydoc CFGMR3QueryS32Def
284 */
285VMMR3DECL(int) CFGMR3QueryS32Def(PCFGMNODE pNode, const char *pszName, int32_t *pi32, int32_t i32Def)
286{
287 uint64_t u64;
288 int rc = CFGMR3QueryIntegerDef(pNode, pszName, &u64, i32Def);
289 if (RT_SUCCESS(rc))
290 {
291 if ( !(u64 & UINT64_C(0xffffffff80000000))
292 || (u64 & UINT64_C(0xffffffff80000000)) == UINT64_C(0xffffffff80000000))
293 *pi32 = (int32_t)u64;
294 else
295 rc = VERR_CFGM_INTEGER_TOO_BIG;
296 }
297 if (RT_FAILURE(rc))
298 *pi32 = i32Def;
299 return rc;
300}
301
302
303/**
304 * @copydoc CFGMR3QuerySIntDef
305 */
306VMMR3DECL(int) CFGMR3QuerySIntDef(PCFGMNODE pNode, const char *pszName, signed int *pi, signed int iDef)
307{
308 AssertCompileSize(signed int, 4);
309 return CFGMR3QueryS32Def(pNode, pszName, (int32_t *)pi, iDef);
310}
311
312
313/**
314 * @copydoc CFGMR3QuerySize
315 */
316VMMDECL(int) CFGMR3QuerySize(PCFGMNODE pNode, const char *pszName, size_t *pcb)
317{
318 return pNode->pVmmCallbacks->pfnCFGMR3QuerySize(pNode, pszName, pcb);
319}
320
321
322/**
323 * @copydoc CFGMR3QueryString
324 */
325VMMR3DECL(int) CFGMR3QueryString(PCFGMNODE pNode, const char *pszName, char *pszString, size_t cchString)
326{
327 return pNode->pVmmCallbacks->pfnCFGMR3QueryString(pNode, pszName, pszString, cchString);
328}
329
330
331/**
332 * @copydoc CFGMR3QueryStringDef
333 */
334VMMR3DECL(int) CFGMR3QueryStringDef(PCFGMNODE pNode, const char *pszName, char *pszString, size_t cchString, const char *pszDef)
335{
336 int rc = CFGMR3QueryString(pNode, pszName, pszString, cchString);
337 if (RT_FAILURE(rc) && rc != VERR_CFGM_NOT_ENOUGH_SPACE)
338 {
339 size_t cchDef = strlen(pszDef);
340 if (cchString > cchDef)
341 {
342 memcpy(pszString, pszDef, cchDef);
343 memset(pszString + cchDef, 0, cchString - cchDef);
344 if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
345 rc = VINF_SUCCESS;
346 }
347 else if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
348 rc = VERR_CFGM_NOT_ENOUGH_SPACE;
349 }
350
351 return rc;
352}
353
354
355/**
356 * @copydoc CFGMR3QueryStringAlloc
357 */
358VMMR3DECL(int) CFGMR3QueryStringAlloc(PCFGMNODE pNode, const char *pszName, char **ppszString)
359{
360#if 0
361 size_t cbString;
362 int rc = CFGMR3QuerySize(pNode, pszName, &cbString);
363 if (RT_SUCCESS(rc))
364 {
365 char *pszString = cfgmR3StrAlloc(pNode->pVM, MM_TAG_CFGM_USER, cbString);
366 if (pszString)
367 {
368 rc = CFGMR3QueryString(pNode, pszName, pszString, cbString);
369 if (RT_SUCCESS(rc))
370 *ppszString = pszString;
371 else
372 cfgmR3StrFree(pNode->pVM, pszString);
373 }
374 else
375 rc = VERR_NO_MEMORY;
376 }
377 return rc;
378#endif
379 RT_NOREF(pNode, pszName, ppszString);
380 AssertFailed();
381 return VERR_NOT_IMPLEMENTED;
382}
383
384
385/**
386 * @copydoc CFGMR3QueryStringAllocDef
387 */
388VMMR3DECL(int) CFGMR3QueryStringAllocDef(PCFGMNODE pNode, const char *pszName, char **ppszString, const char *pszDef)
389{
390 RT_NOREF(pNode, pszName, ppszString, pszDef);
391 AssertFailed();
392 return VERR_NOT_IMPLEMENTED;
393}
394
395
396/**
397 * @copydoc CFGMR3QueryU16
398 */
399VMMR3DECL(int) CFGMR3QueryU16(PCFGMNODE pNode, const char *pszName, uint16_t *pu16)
400{
401 uint64_t u64;
402 int rc = CFGMR3QueryInteger(pNode, pszName, &u64);
403 if (RT_SUCCESS(rc))
404 {
405 if (!(u64 & UINT64_C(0xffffffffffff0000)))
406 *pu16 = (int16_t)u64;
407 else
408 rc = VERR_CFGM_INTEGER_TOO_BIG;
409 }
410 return rc;
411}
412
413
414/**
415 * @copydoc CFGMR3QueryU16Def
416 */
417VMMR3DECL(int) CFGMR3QueryU16Def(PCFGMNODE pNode, const char *pszName, uint16_t *pu16, uint16_t u16Def)
418{
419 uint64_t u64;
420 int rc = CFGMR3QueryIntegerDef(pNode, pszName, &u64, u16Def);
421 if (RT_SUCCESS(rc))
422 {
423 if (!(u64 & UINT64_C(0xffffffffffff0000)))
424 *pu16 = (int16_t)u64;
425 else
426 rc = VERR_CFGM_INTEGER_TOO_BIG;
427 }
428 if (RT_FAILURE(rc))
429 *pu16 = u16Def;
430 return rc;
431}
432
433
434/**
435 * @copydoc CFGMR3QueryU32
436 */
437VMMR3DECL(int) CFGMR3QueryU32(PCFGMNODE pNode, const char *pszName, uint32_t *pu32)
438{
439 uint64_t u64;
440 int rc = CFGMR3QueryInteger(pNode, pszName, &u64);
441 if (RT_SUCCESS(rc))
442 {
443 if (!(u64 & UINT64_C(0xffffffff00000000)))
444 *pu32 = (uint32_t)u64;
445 else
446 rc = VERR_CFGM_INTEGER_TOO_BIG;
447 }
448 return rc;
449}
450
451
452/**
453 * @copydoc CFGMR3QueryU32Def
454 */
455VMMR3DECL(int) CFGMR3QueryU32Def(PCFGMNODE pNode, const char *pszName, uint32_t *pu32, uint32_t u32Def)
456{
457 uint64_t u64;
458 int rc = CFGMR3QueryIntegerDef(pNode, pszName, &u64, u32Def);
459 if (RT_SUCCESS(rc))
460 {
461 if (!(u64 & UINT64_C(0xffffffff00000000)))
462 *pu32 = (uint32_t)u64;
463 else
464 rc = VERR_CFGM_INTEGER_TOO_BIG;
465 }
466 if (RT_FAILURE(rc))
467 *pu32 = u32Def;
468 return rc;
469}
470
471
472/**
473 * @copydoc CFGMR3QueryU64
474 */
475VMMR3DECL(int) CFGMR3QueryU64(PCFGMNODE pNode, const char *pszName, uint64_t *pu64)
476{
477 return CFGMR3QueryInteger(pNode, pszName, pu64);
478}
479
480
481/**
482 * @copydoc CFGMR3QueryU64Def
483 */
484VMMR3DECL(int) CFGMR3QueryU64Def(PCFGMNODE pNode, const char *pszName, uint64_t *pu64, uint64_t u64Def)
485{
486 return CFGMR3QueryIntegerDef(pNode, pszName, pu64, u64Def);
487}
488
489
490/**
491 * @copydoc CFGMR3QueryU8
492 */
493VMMR3DECL(int) CFGMR3QueryU8(PCFGMNODE pNode, const char *pszName, uint8_t *pu8)
494{
495 uint64_t u64;
496 int rc = CFGMR3QueryInteger(pNode, pszName, &u64);
497 if (RT_SUCCESS(rc))
498 {
499 if (!(u64 & UINT64_C(0xffffffffffffff00)))
500 *pu8 = (uint8_t)u64;
501 else
502 rc = VERR_CFGM_INTEGER_TOO_BIG;
503 }
504 return rc;
505}
506
507
508/**
509 * @copydoc CFGMR3QueryU8Def
510 */
511VMMR3DECL(int) CFGMR3QueryU8Def(PCFGMNODE pNode, const char *pszName, uint8_t *pu8, uint8_t u8Def)
512{
513 uint64_t u64;
514 int rc = CFGMR3QueryIntegerDef(pNode, pszName, &u64, u8Def);
515 if (RT_SUCCESS(rc))
516 {
517 if (!(u64 & UINT64_C(0xffffffffffffff00)))
518 *pu8 = (uint8_t)u64;
519 else
520 rc = VERR_CFGM_INTEGER_TOO_BIG;
521 }
522 if (RT_FAILURE(rc))
523 *pu8 = u8Def;
524 return rc;
525}
526
527
528/**
529 * @copydoc CFGMR3RemoveNode
530 */
531VMMR3DECL(void) CFGMR3RemoveNode(PCFGMNODE pNode)
532{
533 pNode->pVmmCallbacks->pfnCFGMR3RemoveNode(pNode);
534}
535
536
537/**
538 * @copydoc CFGMR3ValidateConfig
539 */
540VMMR3DECL(int) CFGMR3ValidateConfig(PCFGMNODE pNode, const char *pszNode,
541 const char *pszValidValues, const char *pszValidNodes,
542 const char *pszWho, uint32_t uInstance)
543{
544 return pNode->pVmmCallbacks->pfnCFGMR3ValidateConfig(pNode, pszNode, pszValidValues, pszValidNodes, pszWho, uInstance);
545}
546
547
548/**
549 * @copydoc IOMIOPortWrite
550 */
551VMMDECL(VBOXSTRICTRC) IOMIOPortWrite(PVM pVM, PVMCPU pVCpu, RTIOPORT Port, uint32_t u32Value, size_t cbValue)
552{
553 return pVM->vm.s.pVmmCallbacks->pfnIOMIOPortWrite(pVM, pVCpu, Port, u32Value, cbValue);
554}
555
556
557/**
558 * @copydoc IOMMMIOMapMMIO2Page
559 */
560VMMDECL(int) IOMMMIOMapMMIO2Page(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysRemapped, uint64_t fPageFlags)
561{
562 return pVM->vm.s.pVmmCallbacks->pfnIOMMMIOMapMMIO2Page(pVM, GCPhys, GCPhysRemapped, fPageFlags);
563}
564
565
566/**
567 * @copydoc IOMMMIOResetRegion
568 */
569VMMDECL(int) IOMMMIOResetRegion(PVM pVM, RTGCPHYS GCPhys)
570{
571 return pVM->vm.s.pVmmCallbacks->pfnIOMMMIOResetRegion(pVM, GCPhys);
572}
573
574
575/**
576 * @copydoc MMHyperAlloc
577 */
578VMMDECL(int) MMHyperAlloc(PVM pVM, size_t cb, uint32_t uAlignment, MMTAG enmTag, void **ppv)
579{
580 return pVM->vm.s.pVmmCallbacks->pfnMMHyperAlloc(pVM, cb, uAlignment, enmTag, ppv);
581}
582
583
584/**
585 * @copydoc MMHyperFree
586 */
587VMMDECL(int) MMHyperFree(PVM pVM, void *pv)
588{
589 return pVM->vm.s.pVmmCallbacks->pfnMMHyperFree(pVM, pv);
590}
591
592
593/**
594 * @copydoc MMHyperR3ToR0
595 */
596VMMDECL(RTR0PTR) MMHyperR3ToR0(PVM pVM, RTR3PTR R3Ptr)
597{
598 return pVM->vm.s.pVmmCallbacks->pfnMMHyperR3ToR0(pVM, R3Ptr);
599}
600
601
602/**
603 * @copydoc MMHyperR3ToRC
604 */
605VMMDECL(RTRCPTR) MMHyperR3ToRC(PVM pVM, RTR3PTR R3Ptr)
606{
607 return pVM->vm.s.pVmmCallbacks->pfnMMHyperR3ToRC(pVM, R3Ptr);
608}
609
610
611/**
612 * @copydoc MMR3HeapFree
613 */
614VMMR3DECL(void) MMR3HeapFree(void *pv)
615{
616 PTSTDEVMMHEAPALLOC pHeapAlloc = (PTSTDEVMMHEAPALLOC)((uint8_t *)pv - RT_OFFSETOF(TSTDEVMMHEAPALLOC, abAlloc[0]));
617 pHeapAlloc->pVmmCallbacks->pfnMMR3HeapFree(pv);
618}
619
620
621/**
622 * @copydoc MMR3HyperAllocOnceNoRel
623 */
624VMMR3DECL(int) MMR3HyperAllocOnceNoRel(PVM pVM, size_t cb, uint32_t uAlignment, MMTAG enmTag, void **ppv)
625{
626 return pVM->vm.s.pVmmCallbacks->pfnMMR3HyperAllocOnceNoRel(pVM, cb, uAlignment, enmTag, ppv);
627}
628
629
630/**
631 * @copydoc MMR3PhysGetRamSize
632 */
633VMMR3DECL(uint64_t) MMR3PhysGetRamSize(PVM pVM)
634{
635 return pVM->vm.s.pVmmCallbacks->pfnMMR3PhysGetRamSize(pVM);
636}
637
638
639/**
640 * @copydoc MMR3PhysGetRamSizeBelow4GB
641 */
642VMMR3DECL(uint32_t) MMR3PhysGetRamSizeBelow4GB(PVM pVM)
643{
644 return pVM->vm.s.pVmmCallbacks->pfnMMR3PhysGetRamSizeBelow4GB(pVM);
645}
646
647
648/**
649 * @copydoc MMR3PhysGetRamSizeAbove4GB
650 */
651VMMR3DECL(uint64_t) MMR3PhysGetRamSizeAbove4GB(PVM pVM)
652{
653 return pVM->vm.s.pVmmCallbacks->pfnMMR3PhysGetRamSizeAbove4GB(pVM);
654}
655
656
657/**
658 * @copydoc PDMCritSectEnterDebug
659 */
660VMMDECL(int) PDMCritSectEnterDebug(PPDMCRITSECT pCritSect, int rcBusy, RTHCUINTPTR uId, RT_SRC_POS_DECL)
661{
662 return pCritSect->s.pVmmCallbacks->pfnPDMCritSectEnterDebug(pCritSect, rcBusy, uId, RT_SRC_POS_ARGS);
663}
664
665
666/**
667 * @copydoc PDMCritSectIsInitialized
668 */
669VMMDECL(bool) PDMCritSectIsInitialized(PCPDMCRITSECT pCritSect)
670{
671 return pCritSect->s.pVmmCallbacks->pfnPDMCritSectIsInitialized(pCritSect);
672}
673
674
675/**
676 * @copydoc PDMCritSectIsOwner
677 */
678VMMDECL(bool) PDMCritSectIsOwner(PCPDMCRITSECT pCritSect)
679{
680 return pCritSect->s.pVmmCallbacks->pfnPDMCritSectIsOwner(pCritSect);
681}
682
683
684/**
685 * @copydoc PDMCritSectLeave
686 */
687VMMDECL(int) PDMCritSectLeave(PPDMCRITSECT pCritSect)
688{
689 return pCritSect->s.pVmmCallbacks->pfnPDMCritSectLeave(pCritSect);
690}
691
692
693/**
694 * @copydoc PDMCritSectTryEnterDebug
695 */
696VMMDECL(int) PDMCritSectTryEnterDebug(PPDMCRITSECT pCritSect, RTHCUINTPTR uId, RT_SRC_POS_DECL)
697{
698 return pCritSect->s.pVmmCallbacks->pfnPDMCritSectTryEnterDebug(pCritSect, uId, RT_SRC_POS_ARGS);
699}
700
701
702/**
703 * @copydoc PDMHCCritSectScheduleExitEvent
704 */
705VMMDECL(int) PDMHCCritSectScheduleExitEvent(PPDMCRITSECT pCritSect, SUPSEMEVENT hEventToSignal)
706{
707 return pCritSect->s.pVmmCallbacks->pfnPDMHCCritSectScheduleExitEvent(pCritSect, hEventToSignal);
708}
709
710
711/**
712 * @copydoc PDMNsAllocateBandwidth
713 */
714VMMDECL(bool) PDMNsAllocateBandwidth(PPDMNSFILTER pFilter, size_t cbTransfer)
715{
716#if 0
717 return pFilter->pVmmCallbacks->pfnPDMNsAllocateBandwidth(pFilter, cbTransfer);
718#endif
719 RT_NOREF(pFilter, cbTransfer);
720 AssertFailed();
721 return false;
722}
723
724
725/**
726 * @copydoc PDMQueueAlloc
727 */
728VMMDECL(PPDMQUEUEITEMCORE) PDMQueueAlloc(PPDMQUEUE pQueue)
729{
730 return pQueue->pVmmCallbacks->pfnPDMQueueAlloc(pQueue);
731}
732
733
734/**
735 * @copydoc PDMQueueFlushIfNecessary
736 */
737VMMDECL(bool) PDMQueueFlushIfNecessary(PPDMQUEUE pQueue)
738{
739 return pQueue->pVmmCallbacks->pfnPDMQueueFlushIfNecessary(pQueue);
740}
741
742
743/**
744 * @copydoc PDMQueueInsert
745 */
746VMMDECL(void) PDMQueueInsert(PPDMQUEUE pQueue, PPDMQUEUEITEMCORE pItem)
747{
748 pQueue->pVmmCallbacks->pfnPDMQueueInsert(pQueue, pItem);
749}
750
751
752/**
753 * @copydoc PDMQueueR0Ptr
754 */
755VMMDECL(R0PTRTYPE(PPDMQUEUE)) PDMQueueR0Ptr(PPDMQUEUE pQueue)
756{
757 return pQueue->pVmmCallbacks->pfnPDMQueueR0Ptr(pQueue);
758}
759
760
761/**
762 * @copydoc PDMQueueRCPtr
763 */
764VMMDECL(RCPTRTYPE(PPDMQUEUE)) PDMQueueRCPtr(PPDMQUEUE pQueue)
765{
766 return pQueue->pVmmCallbacks->pfnPDMQueueRCPtr(pQueue);
767}
768
769
770/**
771 * @copydoc PGMHandlerPhysicalPageTempOff
772 */
773VMMDECL(int) PGMHandlerPhysicalPageTempOff(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysPage)
774{
775 RT_NOREF(pVM, GCPhys, GCPhysPage);
776 AssertFailed();
777 return VERR_NOT_IMPLEMENTED;
778}
779
780
781/**
782 * @copydoc PGMShwMakePageWritable
783 */
784VMMDECL(int) PGMShwMakePageWritable(PVMCPU pVCpu, RTGCPTR GCPtr, uint32_t fFlags)
785{
786 RT_NOREF(pVCpu, GCPtr, fFlags);
787 AssertFailed();
788 return VERR_NOT_IMPLEMENTED;
789}
790
791/** @todo: PDMR3AsyncCompletion + BlkCache + CritSect + QueryLun + Thread. */
792
793/**
794 * @copydoc TMCpuTicksPerSecond
795 */
796VMMDECL(uint64_t) TMCpuTicksPerSecond(PVM pVM)
797{
798 return pVM->vm.s.pVmmCallbacks->pfnTMCpuTicksPerSecond(pVM);
799}
800
801
802/**
803 * @copydoc TMR3TimerDestroy
804 */
805VMMR3DECL(int) TMR3TimerDestroy(PTMTIMER pTimer)
806{
807 return pTimer->pVmmCallbacks->pfnTMR3TimerDestroy(pTimer);
808}
809
810
811/**
812 * @copydoc TMR3TimerSave
813 */
814VMMR3DECL(int) TMR3TimerSave(PTMTIMERR3 pTimer, PSSMHANDLE pSSM)
815{
816 return pTimer->pVmmCallbacks->pfnTMR3TimerSave(pTimer, pSSM);
817}
818
819
820/**
821 * @copydoc TMR3TimerLoad
822 */
823VMMR3DECL(int) TMR3TimerLoad(PTMTIMERR3 pTimer, PSSMHANDLE pSSM)
824{
825 return pTimer->pVmmCallbacks->pfnTMR3TimerLoad(pTimer, pSSM);
826}
827
828
829/**
830 * @copydoc TMR3TimerSetCritSect
831 */
832VMMR3DECL(int) TMR3TimerSetCritSect(PTMTIMERR3 pTimer, PPDMCRITSECT pCritSect)
833{
834 return pTimer->pVmmCallbacks->pfnTMR3TimerSetCritSect(pTimer, pCritSect);
835}
836
837
838/**
839 * @copydoc TMTimerFromMilli
840 */
841VMMDECL(uint64_t) TMTimerFromMilli(PTMTIMER pTimer, uint64_t cMilliSecs)
842{
843 return pTimer->pVmmCallbacks->pfnTMTimerFromMilli(pTimer, cMilliSecs);
844}
845
846
847/**
848 * @copydoc TMTimerFromNano
849 */
850VMMDECL(uint64_t) TMTimerFromNano(PTMTIMER pTimer, uint64_t cNanoSecs)
851{
852 return pTimer->pVmmCallbacks->pfnTMTimerFromNano(pTimer, cNanoSecs);
853}
854
855
856/**
857 * @copydoc TMTimerGet
858 */
859VMMDECL(uint64_t) TMTimerGet(PTMTIMER pTimer)
860{
861 return pTimer->pVmmCallbacks->pfnTMTimerGet(pTimer);
862}
863
864
865/**
866 * @copydoc TMTimerGetFreq
867 */
868VMMDECL(uint64_t) TMTimerGetFreq(PTMTIMER pTimer)
869{
870 return pTimer->pVmmCallbacks->pfnTMTimerGetFreq(pTimer);
871}
872
873
874/**
875 * @copydoc TMTimerGetNano
876 */
877VMMDECL(uint64_t) TMTimerGetNano(PTMTIMER pTimer)
878{
879 return pTimer->pVmmCallbacks->pfnTMTimerGetNano(pTimer);
880}
881
882
883/**
884 * @copydoc TMTimerIsActive
885 */
886VMMDECL(bool) TMTimerIsActive(PTMTIMER pTimer)
887{
888 return pTimer->pVmmCallbacks->pfnTMTimerIsActive(pTimer);
889}
890
891
892/**
893 * @copydoc TMTimerIsLockOwner
894 */
895VMMDECL(bool) TMTimerIsLockOwner(PTMTIMER pTimer)
896{
897 return pTimer->pVmmCallbacks->pfnTMTimerIsLockOwner(pTimer);
898}
899
900
901/**
902 * @copydoc TMTimerLock
903 */
904VMMDECL(int) TMTimerLock(PTMTIMER pTimer, int rcBusy)
905{
906 return pTimer->pVmmCallbacks->pfnTMTimerLock(pTimer, rcBusy);
907}
908
909
910/**
911 * @copydoc TMTimerR0Ptr
912 */
913VMMDECL(PTMTIMERR0) TMTimerR0Ptr(PTMTIMER pTimer)
914{
915 return pTimer->pVmmCallbacks->pfnTMTimerR0Ptr(pTimer);
916}
917
918
919/**
920 * @copydoc TMTimerRCPtr
921 */
922VMMDECL(PTMTIMERRC) TMTimerRCPtr(PTMTIMER pTimer)
923{
924 return pTimer->pVmmCallbacks->pfnTMTimerRCPtr(pTimer);
925}
926
927
928/**
929 * @copydoc TMTimerSet
930 */
931VMMDECL(int) TMTimerSet(PTMTIMER pTimer, uint64_t u64Expire)
932{
933 return pTimer->pVmmCallbacks->pfnTMTimerSet(pTimer, u64Expire);
934}
935
936
937/**
938 * @copydoc TMTimerSetFrequencyHint
939 */
940VMMDECL(int) TMTimerSetFrequencyHint(PTMTIMER pTimer, uint32_t uHz)
941{
942 return pTimer->pVmmCallbacks->pfnTMTimerSetFrequencyHint(pTimer, uHz);
943}
944
945
946/**
947 * @copydoc TMTimerSetMicro
948 */
949VMMDECL(int) TMTimerSetMicro(PTMTIMER pTimer, uint64_t cMicrosToNext)
950{
951 return pTimer->pVmmCallbacks->pfnTMTimerSetMicro(pTimer, cMicrosToNext);
952}
953
954
955/**
956 * @copydoc TMTimerSetMillies
957 */
958VMMDECL(int) TMTimerSetMillies(PTMTIMER pTimer, uint32_t cMilliesToNext)
959{
960 return pTimer->pVmmCallbacks->pfnTMTimerSetMillies(pTimer, cMilliesToNext);
961}
962
963
964/**
965 * @copydoc TMTimerSetNano
966 */
967VMMDECL(int) TMTimerSetNano(PTMTIMER pTimer, uint64_t cNanosToNext)
968{
969 return pTimer->pVmmCallbacks->pfnTMTimerSetNano(pTimer, cNanosToNext);
970}
971
972
973/**
974 * @copydoc TMTimerStop
975 */
976VMMDECL(int) TMTimerStop(PTMTIMER pTimer)
977{
978 return pTimer->pVmmCallbacks->pfnTMTimerStop(pTimer);
979}
980
981
982/**
983 * @copydoc TMTimerUnlock
984 */
985VMMDECL(void) TMTimerUnlock(PTMTIMER pTimer)
986{
987 return pTimer->pVmmCallbacks->pfnTMTimerUnlock(pTimer);
988}
989
990
991
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