Author: tqh Date: 2010-10-24 15:49:04 +0200 (Sun, 24 Oct 2010) New Revision: 39124 Changeset: http://dev.haiku-os.org/changeset/39124 Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/Jamfile haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c Log: Added kernel setting to dump MADT to syslog. It's very useful for understanding interrupt configuration. It needs a bit polish in code but wanted to commit before leaving BG. Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/Jamfile 2010-10-24 12:57:55 UTC (rev 39123) +++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/Jamfile 2010-10-24 13:49:04 UTC (rev 39124) @@ -31,6 +31,12 @@ hwxface.c ; +local common_src = + dmtable.c + dmtbdump.c + dmtbinfo.c +; + local debugger_src = dbdisply.c dbxface.c @@ -171,6 +177,7 @@ $(resources_src) $(tables_src) $(utilities_src) + $(common_src) ; SEARCH on [ FGristFiles $(events_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi events ] ; @@ -182,6 +189,7 @@ SEARCH on [ FGristFiles $(dispatcher_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi dispatcher ] ; SEARCH on [ FGristFiles $(executer_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi executer ] ; SEARCH on [ FGristFiles $(parser_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi parser ] ; +SEARCH on [ FGristFiles $(common_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi common ] ; KernelAddon acpi : oshaiku.cpp Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c 2010-10-24 12:57:55 UTC (rev 39123) +++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c 2010-10-24 13:49:04 UTC (rev 39124) @@ -22,6 +22,7 @@ #include "acpi.h" #include "accommon.h" +#include "acdisasm.h" #include "acnamesp.h" #include "acpi_priv.h" @@ -73,6 +74,33 @@ } +static void dump_madt() { + ACPI_STATUS status; + ACPI_TABLE_HEADER *madt = NULL; + ACPI_SUBTABLE_HEADER *entry; + void *end; + int madtCount = -1; + + while (true) { + status = AcpiGetTable (ACPI_SIG_MADT, ++madtCount, &madt); + if (status != AE_OK) break; + + dprintf("acpi: MADT TABLE:\n"); + AcpiDmDumpDataTable( madt ); +/* entry = madt + 44; + end = madt + madt->Header.Length; + while (entry < end) { + dprintf("\t\tType: %d\n", entry->Type); + entry += entry->Length; + }; +*/ + }; + + dprintf("acpi: You have %d MADT tables.\n", madtCount); + +} + + // #pragma mark - ACPI bus manager API @@ -89,6 +117,7 @@ void *settings; bool acpiDisabled = false; bool acpiAvoidFullInit = false; + bool acpiDumpMADT = false; settings = load_driver_settings("kernel"); if (settings != NULL) { @@ -96,6 +125,8 @@ false, false); acpiAvoidFullInit = get_driver_boolean_parameter(settings, "acpi_avoid_full_init", false, false); + acpiDumpMADT = get_driver_boolean_parameter(settings, + "acpi_dump_MADT", false, false); unload_driver_settings(settings); } @@ -149,6 +180,8 @@ goto err; } + if (acpiDumpMADT) dump_madt(); + /* Install the default address space handlers. */ status = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT, ACPI_ADR_SPACE_SYSTEM_MEMORY, ACPI_DEFAULT_HANDLER, NULL, NULL);