VirtualBox

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

Last change on this file since 51612 was 51560, checked in by vboxsync, 11 years ago

VMM/GIM: Mapping of GIM MMIO2 regions and Hyper-V provider work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 12.2 KB
Line 
1/* $Id: VBoxDD.cpp 51560 2014-06-06 05:17:02Z 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_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_PCI_PASSTHROUGH_IMPL
190 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePciRaw);
191 if (RT_FAILURE(rc))
192 return rc;
193#endif
194 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceGIMDev);
195 if (RT_FAILURE(rc))
196 return rc;
197
198 return VINF_SUCCESS;
199}
200
201
202/**
203 * Register builtin drivers.
204 *
205 * @returns VBox status code.
206 * @param pCallbacks Pointer to the callback table.
207 * @param u32Version VBox version number.
208 */
209extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
210{
211 LogFlow(("VBoxDriversRegister: u32Version=%#x\n", u32Version));
212 AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
213
214 int rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMouseQueue);
215 if (RT_FAILURE(rc))
216 return rc;
217 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvKeyboardQueue);
218 if (RT_FAILURE(rc))
219 return rc;
220 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvBlock);
221 if (RT_FAILURE(rc))
222 return rc;
223 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVD);
224 if (RT_FAILURE(rc))
225 return rc;
226#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
227 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDVD);
228 if (RT_FAILURE(rc))
229 return rc;
230#endif
231#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
232 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostFloppy);
233 if (RT_FAILURE(rc))
234 return rc;
235#endif
236 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMediaISO);
237 if (RT_FAILURE(rc))
238 return rc;
239 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawImage);
240 if (RT_FAILURE(rc))
241 return rc;
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_PDM_AUDIO_DRIVER
278# if defined(RT_OS_WINDOWS)
279 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDSound);
280 if (RT_FAILURE(rc))
281 return rc;
282# endif
283# if defined(RT_OS_LINUX)
284 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostPulseAudio);
285 if (RT_FAILURE(rc))
286 return rc;
287# endif
288# if defined(RT_OS_FREEBSD)
289 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostOssAudio);
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# if defined(RT_OS_SOLARIS)
299 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSolAudio);
300 if (RT_FAILURE(rc))
301 return rc;
302# endif
303#endif
304 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvACPI);
305 if (RT_FAILURE(rc))
306 return rc;
307 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAcpiCpu);
308 if (RT_FAILURE(rc))
309 return rc;
310#ifdef VBOX_WITH_VUSB
311 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVUSBRootHub);
312 if (RT_FAILURE(rc))
313 return rc;
314#endif
315#ifdef VBOX_WITH_USB_VIDEO_IMPL
316 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostWebcam);
317 if (RT_FAILURE(rc))
318 return rc;
319#endif
320 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNamedPipe);
321 if (RT_FAILURE(rc))
322 return rc;
323 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawFile);
324 if (RT_FAILURE(rc))
325 return rc;
326 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvChar);
327 if (RT_FAILURE(rc))
328 return rc;
329#if defined(RT_OS_LINUX) || defined(VBOX_WITH_WIN_PARPORT_SUP)
330 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostParallel);
331 if (RT_FAILURE(rc))
332 return rc;
333#endif
334#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
335 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSerial);
336 if (RT_FAILURE(rc))
337 return rc;
338#endif
339#ifdef VBOX_WITH_SCSI
340 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvSCSI);
341 if (RT_FAILURE(rc))
342 return rc;
343# if defined(RT_OS_LINUX)
344 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvSCSIHost);
345 if (RT_FAILURE(rc))
346 return rc;
347# endif
348#endif
349#ifdef VBOX_WITH_DRV_DISK_INTEGRITY
350 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDiskIntegrity);
351 if (RT_FAILURE(rc))
352 return rc;
353#endif
354#ifdef VBOX_WITH_PCI_PASSTHROUGH_IMPL
355 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvPciRaw);
356 if (RT_FAILURE(rc))
357 return rc;
358#endif
359
360 return VINF_SUCCESS;
361}
362
363
364/**
365 * Register builtin USB device.
366 *
367 * @returns VBox status code.
368 * @param pCallbacks Pointer to the callback table.
369 * @param u32Version VBox version number.
370 */
371extern "C" DECLEXPORT(int) VBoxUsbRegister(PCPDMUSBREGCB pCallbacks, uint32_t u32Version)
372{
373 int rc = VINF_SUCCESS;
374
375#ifdef VBOX_WITH_USB
376 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbDevProxy);
377 if (RT_FAILURE(rc))
378 return rc;
379# ifdef VBOX_WITH_SCSI
380 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbMsd);
381 if (RT_FAILURE(rc))
382 return rc;
383# endif
384#endif
385#ifdef VBOX_WITH_VUSB
386 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidKbd);
387 if (RT_FAILURE(rc))
388 return rc;
389 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidMou);
390 if (RT_FAILURE(rc))
391 return rc;
392#endif
393#ifdef VBOX_WITH_USB_VIDEO_IMPL
394 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevWebcam);
395 if (RT_FAILURE(rc))
396 return rc;
397#endif
398
399 return rc;
400}
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