VirtualBox

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

Last change on this file since 72616 was 72616, checked in by vboxsync, 7 years ago

Flash: Link it in, too.

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