hrev43551 adds 1 changeset to branch 'master' old head: 323738f8ab0036faecfb83ce25923d2a753fd9dc new head: 78ce5eb732d6ae6885219fac29271d32c16e942e ---------------------------------------------------------------------------- 78ce5eb: Add a pci:mechanism driver setting * This should be use to force a config mechanism in case another one crashes. * Actually doesn't seem to catch the setting passed by the boot_loader, maybe it should be pci_config_mechanism in safemode instead ? * Added a TODO about respecting the "don't call the BIOS" setting. [ François Revol <revol@xxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev43551 Commit: 78ce5eb732d6ae6885219fac29271d32c16e942e URL: http://cgit.haiku-os.org/haiku/commit/?id=78ce5eb Author: François Revol <revol@xxxxxxx> Date: Fri Dec 23 12:55:23 2011 UTC ---------------------------------------------------------------------------- 1 files changed, 23 insertions(+), 0 deletions(-) .../bus_managers/pci/arch/x86/pci_controller.c | 23 ++++++++++++++++ ---------------------------------------------------------------------------- diff --git a/src/add-ons/kernel/bus_managers/pci/arch/x86/pci_controller.c b/src/add-ons/kernel/bus_managers/pci/arch/x86/pci_controller.c index 98b5063..79431d8 100644 --- a/src/add-ons/kernel/bus_managers/pci/arch/x86/pci_controller.c +++ b/src/add-ons/kernel/bus_managers/pci/arch/x86/pci_controller.c @@ -4,6 +4,8 @@ */ #include <KernelExport.h> +#include <driver_settings.h> +#include <string.h> #include "pci_irq.h" #include "pci_bios.h" #include "pci_private.h" @@ -211,12 +213,33 @@ pci_controller_init(void) bool search_mech1 = true; bool search_mech2 = true; bool search_bios = true; + void *config = NULL; status_t status; status = pci_x86_irq_init(); if (status != B_OK) return status; + config = load_driver_settings("pci"); + if (config) { + const char *mech = get_driver_parameter(config, "mechanism", + NULL, NULL); + if (mech) { + search_mech1 = search_mech2 = search_bios = false; + if (strcmp(mech, "1") == 0) + search_mech1 = true; + else if (strcmp(mech, "2") == 0) + search_mech2 = true; + else if (strcmp(mech, "bios") == 0) + search_bios = true; + else + panic("Unknown pci config mechanism setting %s\n", mech); + } + unload_driver_settings(config); + } + + // TODO: check safemode "don't call the BIOS" setting and unset search_bios! + // PCI configuration mechanism 1 is the preferred one. // If it doesn't work, try mechanism 2. // Finally, try to fallback to PCI BIOS