VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c@ 19671

Last change on this file since 19671 was 19671, checked in by vboxsync, 16 years ago

Support,VMMR0: enable disabling of interrupts again and remove disabling preemption

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 18.1 KB
Line 
1/* $Id: SUPDrv-freebsd.c 19671 2009-05-13 18:28:58Z vboxsync $ */
2/** @file
3 * VBoxDrv - The VirtualBox Support Driver - FreeBSD specifics.
4 */
5
6/*
7 * Copyright (c) 2007 knut st. osmundsen <[email protected]>
8 *
9 * Permission is hereby granted, free of charge, to any person
10 * obtaining a copy of this software and associated documentation
11 * files (the "Software"), to deal in the Software without
12 * restriction, including without limitation the rights to use,
13 * copy, modify, merge, publish, distribute, sublicense, and/or sell
14 * copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following
16 * conditions:
17 *
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
29 */
30
31/*******************************************************************************
32* Header Files *
33*******************************************************************************/
34#define LOG_GROUP LOG_GROUP_SUP_DRV
35/* Deal with conflicts first. */
36#include <sys/param.h>
37#undef PVM
38#include <sys/types.h>
39#include <sys/module.h>
40#include <sys/systm.h>
41#include <sys/errno.h>
42#include <sys/kernel.h>
43#include <sys/fcntl.h>
44#include <sys/conf.h>
45#include <sys/uio.h>
46
47#include "../SUPDrvInternal.h"
48#include <VBox/version.h>
49#include <iprt/initterm.h>
50#include <iprt/string.h>
51#include <iprt/spinlock.h>
52#include <iprt/process.h>
53#include <iprt/assert.h>
54#include <iprt/uuid.h>
55#include <VBox/log.h>
56#include <iprt/alloc.h>
57#include <iprt/err.h>
58
59#ifdef VBOX_WITH_HARDENING
60# define VBOXDRV_PERM 0600
61#else
62# define VBOXDRV_PERM 0666
63#endif
64
65/*******************************************************************************
66* Internal Functions *
67*******************************************************************************/
68static int VBoxDrvFreeBSDModuleEvent(struct module *pMod, int enmEventType, void *pvArg);
69static int VBoxDrvFreeBSDLoad(void);
70static int VBoxDrvFreeBSDUnload(void);
71static void VBoxDrvFreeBSDClone(void *pvArg, struct ucred *pCred, char *pachName, int cchName, struct cdev **ppDev);
72
73static d_fdopen_t VBoxDrvFreeBSDOpen;
74static d_close_t VBoxDrvFreeBSDClose;
75static d_ioctl_t VBoxDrvFreeBSDIOCtl;
76static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd);
77
78
79/*******************************************************************************
80* Global Variables *
81*******************************************************************************/
82/**
83 * Module info structure used by the kernel.
84 */
85static moduledata_t g_VBoxDrvFreeBSDModule =
86{
87 "vboxdrv",
88 VBoxDrvFreeBSDModuleEvent,
89 NULL
90};
91
92/** Declare the module as a pseudo device. */
93DECLARE_MODULE(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY);
94MODULE_VERSION(vboxdrv, 1);
95
96/**
97 * The /dev/vboxdrv character device entry points.
98 */
99static struct cdevsw g_VBoxDrvFreeBSDChrDevSW =
100{
101 .d_version = D_VERSION,
102 .d_flags = D_PSEUDO | D_TRACKCLOSE,
103 .d_fdopen = VBoxDrvFreeBSDOpen,
104 .d_close = VBoxDrvFreeBSDClose,
105 .d_ioctl = VBoxDrvFreeBSDIOCtl,
106 .d_name = "vboxdrv"
107};
108
109/** List of cloned device. Managed by the kernel. */
110static struct clonedevs *g_pVBoxDrvFreeBSDClones;
111/** The dev_clone event handler tag. */
112static eventhandler_tag g_VBoxDrvFreeBSDEHTag;
113/** Reference counter. */
114static volatile uint32_t g_cUsers;
115
116/** The device extention. */
117static SUPDRVDEVEXT g_VBoxDrvFreeBSDDevExt;
118
119/**
120 * Module event handler.
121 *
122 * @param pMod The module structure.
123 * @param enmEventType The event type (modeventtype_t).
124 * @param pvArg Module argument. NULL.
125 *
126 * @return 0 on success, errno.h status code on failure.
127 */
128static int VBoxDrvFreeBSDModuleEvent(struct module *pMod, int enmEventType, void *pvArg)
129{
130 int rc;
131 switch (enmEventType)
132 {
133 case MOD_LOAD:
134 rc = VBoxDrvFreeBSDLoad();
135 break;
136
137 case MOD_UNLOAD:
138 rc = VBoxDrvFreeBSDUnload();
139 break;
140
141 case MOD_SHUTDOWN:
142 case MOD_QUIESCE:
143 default:
144 return EOPNOTSUPP;
145 }
146
147 if (RT_SUCCESS(rc))
148 return 0;
149 return RTErrConvertToErrno(rc);
150}
151
152
153static int VBoxDrvFreeBSDLoad(void)
154{
155 dprintf(("VBoxDrvFreeBSDLoad:\n"));
156
157 g_cUsers = 0;
158
159 /*
160 * Initialize the runtime.
161 */
162 int rc = RTR0Init(0);
163 if (RT_SUCCESS(rc))
164 {
165 /*
166 * Initialize the device extension.
167 */
168 rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt);
169 if (RT_SUCCESS(rc))
170 {
171 /*
172 * Configure device cloning.
173 */
174 clone_setup(&g_pVBoxDrvFreeBSDClones);
175 g_VBoxDrvFreeBSDEHTag = EVENTHANDLER_REGISTER(dev_clone, VBoxDrvFreeBSDClone, 0, 1000);
176 if (g_VBoxDrvFreeBSDEHTag)
177 {
178 dprintf(("VBoxDrvFreeBSDLoad: returns successfully\n"));
179 return VINF_SUCCESS;
180 }
181
182 printf("vboxdrv: EVENTHANDLER_REGISTER(dev_clone,,,) failed\n");
183 clone_cleanup(&g_pVBoxDrvFreeBSDClones);
184 rc = SUPDRV_ERR_ALREADY_LOADED;
185 supdrvDeleteDevExt(&g_VBoxDrvFreeBSDDevExt);
186 }
187 else
188 printf("vboxdrv: supdrvInitDevExt failed, rc=%d\n", rc);
189 RTR0Term();
190 }
191 else
192 printf("vboxdrv: RTR0Init failed, rc=%d\n", rc);
193 return rc;
194}
195
196static int VBoxDrvFreeBSDUnload(void)
197{
198 dprintf(("VBoxDrvFreeBSDUnload:\n"));
199
200 if (g_cUsers > 0)
201 return EBUSY;
202
203 /*
204 * Reserve what we did in VBoxDrvFreeBSDInit.
205 */
206 clone_cleanup(&g_pVBoxDrvFreeBSDClones);
207
208 supdrvDeleteDevExt(&g_VBoxDrvFreeBSDDevExt);
209
210 RTR0Term();
211
212 memset(&g_VBoxDrvFreeBSDDevExt, 0, sizeof(g_VBoxDrvFreeBSDDevExt));
213
214 dprintf(("VBoxDrvFreeBSDUnload: returns\n"));
215 return VINF_SUCCESS;
216}
217
218
219/**
220 * DEVFS event handler.
221 */
222static void VBoxDrvFreeBSDClone(void *pvArg, struct ucred *pCred, char *pszName, int cchName, struct cdev **ppDev)
223{
224 int iUnit;
225 int rc;
226
227 dprintf(("VBoxDrvFreeBSDClone: pszName=%s ppDev=%p\n", pszName, ppDev));
228
229 /*
230 * One device node per user, si_drv1 points to the session.
231 * /dev/vboxdrv<N> where N = {0...255}.
232 */
233 if (!ppDev)
234 return;
235 if (dev_stdclone(pszName, NULL, "vboxdrv", &iUnit) != 1)
236 return;
237 if (iUnit >= 256 || iUnit < 0)
238 {
239 dprintf(("VBoxDrvFreeBSDClone: iUnit=%d >= 256 - rejected\n", iUnit));
240 return;
241 }
242
243 dprintf(("VBoxDrvFreeBSDClone: pszName=%s iUnit=%d\n", pszName, iUnit));
244
245 rc = clone_create(&g_pVBoxDrvFreeBSDClones, &g_VBoxDrvFreeBSDChrDevSW, &iUnit, ppDev, 0);
246 dprintf(("VBoxDrvFreeBSDClone: clone_create -> %d; iUnit=%d\n", rc, iUnit));
247 if (rc)
248 {
249#if __FreeBSD_version > 800061
250 *ppDev = make_dev(&g_VBoxDrvFreeBSDChrDevSW, iUnit, UID_ROOT, GID_WHEEL, VBOXDRV_PERM, "vboxdrv%d", iUnit);
251#else
252 *ppDev = make_dev(&g_VBoxDrvFreeBSDChrDevSW, unit2minor(iUnit), UID_ROOT, GID_WHEEL, VBOXDRV_PERM, "vboxdrv%d", iUnit);
253#endif
254 if (*ppDev)
255 {
256 dev_ref(*ppDev);
257 (*ppDev)->si_flags |= SI_CHEAPCLONE;
258 dprintf(("VBoxDrvFreeBSDClone: Created *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n",
259 *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2));
260 (*ppDev)->si_drv1 = (*ppDev)->si_drv2 = NULL;
261 }
262 else
263 OSDBGPRINT(("VBoxDrvFreeBSDClone: make_dev iUnit=%d failed\n", iUnit));
264 }
265 else
266 dprintf(("VBoxDrvFreeBSDClone: Existing *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n",
267 *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2));
268}
269
270
271
272/**
273 *
274 * @returns 0 on success, errno on failure.
275 * EBUSY if the device is used by someone else.
276 * @param pDev The device node.
277 * @param fOpen The open flags.
278 * @param pTd The thread.
279 * @param pFd The file descriptor. FreeBSD 7.0 and later.
280 * @param iFd The file descriptor index(?). Pre FreeBSD 7.0.
281 */
282#if __FreeBSD__ >= 7
283static int VBoxDrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd, struct file *pFd)
284#else
285static int VBoxDrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd, int iFd)
286#endif
287{
288 PSUPDRVSESSION pSession;
289 int rc;
290
291#if __FreeBSD_version < 800062
292 dprintf(("VBoxDrvFreeBSDOpen: fOpen=%#x iUnit=%d\n", fOpen, minor2unit(minor(pDev))));
293#else
294 dprintf(("VBoxDrvFreeBSDOpen: fOpen=%#x iUnit=%d\n", fOpen, minor(pDev)));
295#endif
296
297 /*
298 * Let's be a bit picky about the flags...
299 */
300 if (fOpen != (FREAD|FWRITE /*=O_RDWR*/))
301 {
302 dprintf(("VBoxDrvFreeBSDOpen: fOpen=%#x expected %#x\n", fOpen, O_RDWR));
303 return EINVAL;
304 }
305
306 /*
307 * Try grab it (we don't grab the giant, remember).
308 */
309 if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, (void *)0x42, NULL))
310 return EBUSY;
311
312 /*
313 * Create a new session.
314 */
315 rc = supdrvCreateSession(&g_VBoxDrvFreeBSDDevExt, true /* fUser */, &pSession);
316 if (RT_SUCCESS(rc))
317 {
318 /** @todo get (r)uid and (r)gid.
319 pSession->Uid = stuff;
320 pSession->Gid = stuff; */
321 if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42))
322 {
323 ASMAtomicIncU32(&g_cUsers);
324 return 0;
325 }
326
327 OSDBGPRINT(("VBoxDrvFreeBSDOpen: si_drv1=%p, expected 0x42!\n", pDev->si_drv1));
328 supdrvCloseSession(&g_VBoxDrvFreeBSDDevExt, pSession);
329 }
330
331 return RTErrConvertToErrno(rc);
332}
333
334
335/**
336 * Close a file device previously opened by VBoxDrvFreeBSDOpen
337 *
338 * @returns 0 on success.
339 * @param pDev The device.
340 * @param fFile The file descriptor flags.
341 * @param DevType The device type (CHR.
342 * @param pTd The calling thread.
343 */
344static int VBoxDrvFreeBSDClose(struct cdev *pDev, int fFile, int DevType, struct thread *pTd)
345{
346 PSUPDRVSESSION pSession = (PSUPDRVSESSION)pDev->si_drv1;
347#if __FreeBSD_version < 800062
348 dprintf(("VBoxDrvFreeBSDClose: fFile=%#x iUnit=%d pSession=%p\n", fFile, minor2unit(minor(pDev)), pSession));
349#else
350 dprintf(("VBoxDrvFreeBSDClose: fFile=%#x iUnit=%d pSession=%p\n", fFile, minor(pDev), pSession));
351#endif
352
353 /*
354 * Close the session if it's still hanging on to the device...
355 */
356 if (VALID_PTR(pSession))
357 {
358 supdrvCloseSession(&g_VBoxDrvFreeBSDDevExt, pSession);
359 if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, NULL, pSession))
360 OSDBGPRINT(("VBoxDrvFreeBSDClose: si_drv1=%p expected %p!\n", pDev->si_drv1, pSession));
361 ASMAtomicDecU32(&g_cUsers);
362 /* Don't use destroy_dev here because it may sleep resulting in a hanging user process. */
363 destroy_dev_sched(pDev);
364 }
365 else
366 OSDBGPRINT(("VBoxDrvFreeBSDClose: si_drv1=%p!\n", pSession));
367 return 0;
368}
369
370
371/**
372 * I/O control request.
373 *
374 * @returns depends...
375 * @param pDev The device.
376 * @param ulCmd The command.
377 * @param pvData Pointer to the data.
378 * @param fFile The file descriptor flags.
379 * @param pTd The calling thread.
380 */
381static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd)
382{
383 /*
384 * Validate the input.
385 */
386 PSUPDRVSESSION pSession = (PSUPDRVSESSION)pDev->si_drv1;
387 if (RT_UNLIKELY(!VALID_PTR(pSession)))
388 return EINVAL;
389
390 /*
391 * Deal with the fast ioctl path first.
392 */
393 if ( ulCmd == SUP_IOCTL_FAST_DO_RAW_RUN
394 || ulCmd == SUP_IOCTL_FAST_DO_HWACC_RUN
395 || ulCmd == SUP_IOCTL_FAST_DO_NOP)
396 return supdrvIOCtlFast(ulCmd, *(uint32_t *)pvData, &g_VBoxDrvFreeBSDDevExt, pSession);
397
398 return VBoxDrvFreeBSDIOCtlSlow(pSession, ulCmd, pvData, pTd);
399}
400
401
402/**
403 * Deal with the 'slow' I/O control requests.
404 *
405 * @returns 0 on success, appropriate errno on failure.
406 * @param pSession The session.
407 * @param ulCmd The command.
408 * @param pvData The request data.
409 * @param pTd The calling thread.
410 */
411static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd)
412{
413 PSUPREQHDR pHdr;
414 uint32_t cbReq = IOCPARM_LEN(ulCmd);
415 void *pvUser = NULL;
416
417 /*
418 * Buffered request?
419 */
420 if ((IOC_DIRMASK & ulCmd) == IOC_INOUT)
421 {
422 pHdr = (PSUPREQHDR)pvData;
423 if (RT_UNLIKELY(cbReq < sizeof(*pHdr)))
424 {
425 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: cbReq=%#x < %#x; ulCmd=%#lx\n", cbReq, (int)sizeof(*pHdr), ulCmd));
426 return EINVAL;
427 }
428 if (RT_UNLIKELY((pHdr->fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC))
429 {
430 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: bad magic fFlags=%#x; ulCmd=%#lx\n", pHdr->fFlags, ulCmd));
431 return EINVAL;
432 }
433 if (RT_UNLIKELY( RT_MAX(pHdr->cbIn, pHdr->cbOut) != cbReq
434 || pHdr->cbIn < sizeof(*pHdr)
435 || pHdr->cbOut < sizeof(*pHdr)))
436 {
437 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: max(%#x,%#x) != %#x; ulCmd=%#lx\n", pHdr->cbIn, pHdr->cbOut, cbReq, ulCmd));
438 return EINVAL;
439 }
440 }
441 /*
442 * Big unbuffered request?
443 */
444 else if ((IOC_DIRMASK & ulCmd) == IOC_VOID && !cbReq)
445 {
446 /*
447 * Read the header, validate it and figure out how much that needs to be buffered.
448 */
449 SUPREQHDR Hdr;
450 pvUser = *(void **)pvData;
451 int rc = copyin(pvUser, &Hdr, sizeof(Hdr));
452 if (RT_UNLIKELY(rc))
453 {
454 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,Hdr,) -> %#x; ulCmd=%#lx\n", pvUser, rc, ulCmd));
455 return rc;
456 }
457 if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC))
458 {
459 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: bad magic fFlags=%#x; ulCmd=%#lx\n", Hdr.fFlags, ulCmd));
460 return EINVAL;
461 }
462 cbReq = RT_MAX(Hdr.cbIn, Hdr.cbOut);
463 if (RT_UNLIKELY( Hdr.cbIn < sizeof(Hdr)
464 || Hdr.cbOut < sizeof(Hdr)
465 || cbReq > _1M*16))
466 {
467 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: max(%#x,%#x); ulCmd=%#lx\n", Hdr.cbIn, Hdr.cbOut, ulCmd));
468 return EINVAL;
469 }
470
471 /*
472 * Allocate buffer and copy in the data.
473 */
474 pHdr = (PSUPREQHDR)RTMemTmpAlloc(cbReq);
475 if (RT_UNLIKELY(!pHdr))
476 {
477 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd));
478 return ENOMEM;
479 }
480 rc = copyin(pvUser, pHdr, Hdr.cbIn);
481 if (RT_UNLIKELY(rc))
482 {
483 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,%p,%#x) -> %#x; ulCmd=%#lx\n",
484 pvUser, pHdr, Hdr.cbIn, rc, ulCmd));
485 RTMemTmpFree(pHdr);
486 return rc;
487 }
488 }
489 else
490 {
491 dprintf(("VBoxDrvFreeBSDIOCtlSlow: huh? cbReq=%#x ulCmd=%#lx\n", cbReq, ulCmd));
492 return EINVAL;
493 }
494
495 /*
496 * Process the IOCtl.
497 */
498 int rc = supdrvIOCtl(ulCmd, &g_VBoxDrvFreeBSDDevExt, pSession, pHdr);
499 if (RT_LIKELY(!rc))
500 {
501 /*
502 * If unbuffered, copy back the result before returning.
503 */
504 if (pvUser)
505 {
506 uint32_t cbOut = pHdr->cbOut;
507 if (cbOut > cbReq)
508 {
509 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd));
510 cbOut = cbReq;
511 }
512 rc = copyout(pHdr, pvUser, cbOut);
513 if (RT_UNLIKELY(rc))
514 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyout(%p,%p,%#x) -> %d; uCmd=%#lx!\n", pHdr, pvUser, cbOut, rc, ulCmd));
515
516 dprintf(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd));
517
518 /* cleanup */
519 RTMemTmpFree(pHdr);
520 }
521 }
522 else
523 {
524 /*
525 * The request failed, just clean up.
526 */
527 if (pvUser)
528 RTMemTmpFree(pHdr);
529
530 dprintf(("VBoxDrvFreeBSDIOCtlSlow: ulCmd=%lx pData=%p failed, rc=%d\n", ulCmd, pvData, rc));
531 rc = EINVAL;
532 }
533
534 return rc;
535}
536
537
538/**
539 * The SUPDRV IDC entry point.
540 *
541 * @returns VBox status code, see supdrvIDC.
542 * @param iReq The request code.
543 * @param pReq The request.
544 */
545int VBOXCALL SUPDrvFreeBSDIDC(uint32_t uReq, PSUPDRVIDCREQHDR pReq)
546{
547 PSUPDRVSESSION pSession;
548
549 /*
550 * Some quick validations.
551 */
552 if (RT_UNLIKELY(!VALID_PTR(pReq)))
553 return VERR_INVALID_POINTER;
554
555 pSession = pReq->pSession;
556 if (pSession)
557 {
558 if (RT_UNLIKELY(!VALID_PTR(pReq->pSession)))
559 return VERR_INVALID_PARAMETER;
560 if (RT_UNLIKELY(pSession->pDevExt != &g_VBoxDrvFreeBSDDevExt))
561 return VERR_INVALID_PARAMETER;
562 }
563 else if (RT_UNLIKELY(uReq != SUPDRV_IDC_REQ_CONNECT))
564 return VERR_INVALID_PARAMETER;
565
566 /*
567 * Do the job.
568 */
569 return supdrvIDC(uReq, &g_VBoxDrvFreeBSDDevExt, pSession, pReq);
570}
571
572
573void VBOXCALL supdrvOSObjInitCreator(PSUPDRVOBJ pObj, PSUPDRVSESSION pSession)
574{
575 NOREF(pObj);
576 NOREF(pSession);
577}
578
579
580bool VBOXCALL supdrvOSObjCanAccess(PSUPDRVOBJ pObj, PSUPDRVSESSION pSession, const char *pszObjName, int *prc)
581{
582 NOREF(pObj);
583 NOREF(pSession);
584 NOREF(pszObjName);
585 NOREF(prc);
586 return false;
587}
588
589
590bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDEVEXT pDevExt)
591{
592 return false;
593}
594
595
596SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...)
597{
598 va_list va;
599 char szMsg[256];
600 int cch;
601
602 va_start(va, pszFormat);
603 cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va);
604 va_end(va);
605
606 printf("%s", szMsg);
607
608 return cch;
609}
610
Note: See TracBrowser for help on using the repository browser.

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