[haiku-commits] r41025 - haiku/trunk/src/system/kernel/arch/x86

  • From: fredrik.holmqvist@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 19 Mar 2011 12:47:18 +0100 (CET)

Author: tqh
Date: 2011-03-19 12:47:18 +0100 (Sat, 19 Mar 2011)
New Revision: 41025
Changeset: https://dev.haiku-os.org/changeset/41025

Modified:
   haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp
   haiku/trunk/src/system/kernel/arch/x86/irq_routing_table.cpp
   haiku/trunk/src/system/kernel/arch/x86/irq_routing_table.h
Log:
Just some cleanup. We won't need pci module for setup.


Modified: haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp 2011-03-19 01:58:31 UTC 
(rev 41024)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_int.cpp 2011-03-19 11:47:18 UTC 
(rev 41025)
@@ -600,21 +600,11 @@
        BPrivate::CObjectDeleter<const char, status_t>
                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
        // 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;

Modified: haiku/trunk/src/system/kernel/arch/x86/irq_routing_table.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/irq_routing_table.cpp        
2011-03-19 01:58:31 UTC (rev 41024)
+++ haiku/trunk/src/system/kernel/arch/x86/irq_routing_table.cpp        
2011-03-19 11:47:18 UTC (rev 41025)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2009, Clemens Zeidler haiku@xxxxxxxxxxxxxxxxxxx All rights 
reserved.
+ * Copyright 2009, Clemens Zeidler haiku@xxxxxxxxxxxxxxxxxxx
+ * All rights reserved.
  *
  * Distributed under the terms of the MIT License.
  */
@@ -50,8 +51,9 @@
        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 @@
 
 
 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 @@
 
 
 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 @@
        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 @@
                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);                
        
        }

Modified: haiku/trunk/src/system/kernel/arch/x86/irq_routing_table.h
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/irq_routing_table.h  2011-03-19 
01:58:31 UTC (rev 41024)
+++ haiku/trunk/src/system/kernel/arch/x86/irq_routing_table.h  2011-03-19 
11:47:18 UTC (rev 41025)
@@ -7,18 +7,17 @@
 
 
 #include <ACPI.h>
-#include <PCI.h>
 
 
 #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 @@
 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_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);
 


Other related posts:

  • » [haiku-commits] r41025 - haiku/trunk/src/system/kernel/arch/x86 - fredrik . holmqvist