From fe2bcea7308e23a8eaa542aa44f54e6955d9248a Mon Sep 17 00:00:00 2001 From: milek7 Date: Mon, 11 Apr 2022 00:46:48 +0200 Subject: [PATCH] Move irq_routing_table from x86 to generic. There is nothing really x86-specific there, other platforms use ACPI interrupt routing for PCI too. Change-Id: Ib02e2917902a161c3d79a1049bcd16ba40bb7814 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5277 Reviewed-by: David Karoly Reviewed-by: Fredrik Holmqvist --- .../acpi_irq_routing_table.cpp} | 6 +++++- .../acpi_irq_routing_table.h} | 0 src/system/kernel/arch/x86/Jamfile | 3 ++- src/system/kernel/arch/x86/ioapic.cpp | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) rename src/system/kernel/arch/{x86/irq_routing_table.cpp => generic/acpi_irq_routing_table.cpp} (99%) rename src/system/kernel/arch/{x86/irq_routing_table.h => generic/acpi_irq_routing_table.h} (100%) diff --git a/src/system/kernel/arch/x86/irq_routing_table.cpp b/src/system/kernel/arch/generic/acpi_irq_routing_table.cpp similarity index 99% rename from src/system/kernel/arch/x86/irq_routing_table.cpp rename to src/system/kernel/arch/generic/acpi_irq_routing_table.cpp index 759052bbfc..8c08901500 100644 --- a/src/system/kernel/arch/x86/irq_routing_table.cpp +++ b/src/system/kernel/arch/generic/acpi_irq_routing_table.cpp @@ -7,7 +7,7 @@ */ -#include "irq_routing_table.h" +#include "acpi_irq_routing_table.h" #include "acpi.h" @@ -34,7 +34,11 @@ const char* kACPIPciExpressRootName = "PNP0A08"; static const uint8 kMaxPCIFunctionCount = 8; static const uint8 kMaxPCIDeviceCount = 32; // TODO: actually this is mechanism dependent +#if defined(__i386__) || defined(__x86_64__) static const uint8 kMaxISAInterrupts = 16; +#else +static const uint8 kMaxISAInterrupts = 0; +#endif irq_descriptor::irq_descriptor() : diff --git a/src/system/kernel/arch/x86/irq_routing_table.h b/src/system/kernel/arch/generic/acpi_irq_routing_table.h similarity index 100% rename from src/system/kernel/arch/x86/irq_routing_table.h rename to src/system/kernel/arch/generic/acpi_irq_routing_table.h diff --git a/src/system/kernel/arch/x86/Jamfile b/src/system/kernel/arch/x86/Jamfile index 30a81e620c..eab282d957 100644 --- a/src/system/kernel/arch/x86/Jamfile +++ b/src/system/kernel/arch/x86/Jamfile @@ -13,6 +13,7 @@ UsePrivateKernelHeaders ; UsePrivateHeaders shared ; UsePrivateHeaders [ FDirName system arch x86 ] ; +SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) paging ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) timers ] ; @@ -92,7 +93,7 @@ local archGenericSources = arch_vm_translation_map.cpp apic.cpp ioapic.cpp - irq_routing_table.cpp + acpi_irq_routing_table.cpp msi.cpp pic.cpp diff --git a/src/system/kernel/arch/x86/ioapic.cpp b/src/system/kernel/arch/x86/ioapic.cpp index 5e1edb1d70..fff4fa7d63 100644 --- a/src/system/kernel/arch/x86/ioapic.cpp +++ b/src/system/kernel/arch/x86/ioapic.cpp @@ -8,7 +8,7 @@ #include #include -#include "irq_routing_table.h" +#include "acpi_irq_routing_table.h" #include #include