1 | /** @file
|
---|
2 | *
|
---|
3 | * Main driver registration.
|
---|
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 | #include "MouseImpl.h"
|
---|
23 | #include "KeyboardImpl.h"
|
---|
24 | #include "DisplayImpl.h"
|
---|
25 | #include "VMMDev.h"
|
---|
26 | #include "AudioSnifferInterface.h"
|
---|
27 | #include "Nvram.h"
|
---|
28 | #include "UsbWebcamInterface.h"
|
---|
29 | #ifdef VBOX_WITH_USB_CARDREADER
|
---|
30 | # include "UsbCardReader.h"
|
---|
31 | #endif
|
---|
32 | #include "ConsoleImpl.h"
|
---|
33 | #ifdef VBOX_WITH_PCI_PASSTHROUGH
|
---|
34 | # include "PCIRawDevImpl.h"
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | #include "Logging.h"
|
---|
38 |
|
---|
39 | #include <VBox/vmm/pdmdrv.h>
|
---|
40 | #include <VBox/version.h>
|
---|
41 |
|
---|
42 | /**
|
---|
43 | * Register the main drivers.
|
---|
44 | *
|
---|
45 | * @returns VBox status code.
|
---|
46 | * @param pCallbacks Pointer to the callback table.
|
---|
47 | * @param u32Version VBox version number.
|
---|
48 | */
|
---|
49 | extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
|
---|
50 | {
|
---|
51 | LogFlow(("VBoxDriversRegister: u32Version=%#x\n", u32Version));
|
---|
52 | AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
|
---|
53 |
|
---|
54 | int rc = pCallbacks->pfnRegister(pCallbacks, &Mouse::DrvReg);
|
---|
55 | if (RT_FAILURE(rc))
|
---|
56 | return rc;
|
---|
57 |
|
---|
58 | rc = pCallbacks->pfnRegister(pCallbacks, &Keyboard::DrvReg);
|
---|
59 | if (RT_FAILURE(rc))
|
---|
60 | return rc;
|
---|
61 |
|
---|
62 | rc = pCallbacks->pfnRegister(pCallbacks, &Display::DrvReg);
|
---|
63 | if (RT_FAILURE(rc))
|
---|
64 | return rc;
|
---|
65 |
|
---|
66 | rc = pCallbacks->pfnRegister(pCallbacks, &VMMDev::DrvReg);
|
---|
67 | if (RT_FAILURE(rc))
|
---|
68 | return rc;
|
---|
69 |
|
---|
70 | rc = pCallbacks->pfnRegister(pCallbacks, &AudioSniffer::DrvReg);
|
---|
71 | if (RT_FAILURE(rc))
|
---|
72 | return rc;
|
---|
73 |
|
---|
74 | rc = pCallbacks->pfnRegister(pCallbacks, &Nvram::DrvReg);
|
---|
75 | if (RT_FAILURE(rc))
|
---|
76 | return rc;
|
---|
77 |
|
---|
78 | rc = pCallbacks->pfnRegister(pCallbacks, &EmWebcam::DrvReg);
|
---|
79 | if (RT_FAILURE(rc))
|
---|
80 | return rc;
|
---|
81 |
|
---|
82 | #ifdef VBOX_WITH_USB_CARDREADER
|
---|
83 | rc = pCallbacks->pfnRegister(pCallbacks, &UsbCardReader::DrvReg);
|
---|
84 | if (RT_FAILURE(rc))
|
---|
85 | return rc;
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | rc = pCallbacks->pfnRegister(pCallbacks, &Console::DrvStatusReg);
|
---|
89 | if (RT_FAILURE(rc))
|
---|
90 | return rc;
|
---|
91 |
|
---|
92 | #ifdef VBOX_WITH_PCI_PASSTHROUGH
|
---|
93 | rc = pCallbacks->pfnRegister(pCallbacks, &PCIRawDev::DrvReg);
|
---|
94 | if (RT_FAILURE(rc))
|
---|
95 | return rc;
|
---|
96 | #endif
|
---|
97 |
|
---|
98 | return VINF_SUCCESS;
|
---|
99 | }
|
---|
100 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|