VirtualBox

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

Last change on this file since 68080 was 65338, checked in by vboxsync, 8 years ago

Remove the old, unused I/O APIC code and related define.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 12.9 KB
Line 
1/* $Id: VBoxDD.cpp 65338 2017-01-16 14:11:15Z vboxsync $ */
2/** @file
3 * VBoxDD - Built-in drivers & devices (part 1).
4 */
5
6/*
7 * Copyright (C) 2006-2016 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_DeviceIOAPIC);
69 if (RT_FAILURE(rc))
70 return rc;
71 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePS2KeyboardMouse);
72 if (RT_FAILURE(rc))
73 return rc;
74 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePIIX3IDE);
75 if (RT_FAILURE(rc))
76 return rc;
77 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8254);
78 if (RT_FAILURE(rc))
79 return rc;
80 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8259);
81 if (RT_FAILURE(rc))
82 return rc;
83 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceHPET);
84 if (RT_FAILURE(rc))
85 return rc;
86 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSmc);
87 if (RT_FAILURE(rc))
88 return rc;
89#ifdef VBOX_WITH_EFI
90 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEFI);
91 if (RT_FAILURE(rc))
92 return rc;
93#endif
94 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceMC146818);
95 if (RT_FAILURE(rc))
96 return rc;
97 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVga);
98 if (RT_FAILURE(rc))
99 return rc;
100 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVMMDev);
101 if (RT_FAILURE(rc))
102 return rc;
103 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCNet);
104 if (RT_FAILURE(rc))
105 return rc;
106#ifdef VBOX_WITH_E1000
107 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceE1000);
108 if (RT_FAILURE(rc))
109 return rc;
110#endif
111#ifdef VBOX_WITH_VIRTIO
112 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVirtioNet);
113 if (RT_FAILURE(rc))
114 return rc;
115#endif
116#ifdef VBOX_WITH_INIP
117 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceINIP);
118 if (RT_FAILURE(rc))
119 return rc;
120#endif
121 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceICHAC97);
122 if (RT_FAILURE(rc))
123 return rc;
124 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSB16);
125 if (RT_FAILURE(rc))
126 return rc;
127 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceHDA);
128 if (RT_FAILURE(rc))
129 return rc;
130#ifdef VBOX_WITH_VUSB
131 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceOHCI);
132 if (RT_FAILURE(rc))
133 return rc;
134#endif
135#ifdef VBOX_WITH_EHCI_IMPL
136 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEHCI);
137 if (RT_FAILURE(rc))
138 return rc;
139#endif
140#ifdef VBOX_WITH_XHCI_IMPL
141 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceXHCI);
142 if (RT_FAILURE(rc))
143 return rc;
144#endif
145#ifdef VBOX_ACPI
146 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceACPI);
147 if (RT_FAILURE(rc))
148 return rc;
149#endif
150 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceDMA);
151 if (RT_FAILURE(rc))
152 return rc;
153 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceFloppyController);
154 if (RT_FAILURE(rc))
155 return rc;
156 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSerialPort);
157 if (RT_FAILURE(rc))
158 return rc;
159 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceParallelPort);
160 if (RT_FAILURE(rc))
161 return rc;
162#ifdef VBOX_WITH_AHCI
163 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAHCI);
164 if (RT_FAILURE(rc))
165 return rc;
166#endif
167#ifdef VBOX_WITH_BUSLOGIC
168 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceBusLogic);
169 if (RT_FAILURE(rc))
170 return rc;
171#endif
172 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCIBridge);
173 if (RT_FAILURE(rc))
174 return rc;
175 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciIch9Bridge);
176 if (RT_FAILURE(rc))
177 return rc;
178#ifdef VBOX_WITH_LSILOGIC
179 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLsiLogicSCSI);
180 if (RT_FAILURE(rc))
181 return rc;
182 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLsiLogicSAS);
183 if (RT_FAILURE(rc))
184 return rc;
185#endif
186#ifdef VBOX_WITH_NVME_IMPL
187 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceNVMe);
188 if (RT_FAILURE(rc))
189 return rc;
190#endif
191#ifdef VBOX_WITH_PCI_PASSTHROUGH_IMPL
192 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciRaw);
193 if (RT_FAILURE(rc))
194 return rc;
195#endif
196 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceGIMDev);
197 if (RT_FAILURE(rc))
198 return rc;
199#ifdef VBOX_WITH_VIRTUALKD
200 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVirtualKD);
201 if (RT_FAILURE(rc))
202 return rc;
203#endif
204
205 return VINF_SUCCESS;
206}
207
208
209/**
210 * Register builtin drivers.
211 *
212 * @returns VBox status code.
213 * @param pCallbacks Pointer to the callback table.
214 * @param u32Version VBox version number.
215 */
216extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
217{
218 LogFlow(("VBoxDriversRegister: u32Version=%#x\n", u32Version));
219 AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
220
221 int rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMouseQueue);
222 if (RT_FAILURE(rc))
223 return rc;
224 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvKeyboardQueue);
225 if (RT_FAILURE(rc))
226 return rc;
227 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVD);
228 if (RT_FAILURE(rc))
229 return rc;
230#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
231 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDVD);
232 if (RT_FAILURE(rc))
233 return rc;
234#endif
235#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
236 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostFloppy);
237 if (RT_FAILURE(rc))
238 return rc;
239#endif
240 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNAT);
241 if (RT_FAILURE(rc))
242 return rc;
243#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
244 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostInterface);
245 if (RT_FAILURE(rc))
246 return rc;
247#endif
248#ifdef VBOX_WITH_UDPTUNNEL
249 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvUDPTunnel);
250 if (RT_FAILURE(rc))
251 return rc;
252#endif
253#ifdef VBOX_WITH_VDE
254 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVDE);
255 if (RT_FAILURE(rc))
256 return rc;
257#endif
258 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvIntNet);
259 if (RT_FAILURE(rc))
260 return rc;
261 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDedicatedNic);
262 if (RT_FAILURE(rc))
263 return rc;
264 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetSniffer);
265 if (RT_FAILURE(rc))
266 return rc;
267#ifdef VBOX_WITH_NETSHAPER
268 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetShaper);
269 if (RT_FAILURE(rc))
270 return rc;
271#endif
272 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAUDIO);
273 if (RT_FAILURE(rc))
274 return rc;
275#ifdef VBOX_WITH_AUDIO_DEBUG
276 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDebugAudio);
277 if (RT_FAILURE(rc))
278 return rc;
279#endif
280#ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
281 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostValidationKitAudio);
282 if (RT_FAILURE(rc))
283 return rc;
284#endif
285 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostNullAudio);
286 if (RT_FAILURE(rc))
287 return rc;
288#if defined(RT_OS_WINDOWS)
289 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDSound);
290 if (RT_FAILURE(rc))
291 return rc;
292#endif
293#if defined(RT_OS_DARWIN)
294 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostCoreAudio);
295 if (RT_FAILURE(rc))
296 return rc;
297#endif
298#ifdef VBOX_WITH_AUDIO_ALSA
299 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostALSAAudio);
300 if (RT_FAILURE(rc))
301 return rc;
302#endif
303#ifdef VBOX_WITH_AUDIO_OSS
304 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostOSSAudio);
305 if (RT_FAILURE(rc))
306 return rc;
307#endif
308#ifdef VBOX_WITH_AUDIO_PULSE
309 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostPulseAudio);
310 if (RT_FAILURE(rc))
311 return rc;
312#endif
313 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvACPI);
314 if (RT_FAILURE(rc))
315 return rc;
316 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAcpiCpu);
317 if (RT_FAILURE(rc))
318 return rc;
319#ifdef VBOX_WITH_VUSB
320 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVUSBRootHub);
321 if (RT_FAILURE(rc))
322 return rc;
323#endif
324#ifdef VBOX_WITH_USB_VIDEO_IMPL
325 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostWebcam);
326 if (RT_FAILURE(rc))
327 return rc;
328#endif
329 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNamedPipe);
330 if (RT_FAILURE(rc))
331 return rc;
332 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvTCP);
333 if (RT_FAILURE(rc))
334 return rc;
335 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvUDP);
336 if (RT_FAILURE(rc))
337 return rc;
338 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawFile);
339 if (RT_FAILURE(rc))
340 return rc;
341 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvChar);
342 if (RT_FAILURE(rc))
343 return rc;
344#if defined(RT_OS_LINUX) || defined(VBOX_WITH_WIN_PARPORT_SUP)
345 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostParallel);
346 if (RT_FAILURE(rc))
347 return rc;
348#endif
349#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
350 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSerial);
351 if (RT_FAILURE(rc))
352 return rc;
353#endif
354#ifdef VBOX_WITH_SCSI
355 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvSCSI);
356 if (RT_FAILURE(rc))
357 return rc;
358#endif
359#ifdef VBOX_WITH_DRV_DISK_INTEGRITY
360 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDiskIntegrity);
361 if (RT_FAILURE(rc))
362 return rc;
363
364 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRamDisk);
365 if (RT_FAILURE(rc))
366 return rc;
367#endif
368#ifdef VBOX_WITH_PCI_PASSTHROUGH_IMPL
369 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvPciRaw);
370 if (RT_FAILURE(rc))
371 return rc;
372#endif
373
374 return VINF_SUCCESS;
375}
376
377
378/**
379 * Register builtin USB device.
380 *
381 * @returns VBox status code.
382 * @param pCallbacks Pointer to the callback table.
383 * @param u32Version VBox version number.
384 */
385extern "C" DECLEXPORT(int) VBoxUsbRegister(PCPDMUSBREGCB pCallbacks, uint32_t u32Version)
386{
387 int rc = VINF_SUCCESS;
388 RT_NOREF1(u32Version);
389
390#ifdef VBOX_WITH_USB
391 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbDevProxy);
392 if (RT_FAILURE(rc))
393 return rc;
394# ifdef VBOX_WITH_SCSI
395 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbMsd);
396 if (RT_FAILURE(rc))
397 return rc;
398# endif
399#endif
400#ifdef VBOX_WITH_VUSB
401 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidKbd);
402 if (RT_FAILURE(rc))
403 return rc;
404 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidMou);
405 if (RT_FAILURE(rc))
406 return rc;
407#endif
408#ifdef VBOX_WITH_USB_VIDEO_IMPL
409 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevWebcam);
410 if (RT_FAILURE(rc))
411 return rc;
412#endif
413
414 return rc;
415}
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