VirtualBox

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

Last change on this file since 78125 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/* $Id: DrvAcpiCpu.cpp 76553 2019-01-01 01:45:53Z vboxsync $ */
2/** @file
3 * DrvAcpiCpu - ACPI CPU dummy driver for hotplugging.
4 */
5
6/*
7 * Copyright (C) 2006-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 LOG_GROUP LOG_GROUP_DRV_ACPI
23
24#include <VBox/vmm/pdmdrv.h>
25#include <VBox/log.h>
26#include <iprt/assert.h>
27#include <iprt/string.h>
28#include <iprt/uuid.h>
29
30#include "VBoxDD.h"
31
32
33/**
34 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
35 */
36static DECLCALLBACK(void *) drvACPICpuQueryInterface(PPDMIBASE pInterface, const char *pszIID)
37{
38 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
39 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
40 return NULL;
41}
42
43/**
44 * Construct an ACPI CPU driver instance.
45 *
46 * @copydoc FNPDMDRVCONSTRUCT
47 */
48static DECLCALLBACK(int) drvACPICpuConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
49{
50 RT_NOREF(fFlags);
51 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
52
53 /*
54 * Init the static parts.
55 */
56 /* IBase */
57 pDrvIns->IBase.pfnQueryInterface = drvACPICpuQueryInterface;
58
59 /*
60 * Validate the config.
61 */
62 if (!CFGMR3AreValuesValid(pCfg, "\0"))
63 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
64
65 /*
66 * Check that no-one is attached to us.
67 */
68 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
69 ("Configuration error: Not possible to attach anything to this driver!\n"),
70 VERR_PDM_DRVINS_NO_ATTACH);
71
72 return VINF_SUCCESS;
73}
74
75/**
76 * ACPI CPU driver registration record.
77 */
78const PDMDRVREG g_DrvAcpiCpu =
79{
80 /* u32Version */
81 PDM_DRVREG_VERSION,
82 /* szName */
83 "ACPICpu",
84 /* szRCMod */
85 "",
86 /* szR0Mod */
87 "",
88 /* pszDescription */
89 "ACPI CPU Driver",
90 /* fFlags */
91 PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT,
92 /* fClass. */
93 PDM_DRVREG_CLASS_ACPI,
94 /* cMaxInstances */
95 ~0U,
96 /* cbInstance */
97 sizeof(PDMDRVINS),
98 /* pfnConstruct */
99 drvACPICpuConstruct,
100 /* pfnDestruct */
101 NULL,
102 /* pfnRelocate */
103 NULL,
104 /* pfnIOCtl */
105 NULL,
106 /* pfnPowerOn */
107 NULL,
108 /* pfnReset */
109 NULL,
110 /* pfnSuspend */
111 NULL,
112 /* pfnResume */
113 NULL,
114 /* pfnAttach */
115 NULL,
116 /* pfnDetach */
117 NULL,
118 /* pfnPowerOff */
119 NULL,
120 /* pfnSoftReset */
121 NULL,
122 /* u32EndVersion */
123 PDM_DRVREG_VERSION
124};
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