1 | /* $Id: DrvAcpiCpu.cpp 25966 2010-01-22 11:15:43Z 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 | */
|
---|
39 | static DECLCALLBACK(void *) drvACPICpuQueryInterface(PPDMIBASE pInterface, const char *pszIID)
|
---|
40 | {
|
---|
41 | PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
|
---|
42 | if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
|
---|
43 | return &pDrvIns->IBase;
|
---|
44 | return NULL;
|
---|
45 | }
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * Destruct a driver instance.
|
---|
49 | *
|
---|
50 | * Most VM resources are freed by the VM. This callback is provided so that any non-VM
|
---|
51 | * resources can be freed correctly.
|
---|
52 | *
|
---|
53 | * @param pDrvIns The driver instance data.
|
---|
54 | */
|
---|
55 | static DECLCALLBACK(void) drvACPICpuDestruct(PPDMDRVINS pDrvIns)
|
---|
56 | {
|
---|
57 | LogFlow(("drvACPICpuDestruct\n"));
|
---|
58 | }
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * Construct an ACPI CPU driver instance.
|
---|
62 | *
|
---|
63 | * @copydoc FNPDMDRVCONSTRUCT
|
---|
64 | */
|
---|
65 | static DECLCALLBACK(int) drvACPICpuConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
|
---|
66 | {
|
---|
67 | /*
|
---|
68 | * Init the static parts.
|
---|
69 | */
|
---|
70 | /* IBase */
|
---|
71 | pDrvIns->IBase.pfnQueryInterface = drvACPICpuQueryInterface;
|
---|
72 |
|
---|
73 | /*
|
---|
74 | * Validate the config.
|
---|
75 | */
|
---|
76 | if (!CFGMR3AreValuesValid(pCfgHandle, "\0"))
|
---|
77 | return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
|
---|
78 |
|
---|
79 | /*
|
---|
80 | * Check that no-one is attached to us.
|
---|
81 | */
|
---|
82 | AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
|
---|
83 | ("Configuration error: Not possible to attach anything to this driver!\n"),
|
---|
84 | VERR_PDM_DRVINS_NO_ATTACH);
|
---|
85 |
|
---|
86 | return VINF_SUCCESS;
|
---|
87 | }
|
---|
88 |
|
---|
89 | /**
|
---|
90 | * ACPI CPU driver registration record.
|
---|
91 | */
|
---|
92 | const PDMDRVREG g_DrvAcpiCpu =
|
---|
93 | {
|
---|
94 | /* u32Version */
|
---|
95 | PDM_DRVREG_VERSION,
|
---|
96 | /* szDriverName */
|
---|
97 | "ACPICpu",
|
---|
98 | /* szRCMod */
|
---|
99 | "",
|
---|
100 | /* szR0Mod */
|
---|
101 | "",
|
---|
102 | /* pszDescription */
|
---|
103 | "ACPI CPU Driver",
|
---|
104 | /* fFlags */
|
---|
105 | PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT,
|
---|
106 | /* fClass. */
|
---|
107 | PDM_DRVREG_CLASS_ACPI,
|
---|
108 | /* cMaxInstances */
|
---|
109 | ~0,
|
---|
110 | /* cbInstance */
|
---|
111 | sizeof(PDMDRVINS),
|
---|
112 | /* pfnConstruct */
|
---|
113 | drvACPICpuConstruct,
|
---|
114 | /* pfnDestruct */
|
---|
115 | drvACPICpuDestruct,
|
---|
116 | /* pfnRelocate */
|
---|
117 | NULL,
|
---|
118 | /* pfnIOCtl */
|
---|
119 | NULL,
|
---|
120 | /* pfnPowerOn */
|
---|
121 | NULL,
|
---|
122 | /* pfnReset */
|
---|
123 | NULL,
|
---|
124 | /* pfnSuspend */
|
---|
125 | NULL,
|
---|
126 | /* pfnResume */
|
---|
127 | NULL,
|
---|
128 | /* pfnAttach */
|
---|
129 | NULL,
|
---|
130 | /* pfnDetach */
|
---|
131 | NULL,
|
---|
132 | /* pfnPowerOff */
|
---|
133 | NULL,
|
---|
134 | /* pfnSoftReset */
|
---|
135 | NULL,
|
---|
136 | /* u32EndVersion */
|
---|
137 | PDM_DRVREG_VERSION
|
---|
138 | };
|
---|