VirtualBox

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

Last change on this file since 57989 was 57989, checked in by vboxsync, 9 years ago

Added support for GIM Hyper-V hypercalls and guest debugging.

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