1 | /* $Id: DrvAcpiCpu.cpp 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * DrvAcpiCpu - ACPI CPU dummy driver for hotplugging.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 |
|
---|
29 | /*********************************************************************************************************************************
|
---|
30 | * Header Files *
|
---|
31 | *********************************************************************************************************************************/
|
---|
32 | #define LOG_GROUP LOG_GROUP_DRV_ACPI
|
---|
33 |
|
---|
34 | #include <VBox/vmm/pdmdrv.h>
|
---|
35 | #include <VBox/log.h>
|
---|
36 | #include <iprt/assert.h>
|
---|
37 | #include <iprt/string.h>
|
---|
38 | #include <iprt/uuid.h>
|
---|
39 |
|
---|
40 | #include "VBoxDD.h"
|
---|
41 |
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * @interface_method_impl{PDMIBASE,pfnQueryInterface}
|
---|
45 | */
|
---|
46 | static DECLCALLBACK(void *) drvACPICpuQueryInterface(PPDMIBASE pInterface, const char *pszIID)
|
---|
47 | {
|
---|
48 | PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
|
---|
49 | PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
|
---|
50 | return NULL;
|
---|
51 | }
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * Construct an ACPI CPU driver instance.
|
---|
55 | *
|
---|
56 | * @copydoc FNPDMDRVCONSTRUCT
|
---|
57 | */
|
---|
58 | static DECLCALLBACK(int) drvACPICpuConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
|
---|
59 | {
|
---|
60 | RT_NOREF(pCfg, fFlags);
|
---|
61 | PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
|
---|
62 |
|
---|
63 | /*
|
---|
64 | * Init the static parts.
|
---|
65 | */
|
---|
66 | /* IBase */
|
---|
67 | pDrvIns->IBase.pfnQueryInterface = drvACPICpuQueryInterface;
|
---|
68 |
|
---|
69 | /*
|
---|
70 | * Validate the config.
|
---|
71 | */
|
---|
72 | PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, "", "");
|
---|
73 |
|
---|
74 | /*
|
---|
75 | * Check that no-one is attached to us.
|
---|
76 | */
|
---|
77 | AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
|
---|
78 | ("Configuration error: Not possible to attach anything to this driver!\n"),
|
---|
79 | VERR_PDM_DRVINS_NO_ATTACH);
|
---|
80 |
|
---|
81 | return VINF_SUCCESS;
|
---|
82 | }
|
---|
83 |
|
---|
84 | /**
|
---|
85 | * ACPI CPU driver registration record.
|
---|
86 | */
|
---|
87 | const PDMDRVREG g_DrvAcpiCpu =
|
---|
88 | {
|
---|
89 | /* u32Version */
|
---|
90 | PDM_DRVREG_VERSION,
|
---|
91 | /* szName */
|
---|
92 | "ACPICpu",
|
---|
93 | /* szRCMod */
|
---|
94 | "",
|
---|
95 | /* szR0Mod */
|
---|
96 | "",
|
---|
97 | /* pszDescription */
|
---|
98 | "ACPI CPU Driver",
|
---|
99 | /* fFlags */
|
---|
100 | PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT,
|
---|
101 | /* fClass. */
|
---|
102 | PDM_DRVREG_CLASS_ACPI,
|
---|
103 | /* cMaxInstances */
|
---|
104 | ~0U,
|
---|
105 | /* cbInstance */
|
---|
106 | sizeof(PDMDRVINS),
|
---|
107 | /* pfnConstruct */
|
---|
108 | drvACPICpuConstruct,
|
---|
109 | /* pfnDestruct */
|
---|
110 | NULL,
|
---|
111 | /* pfnRelocate */
|
---|
112 | NULL,
|
---|
113 | /* pfnIOCtl */
|
---|
114 | NULL,
|
---|
115 | /* pfnPowerOn */
|
---|
116 | NULL,
|
---|
117 | /* pfnReset */
|
---|
118 | NULL,
|
---|
119 | /* pfnSuspend */
|
---|
120 | NULL,
|
---|
121 | /* pfnResume */
|
---|
122 | NULL,
|
---|
123 | /* pfnAttach */
|
---|
124 | NULL,
|
---|
125 | /* pfnDetach */
|
---|
126 | NULL,
|
---|
127 | /* pfnPowerOff */
|
---|
128 | NULL,
|
---|
129 | /* pfnSoftReset */
|
---|
130 | NULL,
|
---|
131 | /* u32EndVersion */
|
---|
132 | PDM_DRVREG_VERSION
|
---|
133 | };
|
---|