VirtualBox

source: vbox/trunk/src/VBox/Devices/build/VBoxDD.cpp@ 45733

Last change on this file since 45733 was 44575, checked in by vboxsync, 12 years ago

Making VBOX_WITH_OVMF default, removing the old #else cases.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.8 KB
Line 
1/* $Id: VBoxDD.cpp 44575 2013-02-06 18:21:17Z vboxsync $ */
2/** @file
3 * VBoxDD - Built-in drivers & devices (part 1).
4 */
5
6/*
7 * Copyright (C) 2006-2012 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_DEV
23#include <VBox/vmm/pdm.h>
24#include <VBox/version.h>
25#include <VBox/err.h>
26#include <VBox/usb.h>
27
28#include <VBox/log.h>
29#include <iprt/assert.h>
30
31#include "VBoxDD.h"
32
33
34/*******************************************************************************
35* Global Variables *
36*******************************************************************************/
37const void *g_apvVBoxDDDependencies[] =
38{
39 NULL,
40};
41
42
43/**
44 * Register builtin devices.
45 *
46 * @returns VBox status code.
47 * @param pCallbacks Pointer to the callback table.
48 * @param u32Version VBox version number.
49 */
50extern "C" DECLEXPORT(int) VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
51{
52 LogFlow(("VBoxDevicesRegister: u32Version=%#x\n", u32Version));
53 AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
54 int rc;
55
56 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCI);
57 if (RT_FAILURE(rc))
58 return rc;
59 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciIch9);
60 if (RT_FAILURE(rc))
61 return rc;
62 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcArch);
63 if (RT_FAILURE(rc))
64 return rc;
65 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcBios);
66 if (RT_FAILURE(rc))
67 return rc;
68 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePS2KeyboardMouse);
69 if (RT_FAILURE(rc))
70 return rc;
71 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePIIX3IDE);
72 if (RT_FAILURE(rc))
73 return rc;
74 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8254);
75 if (RT_FAILURE(rc))
76 return rc;
77 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8259);
78 if (RT_FAILURE(rc))
79 return rc;
80 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceHPET);
81 if (RT_FAILURE(rc))
82 return rc;
83#ifdef VBOX_WITH_EFI
84 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEFI);
85 if (RT_FAILURE(rc))
86 return rc;
87#endif
88 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceMC146818);
89 if (RT_FAILURE(rc))
90 return rc;
91 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVga);
92 if (RT_FAILURE(rc))
93 return rc;
94 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVMMDev);
95 if (RT_FAILURE(rc))
96 return rc;
97 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCNet);
98 if (RT_FAILURE(rc))
99 return rc;
100#ifdef VBOX_WITH_E1000
101 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceE1000);
102 if (RT_FAILURE(rc))
103 return rc;
104#endif
105#ifdef VBOX_WITH_VIRTIO
106 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVirtioNet);
107 if (RT_FAILURE(rc))
108 return rc;
109#endif
110#ifdef VBOX_WITH_INIP
111 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceINIP);
112 if (RT_FAILURE(rc))
113 return rc;
114#endif
115 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceICHAC97);
116 if (RT_FAILURE(rc))
117 return rc;
118 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSB16);
119 if (RT_FAILURE(rc))
120 return rc;
121 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceICH6_HDA);
122 if (RT_FAILURE(rc))
123 return rc;
124 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAudioSniffer);
125 if (RT_FAILURE(rc))
126 return rc;
127#ifdef VBOX_WITH_VUSB
128 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceOHCI);
129 if (RT_FAILURE(rc))
130 return rc;
131#endif
132#ifdef VBOX_WITH_EHCI_IMPL
133 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEHCI);
134 if (RT_FAILURE(rc))
135 return rc;
136#endif
137#ifdef VBOX_ACPI
138 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceACPI);
139 if (RT_FAILURE(rc))
140 return rc;
141#endif
142 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceDMA);
143 if (RT_FAILURE(rc))
144 return rc;
145 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceFloppyController);
146 if (RT_FAILURE(rc))
147 return rc;
148 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSerialPort);
149 if (RT_FAILURE(rc))
150 return rc;
151 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceParallelPort);
152 if (RT_FAILURE(rc))
153 return rc;
154#ifdef VBOX_WITH_AHCI
155 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAHCI);
156 if (RT_FAILURE(rc))
157 return rc;
158#endif
159#ifdef VBOX_WITH_BUSLOGIC
160 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceBusLogic);
161 if (RT_FAILURE(rc))
162 return rc;
163#endif
164 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCIBridge);
165 if (RT_FAILURE(rc))
166 return rc;
167 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciIch9Bridge);
168 if (RT_FAILURE(rc))
169 return rc;
170#ifdef VBOX_WITH_LSILOGIC
171 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLsiLogicSCSI);
172 if (RT_FAILURE(rc))
173 return rc;
174 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLsiLogicSAS);
175 if (RT_FAILURE(rc))
176 return rc;
177#endif
178
179#ifdef VBOX_WITH_PCI_PASSTHROUGH_IMPL
180 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciRaw);
181 if (RT_FAILURE(rc))
182 return rc;
183#endif
184
185 return VINF_SUCCESS;
186}
187
188
189/**
190 * Register builtin drivers.
191 *
192 * @returns VBox status code.
193 * @param pCallbacks Pointer to the callback table.
194 * @param u32Version VBox version number.
195 */
196extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
197{
198 LogFlow(("VBoxDriversRegister: u32Version=%#x\n", u32Version));
199 AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
200
201 int rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMouseQueue);
202 if (RT_FAILURE(rc))
203 return rc;
204 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvKeyboardQueue);
205 if (RT_FAILURE(rc))
206 return rc;
207 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvBlock);
208 if (RT_FAILURE(rc))
209 return rc;
210 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVD);
211 if (RT_FAILURE(rc))
212 return rc;
213#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
214 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDVD);
215 if (RT_FAILURE(rc))
216 return rc;
217#endif
218#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
219 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostFloppy);
220 if (RT_FAILURE(rc))
221 return rc;
222#endif
223 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMediaISO);
224 if (RT_FAILURE(rc))
225 return rc;
226 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawImage);
227 if (RT_FAILURE(rc))
228 return rc;
229 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNAT);
230 if (RT_FAILURE(rc))
231 return rc;
232#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
233 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostInterface);
234 if (RT_FAILURE(rc))
235 return rc;
236#endif
237#ifdef VBOX_WITH_UDPTUNNEL
238 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvUDPTunnel);
239 if (RT_FAILURE(rc))
240 return rc;
241#endif
242#ifdef VBOX_WITH_VDE
243 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVDE);
244 if (RT_FAILURE(rc))
245 return rc;
246#endif
247 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvIntNet);
248 if (RT_FAILURE(rc))
249 return rc;
250 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDedicatedNic);
251 if (RT_FAILURE(rc))
252 return rc;
253 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetSniffer);
254 if (RT_FAILURE(rc))
255 return rc;
256#ifdef VBOX_WITH_NETSHAPER
257 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetShaper);
258 if (RT_FAILURE(rc))
259 return rc;
260#endif /* VBOX_WITH_NETSHAPER */
261 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAUDIO);
262 if (RT_FAILURE(rc))
263 return rc;
264 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvACPI);
265 if (RT_FAILURE(rc))
266 return rc;
267 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAcpiCpu);
268 if (RT_FAILURE(rc))
269 return rc;
270
271#ifdef VBOX_WITH_VUSB
272 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVUSBRootHub);
273 if (RT_FAILURE(rc))
274 return rc;
275#endif
276
277 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNamedPipe);
278 if (RT_FAILURE(rc))
279 return rc;
280 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawFile);
281 if (RT_FAILURE(rc))
282 return rc;
283 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvChar);
284 if (RT_FAILURE(rc))
285 return rc;
286
287#if defined(RT_OS_LINUX) || defined(VBOX_WITH_WIN_PARPORT_SUP)
288 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostParallel);
289 if (RT_FAILURE(rc))
290 return rc;
291#endif
292
293#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
294 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSerial);
295 if (RT_FAILURE(rc))
296 return rc;
297#endif
298
299#ifdef VBOX_WITH_SCSI
300 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvSCSI);
301 if (RT_FAILURE(rc))
302 return rc;
303
304# if defined(RT_OS_LINUX)
305 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvSCSIHost);
306 if (RT_FAILURE(rc))
307 return rc;
308# endif
309
310#endif
311
312#ifdef VBOX_WITH_DRV_DISK_INTEGRITY
313 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDiskIntegrity);
314 if (RT_FAILURE(rc))
315 return rc;
316#endif
317
318#ifdef VBOX_WITH_PCI_PASSTHROUGH_IMPL
319 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvPciRaw);
320 if (RT_FAILURE(rc))
321 return rc;
322#endif
323
324 return VINF_SUCCESS;
325}
326
327
328/**
329 * Register builtin USB device.
330 *
331 * @returns VBox status code.
332 * @param pCallbacks Pointer to the callback table.
333 * @param u32Version VBox version number.
334 */
335extern "C" DECLEXPORT(int) VBoxUsbRegister(PCPDMUSBREGCB pCallbacks, uint32_t u32Version)
336{
337 int rc = VINF_SUCCESS;
338
339#ifdef VBOX_WITH_USB
340 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbDevProxy);
341 if (RT_FAILURE(rc))
342 return rc;
343
344# ifdef VBOX_WITH_SCSI
345 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbMsd);
346 if (RT_FAILURE(rc))
347 return rc;
348# endif
349#endif
350
351#ifdef VBOX_WITH_VUSB
352 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidKbd);
353 if (RT_FAILURE(rc))
354 return rc;
355
356 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidMou);
357 if (RT_FAILURE(rc))
358 return rc;
359#endif
360
361 return rc;
362}
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