BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / bus_managers / pci / pci_module.cpp
blob41227b1746f4d963f496b1536284232a90bf2976
1 /*
2 * Copyright 2005-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Copyright 2003, Marcus Overhagen. All rights reserved.
5 * Distributed under the terms of the MIT License.
6 */
9 #include <PCI.h>
11 #include "pci_private.h"
12 #include "pci_info.h"
13 #include "pci.h"
16 device_manager_info *gDeviceManager;
17 extern struct pci_arch_module gPCIArchModule;
19 static int32
20 pci_old_module_std_ops(int32 op, ...)
22 switch (op) {
23 case B_MODULE_INIT:
25 status_t status;
27 TRACE(("PCI: pci_module_init\n"));
29 status = pci_init();
30 if (status < B_OK)
31 return status;
33 pci_print_info();
35 return B_OK;
38 case B_MODULE_UNINIT:
39 TRACE(("PCI: pci_module_uninit\n"));
40 pci_uninit();
41 return B_OK;
44 return B_BAD_VALUE;
48 static struct pci_module_info sOldPCIModule = {
51 B_PCI_MODULE_NAME,
52 B_KEEP_LOADED,
53 pci_old_module_std_ops
55 NULL
57 &pci_read_io_8,
58 &pci_write_io_8,
59 &pci_read_io_16,
60 &pci_write_io_16,
61 &pci_read_io_32,
62 &pci_write_io_32,
63 &pci_get_nth_pci_info,
64 &pci_read_config,
65 &pci_write_config,
66 &pci_ram_address,
67 &pci_find_capability,
68 &pci_reserve_device,
69 &pci_unreserve_device,
70 &pci_update_interrupt_line,
71 &pci_find_extended_capability
74 module_dependency module_dependencies[] = {
75 {B_DEVICE_MANAGER_MODULE_NAME, (module_info **)&gDeviceManager},
79 driver_module_info gPCILegacyDriverModule = {
81 PCI_LEGACY_DRIVER_MODULE_NAME,
83 NULL,
85 NULL
88 module_info *modules[] = {
89 (module_info *)&sOldPCIModule,
90 (module_info *)&gPCIRootModule,
91 (module_info *)&gPCIDeviceModule,
92 (module_info *)&gPCILegacyDriverModule,
93 #if defined(__INTEL__) || defined(__x86_64__)
94 // add platforms when they provide an arch specific module
95 (module_info *)&gPCIArchModule,
96 #endif
97 NULL