VirtualBox

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

Last change on this file since 28427 was 28427, checked in by vboxsync, 15 years ago

DrvDedicatedNic.cpp: sketeches.

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