Just some cleanup. We won't need pci module for setup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41025 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -600,21 +600,11 @@ ioapic_init(kernel_args* args)
|
|||||||
BPrivate::CObjectDeleter<const char, status_t>
|
BPrivate::CObjectDeleter<const char, status_t>
|
||||||
acpiModulePutter(B_ACPI_MODULE_NAME, put_module);
|
acpiModulePutter(B_ACPI_MODULE_NAME, put_module);
|
||||||
|
|
||||||
// load pci module
|
|
||||||
pci_module_info* pciModule;
|
|
||||||
status = get_module(B_PCI_MODULE_NAME, (module_info**)&pciModule);
|
|
||||||
if (status != B_OK) {
|
|
||||||
dprintf("could not load pci module, not configuring ioapic\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
CObjectDeleter<const char, status_t> pciModulePutter(B_PCI_MODULE_NAME,
|
|
||||||
put_module);
|
|
||||||
|
|
||||||
// TODO: here ACPI needs to be used to properly set up the PCI IRQ
|
// TODO: here ACPI needs to be used to properly set up the PCI IRQ
|
||||||
// routing.
|
// routing.
|
||||||
|
|
||||||
IRQRoutingTable table;
|
IRQRoutingTable table;
|
||||||
status = read_irq_routing_table(pciModule, acpiModule, &table);
|
status = read_irq_routing_table(acpiModule, &table);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
dprintf("reading IRQ routing table failed, no ioapic.\n");
|
dprintf("reading IRQ routing table failed, no ioapic.\n");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Clemens Zeidler haiku@clemens-zeidler.de. All rights reserved.
|
* Copyright 2009, Clemens Zeidler haiku@clemens-zeidler.de.
|
||||||
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
@@ -50,8 +51,9 @@ print_irq_descriptor(irq_descriptor* descriptor)
|
|||||||
const char* edgeTriggeredString = " edge triggered";
|
const char* edgeTriggeredString = " edge triggered";
|
||||||
|
|
||||||
dprintf("irq: %i, shareable: %i, polarity: %s, interrupt_mode: %s\n",
|
dprintf("irq: %i, shareable: %i, polarity: %s, interrupt_mode: %s\n",
|
||||||
descriptor->irq, descriptor->shareable, descriptor->polarity == B_HIGH_ACTIVE_POLARITY
|
descriptor->irq, descriptor->shareable,
|
||||||
? activeHighString : activeLowString,
|
descriptor->polarity == B_HIGH_ACTIVE_POLARITY ? activeHighString
|
||||||
|
: activeLowString,
|
||||||
descriptor->interrupt_mode == B_LEVEL_TRIGGERED ? levelTriggeredString
|
descriptor->interrupt_mode == B_LEVEL_TRIGGERED ? levelTriggeredString
|
||||||
: edgeTriggeredString);
|
: edgeTriggeredString);
|
||||||
}
|
}
|
||||||
@@ -72,8 +74,8 @@ print_irq_routing_table(IRQRoutingTable* table)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
read_device_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi,
|
read_device_irq_routing_table(acpi_module_info* acpi, acpi_handle device,
|
||||||
acpi_handle device, IRQRoutingTable* table)
|
IRQRoutingTable* table)
|
||||||
{
|
{
|
||||||
acpi_data buffer;
|
acpi_data buffer;
|
||||||
buffer.pointer = 0;
|
buffer.pointer = 0;
|
||||||
@@ -103,8 +105,7 @@ read_device_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi,
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
read_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi,
|
read_irq_routing_table(acpi_module_info* acpi, IRQRoutingTable* table)
|
||||||
IRQRoutingTable* table)
|
|
||||||
{
|
{
|
||||||
char rootPciName[255];
|
char rootPciName[255];
|
||||||
acpi_handle rootPciHandle;
|
acpi_handle rootPciHandle;
|
||||||
@@ -117,7 +118,7 @@ read_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi,
|
|||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
TRACE("Read root pci bus irq rooting table\n");
|
TRACE("Read root pci bus irq rooting table\n");
|
||||||
status = read_device_irq_routing_table(pci, acpi, rootPciHandle, table);
|
status = read_device_irq_routing_table(acpi, rootPciHandle, table);
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@@ -133,7 +134,7 @@ read_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi,
|
|||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
status = read_device_irq_routing_table(pci, acpi, brigde, table);
|
status = read_device_irq_routing_table(acpi, brigde, table);
|
||||||
if (status == B_OK)
|
if (status == B_OK)
|
||||||
TRACE("routing table found %s\n", name);
|
TRACE("routing table found %s\n", name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,17 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <ACPI.h>
|
#include <ACPI.h>
|
||||||
#include <PCI.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include "util/Vector.h"
|
#include "util/Vector.h"
|
||||||
|
|
||||||
|
|
||||||
struct irq_routing_entry {
|
struct irq_routing_entry {
|
||||||
int device_address;
|
int device_address;
|
||||||
int8 pin;
|
int8 pin;
|
||||||
|
|
||||||
acpi_handle source;
|
acpi_handle source;
|
||||||
int source_index;
|
int source_index;
|
||||||
|
|
||||||
// pci busmanager connection
|
// pci busmanager connection
|
||||||
uchar pci_bus;
|
uchar pci_bus;
|
||||||
@@ -45,10 +44,10 @@ struct irq_descriptor {
|
|||||||
typedef struct acpi_prt {
|
typedef struct acpi_prt {
|
||||||
uint32 length;
|
uint32 length;
|
||||||
uint32 pin;
|
uint32 pin;
|
||||||
uint64 address; // here for 64-bit alignment
|
uint64 address; // here for 64-bit alignment
|
||||||
uint32 sourceIndex;
|
uint32 sourceIndex;
|
||||||
char source[4]; // pad to 64 bits so sizeof() works in
|
char source[4]; // pad to 64 bits so sizeof()
|
||||||
// all cases
|
// works in all cases
|
||||||
} acpi_pci_routing_table;
|
} acpi_pci_routing_table;
|
||||||
|
|
||||||
//TODO: Hack until we expose ACPI structs better, currently hardcoded to
|
//TODO: Hack until we expose ACPI structs better, currently hardcoded to
|
||||||
@@ -70,8 +69,7 @@ void print_irq_descriptor(irq_descriptor* descriptor);
|
|||||||
void print_irq_routing_table(IRQRoutingTable* table);
|
void print_irq_routing_table(IRQRoutingTable* table);
|
||||||
|
|
||||||
|
|
||||||
status_t read_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi,
|
status_t read_irq_routing_table(acpi_module_info* acpi, IRQRoutingTable* table);
|
||||||
IRQRoutingTable* table);
|
|
||||||
status_t read_irq_descriptor(acpi_module_info* acpi, acpi_handle device,
|
status_t read_irq_descriptor(acpi_module_info* acpi, acpi_handle device,
|
||||||
const char* method, irq_descriptor* descriptor);
|
const char* method, irq_descriptor* descriptor);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user