mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
vbox: cleanup device registration
Patch got lost on win8 merge ;-)
This commit is contained in:
parent
a5d043443d
commit
86c0656de0
@ -19,107 +19,41 @@
|
||||
#include <VBoxDD2.h>
|
||||
|
||||
|
||||
#define REGISTER(device) \
|
||||
do { \
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_##device); \
|
||||
if (RT_FAILURE(rc)) \
|
||||
return rc; \
|
||||
} while (0)
|
||||
|
||||
|
||||
extern "C" int VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
/* pcarch */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcArch);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
/* platform */
|
||||
REGISTER(DevicePcArch);
|
||||
REGISTER(DevicePcBios);
|
||||
REGISTER(DeviceI8254);
|
||||
REGISTER(DeviceI8259);
|
||||
REGISTER(DeviceDMA);
|
||||
REGISTER(DeviceMC146818);
|
||||
REGISTER(DeviceACPI);
|
||||
REGISTER(DeviceAPIC);
|
||||
REGISTER(DeviceIOAPIC);
|
||||
REGISTER(DevicePCI);
|
||||
REGISTER(DevicePCIBridge);
|
||||
|
||||
/* pcbios */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcBios);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* pci */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCI);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* pckbd */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePS2KeyboardMouse);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* i8254 */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8254);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* i8259 */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8259);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* mc146818 */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceMC146818);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* vga */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVga);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* piix3ide */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePIIX3IDE);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* 8237A DMA */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceDMA);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* Guest - VMM/Host communication */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVMMDev);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* ACPI missing */
|
||||
|
||||
/* APIC */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAPIC);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* i82078 */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceFloppyController);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* Ethernet PCNet controller */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCNet);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* Ethernet E1000 controller */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceE1000);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
/* Serial device */
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSerialPort);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCIBridge);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceACPI);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceIOAPIC);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
|
||||
rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceOHCI);
|
||||
if (RT_FAILURE(rc))
|
||||
return rc;
|
||||
/* devices */
|
||||
REGISTER(DevicePS2KeyboardMouse);
|
||||
REGISTER(DeviceVga);
|
||||
REGISTER(DeviceFloppyController);
|
||||
REGISTER(DeviceSerialPort);
|
||||
REGISTER(DevicePIIX3IDE);
|
||||
REGISTER(DevicePCNet);
|
||||
REGISTER(DeviceE1000);
|
||||
REGISTER(DeviceVMMDev);
|
||||
REGISTER(DeviceOHCI);
|
||||
|
||||
return VINF_SUCCESS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user