VirtualBox

source: vbox/trunk/src/VBox/Devices/Builtins.cpp@ 31123

Last change on this file since 31123 was 30976, checked in by vboxsync, 14 years ago

add support for Intel HD Audio, now built by default

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.1 KB
Line 
1/* $Id: Builtins.cpp 30976 2010-07-22 10:06:58Z vboxsync $ */
2/** @file
3 * Built-in drivers & devices (part 1)
4 */
5
6/*
7 * Copyright (C) 2006-2010 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/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 "Builtins.h"
32
33
34/*******************************************************************************
35* Global Variables *
36*******************************************************************************/
37const void *g_apvVBoxDDDependencies[] =
38{
39#ifdef VBOX_WITH_EFI
40 &g_abEfiThunkBinary[0],
41#endif
42 NULL,
43};
44
45
46/**
47 * Register builtin devices.
48 *
49 * @returns VBox status code.
50 * @param pCallbacks Pointer to the callback table.
51 * @param u32Version VBox version number.
52 */
53extern "C" DECLEXPORT(int) VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
54{
55 LogFlow(("VBoxDevicesRegister: u32Version=%#x\n", u32Version));
56 AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
57 int rc;
58
59 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCI);
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#ifdef VBOX_WITH_HPET
81 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceHPET);
82 if (RT_FAILURE(rc))
83 return rc;
84#endif
85#ifdef VBOX_WITH_EFI
86 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEFI);
87 if (RT_FAILURE(rc))
88 return rc;
89#endif
90 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceMC146818);
91 if (RT_FAILURE(rc))
92 return rc;
93 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVga);
94 if (RT_FAILURE(rc))
95 return rc;
96 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVMMDev);
97 if (RT_FAILURE(rc))
98 return rc;
99 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCNet);
100 if (RT_FAILURE(rc))
101 return rc;
102#ifdef VBOX_WITH_E1000
103 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceE1000);
104 if (RT_FAILURE(rc))
105 return rc;
106#endif
107#ifdef VBOX_WITH_VIRTIO
108 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVirtioNet);
109 if (RT_FAILURE(rc))
110 return rc;
111#endif
112#ifdef VBOX_WITH_INIP
113 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceINIP);
114 if (RT_FAILURE(rc))
115 return rc;
116#endif
117 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceICHAC97);
118 if (RT_FAILURE(rc))
119 return rc;
120 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSB16);
121 if (RT_FAILURE(rc))
122 return rc;
123 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceICH6_HDA);
124 if (RT_FAILURE(rc))
125 return rc;
126 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAudioSniffer);
127 if (RT_FAILURE(rc))
128 return rc;
129#ifdef VBOX_WITH_VUSB
130 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceOHCI);
131 if (RT_FAILURE(rc))
132 return rc;
133#endif
134#ifdef VBOX_WITH_EHCI
135 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEHCI);
136 if (RT_FAILURE(rc))
137 return rc;
138#endif
139#ifdef VBOX_ACPI
140 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceACPI);
141 if (RT_FAILURE(rc))
142 return rc;
143#endif
144 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceDMA);
145 if (RT_FAILURE(rc))
146 return rc;
147 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceFloppyController);
148 if (RT_FAILURE(rc))
149 return rc;
150 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSerialPort);
151 if (RT_FAILURE(rc))
152 return rc;
153 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceParallelPort);
154 if (RT_FAILURE(rc))
155 return rc;
156#ifdef VBOX_WITH_AHCI
157 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAHCI);
158 if (RT_FAILURE(rc))
159 return rc;
160#endif
161#ifdef VBOX_WITH_BUSLOGIC
162 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceBusLogic);
163 if (RT_FAILURE(rc))
164 return rc;
165#endif
166 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCIBridge);
167 if (RT_FAILURE(rc))
168 return rc;
169#ifdef VBOX_WITH_LSILOGIC
170 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLsiLogicSCSI);
171 if (RT_FAILURE(rc))
172 return rc;
173 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLsiLogicSAS);
174 if (RT_FAILURE(rc))
175 return rc;
176#endif
177
178 return VINF_SUCCESS;
179}
180
181
182/**
183 * Register builtin drivers.
184 *
185 * @returns VBox status code.
186 * @param pCallbacks Pointer to the callback table.
187 * @param u32Version VBox version number.
188 */
189extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
190{
191 LogFlow(("VBoxDriversRegister: u32Version=%#x\n", u32Version));
192 AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
193
194 int rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMouseQueue);
195 if (RT_FAILURE(rc))
196 return rc;
197 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvKeyboardQueue);
198 if (RT_FAILURE(rc))
199 return rc;
200 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvBlock);
201 if (RT_FAILURE(rc))
202 return rc;
203 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVD);
204 if (RT_FAILURE(rc))
205 return rc;
206#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
207 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDVD);
208 if (RT_FAILURE(rc))
209 return rc;
210#endif
211#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
212 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostFloppy);
213 if (RT_FAILURE(rc))
214 return rc;
215#endif
216 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMediaISO);
217 if (RT_FAILURE(rc))
218 return rc;
219 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawImage);
220 if (RT_FAILURE(rc))
221 return rc;
222#ifndef RT_OS_L4
223 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNAT);
224 if (RT_FAILURE(rc))
225 return rc;
226#endif
227#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
228 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostInterface);
229 if (RT_FAILURE(rc))
230 return rc;
231#endif
232#ifdef VBOX_WITH_VDE
233 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVDE);
234 if (RT_FAILURE(rc))
235 return rc;
236#endif
237 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvIntNet);
238 if (RT_FAILURE(rc))
239 return rc;
240 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDedicatedNic);
241 if (RT_FAILURE(rc))
242 return rc;
243 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetSniffer);
244 if (RT_FAILURE(rc))
245 return rc;
246 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAUDIO);
247 if (RT_FAILURE(rc))
248 return rc;
249 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvACPI);
250 if (RT_FAILURE(rc))
251 return rc;
252 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAcpiCpu);
253 if (RT_FAILURE(rc))
254 return rc;
255
256#ifdef VBOX_WITH_VUSB
257 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVUSBRootHub);
258 if (RT_FAILURE(rc))
259 return rc;
260#endif
261
262#if !defined(RT_OS_L4)
263 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNamedPipe);
264 if (RT_FAILURE(rc))
265 return rc;
266 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawFile);
267 if (RT_FAILURE(rc))
268 return rc;
269 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvChar);
270 if (RT_FAILURE(rc))
271 return rc;
272#endif
273
274#if defined(RT_OS_LINUX)
275 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostParallel);
276 if (RT_FAILURE(rc))
277 return rc;
278#endif
279
280#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
281 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSerial);
282 if (RT_FAILURE(rc))
283 return rc;
284#endif
285
286#ifdef VBOX_WITH_SCSI
287 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvSCSI);
288 if (RT_FAILURE(rc))
289 return rc;
290
291# if defined(RT_OS_LINUX)
292 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvSCSIHost);
293 if (RT_FAILURE(rc))
294 return rc;
295# endif
296
297#endif
298
299#ifdef VBOX_WITH_DRV_DISK_INTEGRITY
300 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvDiskIntegrity);
301 if (RT_FAILURE(rc))
302 return rc;
303#endif
304
305 return VINF_SUCCESS;
306}
307
308
309/**
310 * Register builtin USB device.
311 *
312 * @returns VBox status code.
313 * @param pCallbacks Pointer to the callback table.
314 * @param u32Version VBox version number.
315 */
316extern "C" DECLEXPORT(int) VBoxUsbRegister(PCPDMUSBREGCB pCallbacks, uint32_t u32Version)
317{
318 int rc = VINF_SUCCESS;
319
320#ifdef VBOX_WITH_USB
321 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbDevProxy);
322 if (RT_FAILURE(rc))
323 return rc;
324
325# ifdef VBOX_WITH_SCSI
326 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbMsd);
327 if (RT_FAILURE(rc))
328 return rc;
329# endif
330#endif
331
332#ifdef VBOX_WITH_VUSB
333 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidKbd);
334 if (RT_FAILURE(rc))
335 return rc;
336
337 rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbHidMou);
338 if (RT_FAILURE(rc))
339 return rc;
340#endif
341
342 return rc;
343}
344
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