VirtualBox

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

Last change on this file since 64733 was 64508, checked in by vboxsync, 8 years ago

Audio: Added Validation Kit skeleton driver. Use with VBOX_WITH_AUDIO_VALIDATIONKIT set. Needs to be modifiable at runtime later.

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