VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMR0/PDMR0Driver.cpp@ 80274

Last change on this file since 80274 was 80274, checked in by vboxsync, 5 years ago

VMM: Refactoring VMMR0/* and VMMRZ/* to use VMCC & VMMCPUCC. bugref:9217

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1/* $Id: PDMR0Driver.cpp 80274 2019-08-14 14:34:38Z vboxsync $ */
2/** @file
3 * PDM - Pluggable Device and Driver Manager, R0 Driver parts.
4 */
5
6/*
7 * Copyright (C) 2010-2019 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 VBOX_BUGREF_9217_PART_I
23#define LOG_GROUP LOG_GROUP_PDM_DRIVER
24#include "PDMInternal.h"
25#include <VBox/vmm/pdm.h>
26#include <VBox/vmm/vmcc.h>
27#include <VBox/vmm/gvmm.h>
28
29#include <VBox/log.h>
30#include <iprt/errcore.h>
31#include <iprt/assert.h>
32
33
34
35/**
36 * PDMDrvHlpCallR0 helper.
37 *
38 * @returns See PFNPDMDRVREQHANDLERR0.
39 * @param pGVM The global (ring-0) VM structure. (For validation.)
40 * @param pVM The cross context VM structure. (For validation.)
41 * @param pReq Pointer to the request buffer.
42 */
43VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(PGVM pGVM, PVMCC pVM, PPDMDRIVERCALLREQHANDLERREQ pReq)
44{
45 /*
46 * Validate input and make the call.
47 */
48 int rc = GVMMR0ValidateGVMandVM(pGVM, pVM);
49 if (RT_SUCCESS(rc))
50 {
51 AssertPtrReturn(pReq, VERR_INVALID_POINTER);
52 AssertMsgReturn(pReq->Hdr.cbReq == sizeof(*pReq), ("%#x != %#x\n", pReq->Hdr.cbReq, sizeof(*pReq)), VERR_INVALID_PARAMETER);
53
54 PPDMDRVINS pDrvIns = pReq->pDrvInsR0;
55 AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER);
56 AssertReturn(pDrvIns->Internal.s.pVMR0 == pVM, VERR_INVALID_PARAMETER);
57
58 PFNPDMDRVREQHANDLERR0 pfnReqHandlerR0 = pDrvIns->Internal.s.pfnReqHandlerR0;
59 AssertPtrReturn(pfnReqHandlerR0, VERR_INVALID_POINTER);
60
61 rc = pfnReqHandlerR0(pDrvIns, pReq->uOperation, pReq->u64Arg);
62 }
63 return rc;
64}
65
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