added new pci bus manager
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4721 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
SubDir OBOS_TOP src add-ons kernel bus_managers pci ;
|
||||
|
||||
KernelStaticLibrary pci_bus_manager :
|
||||
pci.c
|
||||
;
|
||||
|
||||
KernelLd pci :
|
||||
pci_bus_manager.a
|
||||
pci_arch_$(OBOS_ARCH)_bus_manager.a
|
||||
kernel.so
|
||||
|
||||
: $(OBOS_TOP)/src/kernel/ldscripts/$(OBOS_ARCH)/add-on.ld
|
||||
: -Bdynamic -shared
|
||||
:
|
||||
# : add-ons/kernel/bus_managers/pci
|
||||
;
|
||||
|
||||
SubInclude OBOS_TOP src add-ons kernel bus_managers pci arch $(OBOS_ARCH) ;
|
||||
@@ -0,0 +1,6 @@
|
||||
SubDir OBOS_TOP src add-ons kernel bus_managers pci arch ppc ;
|
||||
|
||||
KernelStaticLibrary pci_arch_ppc_bus_manager :
|
||||
pci_config.c
|
||||
pci_io.c
|
||||
;
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "pci_priv.h"
|
||||
|
||||
status_t
|
||||
pci_config_init()
|
||||
{
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
uint32
|
||||
read_pci_config(uint8 bus, uint8 device, uint8 function, uint8 offset, uint8 size)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
write_pci_config(uint8 bus, uint8 device, uint8 function, uint8 offset, uint8 size, uint32 value)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
#include "pci_priv.h"
|
||||
|
||||
status_t
|
||||
pci_io_init()
|
||||
{
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
uint8
|
||||
read_io_8(int mapped_io_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
write_io_8(int mapped_io_addr, uint8 value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
uint16
|
||||
read_io_16(int mapped_io_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
write_io_16(int mapped_io_addr, uint16 value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
uint32
|
||||
read_io_32(int mapped_io_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
write_io_32(int mapped_io_addr, uint32 value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
ram_address(const void *physical_address_in_system_memory)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "pci_priv.h"
|
||||
|
||||
status_t
|
||||
pci_config_init()
|
||||
{
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
uint32
|
||||
read_pci_config(uint8 bus, uint8 device, uint8 function, uint8 offset, uint8 size)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
write_pci_config(uint8 bus, uint8 device, uint8 function, uint8 offset, uint8 size, uint32 value)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
#include "pci_priv.h"
|
||||
|
||||
status_t
|
||||
pci_io_init()
|
||||
{
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
uint8
|
||||
read_io_8(int mapped_io_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
write_io_8(int mapped_io_addr, uint8 value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
uint16
|
||||
read_io_16(int mapped_io_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
write_io_16(int mapped_io_addr, uint16 value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
uint32
|
||||
read_io_32(int mapped_io_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
write_io_32(int mapped_io_addr, uint32 value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
ram_address(const void *physical_address_in_system_memory)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
#include <KernelExport.h>
|
||||
#include <bus_manager.h>
|
||||
#include <PCI.h>
|
||||
#include "pci_priv.h"
|
||||
|
||||
void pci_scan_bus(uint8 bus);
|
||||
long get_nth_pci_info(long index, pci_info *outInfo);
|
||||
status_t pci_module_init(void);
|
||||
status_t pci_module_uninit(void);
|
||||
int32 std_ops(int32 op, ...);
|
||||
status_t pci_module_rescan();
|
||||
|
||||
|
||||
void
|
||||
pci_scan_bus(uint8 bus)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
long
|
||||
get_nth_pci_info(long index, pci_info *outInfo)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
pci_module_init(void)
|
||||
{
|
||||
dprintf("PCI: pci_module_init\n");
|
||||
|
||||
if (B_OK != pci_io_init()) {
|
||||
dprintf("PCI: pci_io_init failed\n");
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
if (B_OK != pci_config_init()) {
|
||||
dprintf("PCI: pci_config_init failed\n");
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
pci_scan_bus(0);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
pci_module_uninit(void)
|
||||
{
|
||||
dprintf("PCI: pci_module_uninit\n");
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
pci_module_rescan()
|
||||
{
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
int32
|
||||
std_ops(int32 op, ...)
|
||||
{
|
||||
switch (op) {
|
||||
case B_MODULE_INIT:
|
||||
return pci_module_init();
|
||||
|
||||
case B_MODULE_UNINIT:
|
||||
return pci_module_uninit();
|
||||
}
|
||||
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
|
||||
struct pci_module_info pci_module = {
|
||||
{
|
||||
{
|
||||
B_PCI_MODULE_NAME,
|
||||
B_KEEP_LOADED,
|
||||
std_ops
|
||||
},
|
||||
pci_module_rescan
|
||||
},
|
||||
&read_io_8,
|
||||
&write_io_8,
|
||||
&read_io_16,
|
||||
&write_io_16,
|
||||
&read_io_32,
|
||||
&write_io_32,
|
||||
&get_nth_pci_info,
|
||||
&read_pci_config,
|
||||
&write_pci_config,
|
||||
&ram_address
|
||||
};
|
||||
|
||||
|
||||
module_info *modules[] = {
|
||||
(module_info *)&pci_module,
|
||||
NULL
|
||||
};
|
||||
Reference in New Issue
Block a user