VirtualBox

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

Last change on this file since 52343 was 52249, checked in by vboxsync, 10 years ago

USB: Initial xHCI device commit (WIP).

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