1 | /* $Id: VBoxDDR0.cpp 85816 2020-08-18 11:23:19Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxDDR0 - Built-in drivers & devices (part 1), ring-0 module.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2020 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/log.h>
|
---|
24 | #include <VBox/sup.h>
|
---|
25 | #include <VBox/vmm/pdmdev.h>
|
---|
26 |
|
---|
27 | #include "VBoxDD.h"
|
---|
28 |
|
---|
29 |
|
---|
30 | /*********************************************************************************************************************************
|
---|
31 | * Global Variables *
|
---|
32 | *********************************************************************************************************************************/
|
---|
33 | #if defined(RT_OS_SOLARIS) && defined(IN_RING0)
|
---|
34 | /* Dependency information for the native solaris loader. */
|
---|
35 | extern "C" { char _depends_on[] = "vboxdrv VMMR0.r0"; }
|
---|
36 | #endif
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Pointer to the ring-0 device registrations for VBoxDDR0.
|
---|
40 | */
|
---|
41 | static PCPDMDEVREGR0 g_apVBoxDDR0DevRegs[] =
|
---|
42 | {
|
---|
43 | &g_DevicePCI,
|
---|
44 | &g_DevicePciIch9,
|
---|
45 | &g_DeviceIOAPIC,
|
---|
46 | &g_DevicePS2KeyboardMouse,
|
---|
47 | &g_DevicePIIX3IDE,
|
---|
48 | &g_DeviceI8254,
|
---|
49 | &g_DeviceI8259,
|
---|
50 | &g_DeviceHPET,
|
---|
51 | &g_DeviceSmc,
|
---|
52 | &g_DeviceFlash,
|
---|
53 | &g_DeviceMC146818,
|
---|
54 | &g_DeviceVga,
|
---|
55 | &g_DeviceVMMDev,
|
---|
56 | &g_DevicePCNet,
|
---|
57 | #ifdef VBOX_WITH_E1000
|
---|
58 | &g_DeviceE1000,
|
---|
59 | #endif
|
---|
60 | #ifdef VBOX_WITH_VIRTIO
|
---|
61 | &g_DeviceVirtioNet,
|
---|
62 | #endif
|
---|
63 | #ifdef VBOX_WITH_VIRTIO_NET_1_0
|
---|
64 | &g_DeviceVirtioNet_1_0,
|
---|
65 | #endif
|
---|
66 | &g_DeviceICHAC97,
|
---|
67 | &g_DeviceHDA,
|
---|
68 | #ifdef VBOX_WITH_VUSB
|
---|
69 | &g_DeviceOHCI,
|
---|
70 | #endif
|
---|
71 | #ifdef VBOX_WITH_EHCI_IMPL
|
---|
72 | &g_DeviceEHCI,
|
---|
73 | #endif
|
---|
74 | #ifdef VBOX_WITH_XHCI_IMPL
|
---|
75 | &g_DeviceXHCI,
|
---|
76 | #endif
|
---|
77 | &g_DeviceACPI,
|
---|
78 | &g_DeviceDMA,
|
---|
79 | &g_DeviceSerialPort,
|
---|
80 | &g_DeviceOxPcie958,
|
---|
81 | &g_DeviceParallelPort,
|
---|
82 | #ifdef VBOX_WITH_AHCI
|
---|
83 | &g_DeviceAHCI,
|
---|
84 | #endif
|
---|
85 | #ifdef VBOX_WITH_BUSLOGIC
|
---|
86 | &g_DeviceBusLogic,
|
---|
87 | #endif
|
---|
88 | &g_DevicePCIBridge,
|
---|
89 | &g_DevicePciIch9Bridge,
|
---|
90 | #ifdef VBOX_WITH_LSILOGIC
|
---|
91 | &g_DeviceLsiLogicSCSI,
|
---|
92 | &g_DeviceLsiLogicSAS,
|
---|
93 | #endif
|
---|
94 | #ifdef VBOX_WITH_NVME_IMPL
|
---|
95 | &g_DeviceNVMe,
|
---|
96 | #endif
|
---|
97 | #ifdef VBOX_WITH_EFI
|
---|
98 | &g_DeviceEFI,
|
---|
99 | #endif
|
---|
100 | #ifdef VBOX_WITH_VIRTIO_SCSI
|
---|
101 | &g_DeviceVirtioSCSI,
|
---|
102 | #endif
|
---|
103 | #ifdef VBOX_WITH_PCI_PASSTHROUGH_IMPL
|
---|
104 | &g_DevicePciRaw,
|
---|
105 | #endif
|
---|
106 | &g_DeviceGIMDev,
|
---|
107 | #ifdef VBOX_WITH_NEW_LPC_DEVICE
|
---|
108 | &g_DeviceLPC,
|
---|
109 | #endif
|
---|
110 | #ifdef VBOX_WITH_IOMMU_AMD
|
---|
111 | &g_DeviceIommuAmd,
|
---|
112 | #endif
|
---|
113 | };
|
---|
114 |
|
---|
115 | /**
|
---|
116 | * Module device registration record for VBoxDDR0.
|
---|
117 | */
|
---|
118 | static PDMDEVMODREGR0 g_VBoxDDR0ModDevReg =
|
---|
119 | {
|
---|
120 | /* .u32Version = */ PDM_DEVMODREGR0_VERSION,
|
---|
121 | /* .cDevRegs = */ RT_ELEMENTS(g_apVBoxDDR0DevRegs),
|
---|
122 | /* .papDevRegs = */ &g_apVBoxDDR0DevRegs[0],
|
---|
123 | /* .hMod = */ NULL,
|
---|
124 | /* .ListEntry = */ { NULL, NULL },
|
---|
125 | };
|
---|
126 |
|
---|
127 |
|
---|
128 | DECLEXPORT(int) ModuleInit(void *hMod)
|
---|
129 | {
|
---|
130 | LogFlow(("VBoxDDR0/ModuleInit: %p\n", hMod));
|
---|
131 | return PDMR0DeviceRegisterModule(hMod, &g_VBoxDDR0ModDevReg);
|
---|
132 | }
|
---|
133 |
|
---|
134 |
|
---|
135 | DECLEXPORT(void) ModuleTerm(void *hMod)
|
---|
136 | {
|
---|
137 | LogFlow(("VBoxDDR0/ModuleTerm: %p\n", hMod));
|
---|
138 | PDMR0DeviceDeregisterModule(hMod, &g_VBoxDDR0ModDevReg);
|
---|
139 | }
|
---|
140 |
|
---|