VirtualBox

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

Last change on this file since 9380 was 9124, checked in by vboxsync, 17 years ago

Cleanup of the Solaris 10 detection, reducing ifdef clutter in the C files and avoid using the system namespace.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.7 KB
Line 
1/** $Id: Builtins.cpp 9124 2008-05-26 13:48:23Z vboxsync $ */
2/** @file
3 * Built-in drivers & devices (part 1)
4 */
5
6/*
7 * Copyright (C) 2006-2008 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 NULL,
44};
45
46
47/**
48 * Register builtin devices.
49 *
50 * @returns VBox status code.
51 * @param pCallbacks Pointer to the callback table.
52 * @param u32Version VBox version number.
53 */
54extern "C" DECLEXPORT(int) VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
55{
56 LogFlow(("VBoxDevicesRegister: u32Version=%#x\n", u32Version));
57 AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
58 int rc;
59
60 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCI);
61 if (VBOX_FAILURE(rc))
62 return rc;
63 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcArch);
64 if (VBOX_FAILURE(rc))
65 return rc;
66 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcBios);
67 if (VBOX_FAILURE(rc))
68 return rc;
69 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePS2KeyboardMouse);
70 if (VBOX_FAILURE(rc))
71 return rc;
72 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePIIX3IDE);
73 if (VBOX_FAILURE(rc))
74 return rc;
75 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8254);
76 if (VBOX_FAILURE(rc))
77 return rc;
78 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8259);
79 if (VBOX_FAILURE(rc))
80 return rc;
81 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceMC146818);
82 if (VBOX_FAILURE(rc))
83 return rc;
84 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVga);
85 if (VBOX_FAILURE(rc))
86 return rc;
87 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVMMDev);
88 if (VBOX_FAILURE(rc))
89 return rc;
90 rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCNet);
91 if (VBOX_FAILURE(rc))
92 return rc;
93#ifdef VBOX_WITH_E1000
94 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceE1000);
95 if (VBOX_FAILURE(rc))
96 return rc;
97#endif
98#ifdef VBOX_WITH_INIP
99 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceINIP);
100 if (VBOX_FAILURE(rc))
101 return rc;
102#endif
103 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceICHAC97);
104 if (VBOX_FAILURE(rc))
105 return rc;
106 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSB16);
107 if (VBOX_FAILURE(rc))
108 return rc;
109 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAudioSniffer);
110 if (VBOX_FAILURE(rc))
111 return rc;
112#ifdef VBOX_WITH_USB
113 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceOHCI);
114 if (VBOX_FAILURE(rc))
115 return rc;
116#endif
117#ifdef VBOX_WITH_EHCI
118 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEHCI);
119 if (VBOX_FAILURE(rc))
120 return rc;
121#endif
122#ifdef VBOX_ACPI
123 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceACPI);
124 if (VBOX_FAILURE(rc))
125 return rc;
126#endif
127 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceDMA);
128 if (VBOX_FAILURE(rc))
129 return rc;
130 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceFloppyController);
131 if (VBOX_FAILURE(rc))
132 return rc;
133 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSerialPort);
134 if (VBOX_FAILURE(rc))
135 return rc;
136 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceParallelPort);
137 if (VBOX_FAILURE(rc))
138 return rc;
139#ifdef VBOX_WITH_AHCI
140 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAHCI);
141 if (VBOX_FAILURE(rc))
142 return rc;
143#endif
144
145 return VINF_SUCCESS;
146}
147
148
149/**
150 * Register builtin drivers.
151 *
152 * @returns VBox status code.
153 * @param pCallbacks Pointer to the callback table.
154 * @param u32Version VBox version number.
155 */
156extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
157{
158 LogFlow(("VBoxDriversRegister: u32Version=%#x\n", u32Version));
159 AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
160
161 int rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMouseQueue);
162 if (VBOX_FAILURE(rc))
163 return rc;
164 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvKeyboardQueue);
165 if (VBOX_FAILURE(rc))
166 return rc;
167 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvBlock);
168 if (VBOX_FAILURE(rc))
169 return rc;
170 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVBoxHDD);
171 if (VBOX_FAILURE(rc))
172 return rc;
173 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVD);
174 if (VBOX_FAILURE(rc))
175 return rc;
176#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS)
177 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDVD);
178 if (VBOX_FAILURE(rc))
179 return rc;
180#endif
181#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
182 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostFloppy);
183 if (VBOX_FAILURE(rc))
184 return rc;
185#endif
186 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMediaISO);
187 if (VBOX_FAILURE(rc))
188 return rc;
189 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawImage);
190 if (VBOX_FAILURE(rc))
191 return rc;
192#ifdef VBOX_WITH_ISCSI
193 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvISCSI);
194 if (VBOX_FAILURE(rc))
195 return rc;
196 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvISCSITransportTcp);
197 if (VBOX_FAILURE(rc))
198 return rc;
199#endif
200#ifndef RT_OS_L4
201 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNAT);
202 if (VBOX_FAILURE(rc))
203 return rc;
204#endif
205#if defined(RT_OS_L4) || defined(RT_OS_LINUX) || defined(RT_OS_OS2) || (defined(RT_OS_SOLARIS) && !defined(RT_OS_SOLARIS_10)) || defined(RT_OS_WINDOWS)
206 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostInterface);
207 if (VBOX_FAILURE(rc))
208 return rc;
209#endif
210 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvIntNet);
211 if (VBOX_FAILURE(rc))
212 return rc;
213 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetSniffer);
214 if (VBOX_FAILURE(rc))
215 return rc;
216 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAUDIO);
217 if (VBOX_FAILURE(rc))
218 return rc;
219 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvACPI);
220 if (VBOX_FAILURE(rc))
221 return rc;
222
223#ifdef VBOX_WITH_USB
224 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVUSBRootHub);
225 if (VBOX_FAILURE(rc))
226 return rc;
227#endif
228
229#if !defined(RT_OS_L4)
230 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNamedPipe);
231 if (VBOX_FAILURE(rc))
232 return rc;
233 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvChar);
234 if (VBOX_FAILURE(rc))
235 return rc;
236#endif
237
238#if defined(RT_OS_LINUX)
239 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostParallel);
240 if (VBOX_FAILURE(rc))
241 return rc;
242#endif
243
244#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
245 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSerial);
246 if (VBOX_FAILURE(rc))
247 return rc;
248#endif
249
250#if defined(VBOX_WITH_PDM_ASYNC_COMPLETION)
251 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawImageAsync);
252 if (VBOX_FAILURE(rc))
253 return rc;
254
255 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvTransportAsync);
256 if (VBOX_FAILURE(rc))
257 return rc;
258#endif
259
260 return VINF_SUCCESS;
261}
262
263
264#ifdef VBOX_WITH_USB
265/**
266 * Register builtin USB device.
267 *
268 * @returns VBox status code.
269 * @param pCallbacks Pointer to the callback table.
270 * @param u32Version VBox version number.
271 */
272extern "C" DECLEXPORT(int) VBoxUsbRegister(PCPDMUSBREGCB pCallbacks, uint32_t u32Version)
273{
274 int rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbDevProxy);
275 if (VBOX_FAILURE(rc))
276 return rc;
277
278 return VINF_SUCCESS;
279}
280#endif
281
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