From 7fae77976618b676ff17571fff9759402d61d961 Mon Sep 17 00:00:00 2001 From: Fredrik Holmqvist Date: Sat, 19 Mar 2011 11:47:18 +0000 Subject: [PATCH] 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 --- src/system/kernel/arch/x86/arch_int.cpp | 12 +----------- .../kernel/arch/x86/irq_routing_table.cpp | 19 ++++++++++--------- .../kernel/arch/x86/irq_routing_table.h | 14 ++++++-------- 3 files changed, 17 insertions(+), 28 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_int.cpp b/src/system/kernel/arch/x86/arch_int.cpp index 939dee1601..25fe4399bf 100644 --- a/src/system/kernel/arch/x86/arch_int.cpp +++ b/src/system/kernel/arch/x86/arch_int.cpp @@ -600,21 +600,11 @@ ioapic_init(kernel_args* args) BPrivate::CObjectDeleter 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 pciModulePutter(B_PCI_MODULE_NAME, - put_module); - // TODO: here ACPI needs to be used to properly set up the PCI IRQ // routing. IRQRoutingTable table; - status = read_irq_routing_table(pciModule, acpiModule, &table); + status = read_irq_routing_table(acpiModule, &table); if (status != B_OK) { dprintf("reading IRQ routing table failed, no ioapic.\n"); return; diff --git a/src/system/kernel/arch/x86/irq_routing_table.cpp b/src/system/kernel/arch/x86/irq_routing_table.cpp index 5009b2fca8..50ce140fb7 100644 --- a/src/system/kernel/arch/x86/irq_routing_table.cpp +++ b/src/system/kernel/arch/x86/irq_routing_table.cpp @@ -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. */ @@ -50,8 +51,9 @@ print_irq_descriptor(irq_descriptor* descriptor) const char* edgeTriggeredString = " edge triggered"; dprintf("irq: %i, shareable: %i, polarity: %s, interrupt_mode: %s\n", - descriptor->irq, descriptor->shareable, descriptor->polarity == B_HIGH_ACTIVE_POLARITY - ? activeHighString : activeLowString, + descriptor->irq, descriptor->shareable, + descriptor->polarity == B_HIGH_ACTIVE_POLARITY ? activeHighString + : activeLowString, descriptor->interrupt_mode == B_LEVEL_TRIGGERED ? levelTriggeredString : edgeTriggeredString); } @@ -72,8 +74,8 @@ print_irq_routing_table(IRQRoutingTable* table) static status_t -read_device_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi, - acpi_handle device, IRQRoutingTable* table) +read_device_irq_routing_table(acpi_module_info* acpi, acpi_handle device, + IRQRoutingTable* table) { acpi_data buffer; buffer.pointer = 0; @@ -103,8 +105,7 @@ read_device_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi, status_t -read_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi, - IRQRoutingTable* table) +read_irq_routing_table(acpi_module_info* acpi, IRQRoutingTable* table) { char rootPciName[255]; acpi_handle rootPciHandle; @@ -117,7 +118,7 @@ read_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi, if (status != B_OK) return status; 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) return status; @@ -133,7 +134,7 @@ read_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi, if (status != B_OK) continue; - status = read_device_irq_routing_table(pci, acpi, brigde, table); + status = read_device_irq_routing_table(acpi, brigde, table); if (status == B_OK) TRACE("routing table found %s\n", name); } diff --git a/src/system/kernel/arch/x86/irq_routing_table.h b/src/system/kernel/arch/x86/irq_routing_table.h index b59a59b675..fe88fe1e9c 100644 --- a/src/system/kernel/arch/x86/irq_routing_table.h +++ b/src/system/kernel/arch/x86/irq_routing_table.h @@ -7,18 +7,17 @@ #include -#include #include "util/Vector.h" struct irq_routing_entry { - int device_address; + int device_address; int8 pin; acpi_handle source; - int source_index; + int source_index; // pci busmanager connection uchar pci_bus; @@ -45,10 +44,10 @@ struct irq_descriptor { typedef struct acpi_prt { uint32 length; uint32 pin; - uint64 address; // here for 64-bit alignment + uint64 address; // here for 64-bit alignment uint32 sourceIndex; - char source[4]; // pad to 64 bits so sizeof() works in - // all cases + char source[4]; // pad to 64 bits so sizeof() + // works in all cases } acpi_pci_routing_table; //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); -status_t read_irq_routing_table(pci_module_info *pci, acpi_module_info* acpi, - IRQRoutingTable* table); +status_t read_irq_routing_table(acpi_module_info* acpi, IRQRoutingTable* table); status_t read_irq_descriptor(acpi_module_info* acpi, acpi_handle device, const char* method, irq_descriptor* descriptor);