VirtualBox

source: vbox/trunk/src/VBox/Devices/PC/DrvAcpiCpu.cpp@ 26831

Last change on this file since 26831 was 26173, checked in by vboxsync, 15 years ago

PDM: s/pCfgHandle/pCfg/g - part 2.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/* $Id: DrvAcpiCpu.cpp 26173 2010-02-02 21:11:09Z vboxsync $ */
2/** @file
3 * DrvAcpiCpu - ACPI CPU dummy driver for hotplugging.
4 */
5
6/*
7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22/*******************************************************************************
23* Header Files *
24*******************************************************************************/
25#define LOG_GROUP LOG_GROUP_DRV_ACPI
26
27#include <VBox/pdmdrv.h>
28#include <VBox/log.h>
29#include <iprt/assert.h>
30#include <iprt/string.h>
31#include <iprt/uuid.h>
32
33#include "Builtins.h"
34
35
36/**
37 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
38 */
39static DECLCALLBACK(void *) drvACPICpuQueryInterface(PPDMIBASE pInterface, const char *pszIID)
40{
41 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
42 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
43 return NULL;
44}
45
46/**
47 * Destruct a driver instance.
48 *
49 * Most VM resources are freed by the VM. This callback is provided so that any non-VM
50 * resources can be freed correctly.
51 *
52 * @param pDrvIns The driver instance data.
53 */
54static DECLCALLBACK(void) drvACPICpuDestruct(PPDMDRVINS pDrvIns)
55{
56 LogFlow(("drvACPICpuDestruct\n"));
57 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
58}
59
60/**
61 * Construct an ACPI CPU driver instance.
62 *
63 * @copydoc FNPDMDRVCONSTRUCT
64 */
65static DECLCALLBACK(int) drvACPICpuConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
66{
67 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
68
69 /*
70 * Init the static parts.
71 */
72 /* IBase */
73 pDrvIns->IBase.pfnQueryInterface = drvACPICpuQueryInterface;
74
75 /*
76 * Validate the config.
77 */
78 if (!CFGMR3AreValuesValid(pCfg, "\0"))
79 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
80
81 /*
82 * Check that no-one is attached to us.
83 */
84 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
85 ("Configuration error: Not possible to attach anything to this driver!\n"),
86 VERR_PDM_DRVINS_NO_ATTACH);
87
88 return VINF_SUCCESS;
89}
90
91/**
92 * ACPI CPU driver registration record.
93 */
94const PDMDRVREG g_DrvAcpiCpu =
95{
96 /* u32Version */
97 PDM_DRVREG_VERSION,
98 /* szName */
99 "ACPICpu",
100 /* szRCMod */
101 "",
102 /* szR0Mod */
103 "",
104 /* pszDescription */
105 "ACPI CPU Driver",
106 /* fFlags */
107 PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT,
108 /* fClass. */
109 PDM_DRVREG_CLASS_ACPI,
110 /* cMaxInstances */
111 ~0,
112 /* cbInstance */
113 sizeof(PDMDRVINS),
114 /* pfnConstruct */
115 drvACPICpuConstruct,
116 /* pfnDestruct */
117 drvACPICpuDestruct,
118 /* pfnRelocate */
119 NULL,
120 /* pfnIOCtl */
121 NULL,
122 /* pfnPowerOn */
123 NULL,
124 /* pfnReset */
125 NULL,
126 /* pfnSuspend */
127 NULL,
128 /* pfnResume */
129 NULL,
130 /* pfnAttach */
131 NULL,
132 /* pfnDetach */
133 NULL,
134 /* pfnPowerOff */
135 NULL,
136 /* pfnSoftReset */
137 NULL,
138 /* u32EndVersion */
139 PDM_DRVREG_VERSION
140};
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