VirtualBox

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

Last change on this file since 43673 was 40282, checked in by vboxsync, 13 years ago

*: gcc-4.7: ~0 => ~0U in initializers (warning: narrowing conversion of -1' from int' to `unsigned int' inside { } is ill-formed in C++11 [-Wnarrowing])

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