VirtualBox

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

Last change on this file since 51287 was 50686, checked in by vboxsync, 11 years ago

src/VBox/Devices/Audio, src/VBox/Main/src-client, include/VBox/vmm:

src/VBox/Devices/Audio: part of restructuring of audio code. Devices files correspondin to Hda, AC97 and SB16 audio. The structure of files have been modifed as per PDM specs. The modified code is under #ifdef VBOX_WITH_PDM_AUDIO_DRIVER

src/VBox/Main/src-client: Driver for the VRDE that interacts with DrvAudio. Enhancement of the CFGM tree for audio.

Config.kmk : addition of one configuration parameter that will control whether new audio code is disabled or enabled. "VBOX_WITH_PDM_AUDIO_DRIVER"

pdmaudioifs.h: common header file between Device , Intermediate audio driver and Backends specific to audio.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 12.1 KB
Line 
1/* $Id: VBoxDD.cpp 50686 2014-03-04 19:21:18Z 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
195 return VINF_SUCCESS;
196}
197
198
199/**
200 * Register builtin drivers.
201 *
202 * @returns VBox status code.
203 * @param pCallbacks Pointer to the callback table.
204 * @param u32Version VBox version number.
205 */
206extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
207{
208 LogFlow(("VBoxDriversRegister: u32Version=%#x\n", u32Version));
209 AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
210
211 int rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMouseQueue);
212 if (RT_FAILURE(rc))
213 return rc;
214 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvKeyboardQueue);
215 if (RT_FAILURE(rc))
216 return rc;
217 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvBlock);
218 if (RT_FAILURE(rc))
219 return rc;
220 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVD);
221 if (RT_FAILURE(rc))
222 return rc;
223#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
224 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDVD);
225 if (RT_FAILURE(rc))
226 return rc;
227#endif
228#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
229 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostFloppy);
230 if (RT_FAILURE(rc))
231 return rc;
232#endif
233 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMediaISO);
234 if (RT_FAILURE(rc))
235 return rc;
236 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawImage);
237 if (RT_FAILURE(rc))
238 return rc;
239 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNAT);
240 if (RT_FAILURE(rc))
241 return rc;
242#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
243 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostInterface);
244 if (RT_FAILURE(rc))
245 return rc;
246#endif
247#ifdef VBOX_WITH_UDPTUNNEL
248 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvUDPTunnel);
249 if (RT_FAILURE(rc))
250 return rc;
251#endif
252#ifdef VBOX_WITH_VDE
253 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVDE);
254 if (RT_FAILURE(rc))
255 return rc;
256#endif
257 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvIntNet);
258 if (RT_FAILURE(rc))
259 return rc;
260 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDedicatedNic);
261 if (RT_FAILURE(rc))
262 return rc;
263 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetSniffer);
264 if (RT_FAILURE(rc))
265 return rc;
266#ifdef VBOX_WITH_NETSHAPER
267 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetShaper);
268 if (RT_FAILURE(rc))
269 return rc;
270#endif
271 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAUDIO);
272 if (RT_FAILURE(rc))
273 return rc;
274#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
275# if defined(RT_OS_WINDOWS)
276 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDSound);
277 if (RT_FAILURE(rc))
278 return rc;
279# endif
280# if defined(RT_OS_LINUX)
281 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostPulseAudio);
282 if (RT_FAILURE(rc))
283 return rc;
284# endif
285# if defined(RT_OS_FREEBSD)
286 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostOssAudio);
287 if (RT_FAILURE(rc))
288 return rc;
289# endif
290# if defined(RT_OS_DARWIN)
291 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostCoreAudio);
292 if (RT_FAILURE(rc))
293 return rc;
294# endif
295# if defined(RT_OS_SOLARIS)
296 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSolAudio);
297 if (RT_FAILURE(rc))
298 return rc;
299# endif
300#endif
301 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvACPI);
302 if (RT_FAILURE(rc))
303 return rc;
304 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAcpiCpu);
305 if (RT_FAILURE(rc))
306 return rc;
307#ifdef VBOX_WITH_VUSB
308 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVUSBRootHub);
309 if (RT_FAILURE(rc))
310 return rc;
311#endif
312#ifdef VBOX_WITH_USB_VIDEO_IMPL
313 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostWebcam);
314 if (RT_FAILURE(rc))
315 return rc;
316#endif
317 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNamedPipe);
318 if (RT_FAILURE(rc))
319 return rc;
320 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawFile);
321 if (RT_FAILURE(rc))
322 return rc;
323 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvChar);
324 if (RT_FAILURE(rc))
325 return rc;
326#if defined(RT_OS_LINUX) || defined(VBOX_WITH_WIN_PARPORT_SUP)
327 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostParallel);
328 if (RT_FAILURE(rc))
329 return rc;
330#endif
331#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
332 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSerial);
333 if (RT_FAILURE(rc))
334 return rc;
335#endif
336#ifdef VBOX_WITH_SCSI
337 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvSCSI);
338 if (RT_FAILURE(rc))
339 return rc;
340# if defined(RT_OS_LINUX)
341 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvSCSIHost);
342 if (RT_FAILURE(rc))
343 return rc;
344# endif
345#endif
346#ifdef VBOX_WITH_DRV_DISK_INTEGRITY
347 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDiskIntegrity);
348 if (RT_FAILURE(rc))
349 return rc;
350#endif
351#ifdef VBOX_WITH_PCI_PASSTHROUGH_IMPL
352 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvPciRaw);
353 if (RT_FAILURE(rc))
354 return rc;
355#endif
356
357 return VINF_SUCCESS;
358}
359
360
361/**
362 * Register builtin USB device.
363 *
364 * @returns VBox status code.
365 * @param pCallbacks Pointer to the callback table.
366 * @param u32Version VBox version number.
367 */
368extern "C" DECLEXPORT(int) VBoxUsbRegister(PCPDMUSBREGCB pCallbacks, uint32_t u32Version)
369{
370 int rc = VINF_SUCCESS;
371
372#ifdef VBOX_WITH_USB
373 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbDevProxy);
374 if (RT_FAILURE(rc))
375 return rc;
376# ifdef VBOX_WITH_SCSI
377 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbMsd);
378 if (RT_FAILURE(rc))
379 return rc;
380# endif
381#endif
382#ifdef VBOX_WITH_VUSB
383 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidKbd);
384 if (RT_FAILURE(rc))
385 return rc;
386 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidMou);
387 if (RT_FAILURE(rc))
388 return rc;
389#endif
390#ifdef VBOX_WITH_USB_VIDEO_IMPL
391 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevWebcam);
392 if (RT_FAILURE(rc))
393 return rc;
394#endif
395
396 return rc;
397}
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