VirtualBox

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

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

pdmifs.h: the final batch of refactored interface ID code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Id: DrvAcpiCpu.cpp 25985 2010-01-23 00:51:04Z 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.215389.xyz. 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}
58
59/**
60 * Construct an ACPI CPU driver instance.
61 *
62 * @copydoc FNPDMDRVCONSTRUCT
63 */
64static DECLCALLBACK(int) drvACPICpuConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
65{
66 /*
67 * Init the static parts.
68 */
69 /* IBase */
70 pDrvIns->IBase.pfnQueryInterface = drvACPICpuQueryInterface;
71
72 /*
73 * Validate the config.
74 */
75 if (!CFGMR3AreValuesValid(pCfgHandle, "\0"))
76 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
77
78 /*
79 * Check that no-one is attached to us.
80 */
81 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
82 ("Configuration error: Not possible to attach anything to this driver!\n"),
83 VERR_PDM_DRVINS_NO_ATTACH);
84
85 return VINF_SUCCESS;
86}
87
88/**
89 * ACPI CPU driver registration record.
90 */
91const PDMDRVREG g_DrvAcpiCpu =
92{
93 /* u32Version */
94 PDM_DRVREG_VERSION,
95 /* szDriverName */
96 "ACPICpu",
97 /* szRCMod */
98 "",
99 /* szR0Mod */
100 "",
101 /* pszDescription */
102 "ACPI CPU Driver",
103 /* fFlags */
104 PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT,
105 /* fClass. */
106 PDM_DRVREG_CLASS_ACPI,
107 /* cMaxInstances */
108 ~0,
109 /* cbInstance */
110 sizeof(PDMDRVINS),
111 /* pfnConstruct */
112 drvACPICpuConstruct,
113 /* pfnDestruct */
114 drvACPICpuDestruct,
115 /* pfnRelocate */
116 NULL,
117 /* pfnIOCtl */
118 NULL,
119 /* pfnPowerOn */
120 NULL,
121 /* pfnReset */
122 NULL,
123 /* pfnSuspend */
124 NULL,
125 /* pfnResume */
126 NULL,
127 /* pfnAttach */
128 NULL,
129 /* pfnDetach */
130 NULL,
131 /* pfnPowerOff */
132 NULL,
133 /* pfnSoftReset */
134 NULL,
135 /* u32EndVersion */
136 PDM_DRVREG_VERSION
137};
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette