PERFORCE change 46101 for review
Peter Wemm
peter at FreeBSD.org
Wed Jan 28 16:29:19 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=46101
Change 46101 by peter at peter_daintree on 2004/01/28 16:28:45
p4 integ -I -b i386_hammer
Affected files ...
.. //depot/projects/hammer/sys/amd64/acpica/madt.c#28 integrate
.. //depot/projects/hammer/sys/amd64/amd64/apic_vector.S#14 integrate
.. //depot/projects/hammer/sys/amd64/amd64/identcpu.c#19 integrate
.. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#31 integrate
.. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#54 integrate
.. //depot/projects/hammer/sys/amd64/amd64/pmap.c#53 integrate
.. //depot/projects/hammer/sys/amd64/amd64/trap.c#38 integrate
.. //depot/projects/hammer/sys/amd64/conf/GENERIC#29 integrate
.. //depot/projects/hammer/sys/amd64/isa/atpic_vector.S#12 integrate
Differences ...
==== //depot/projects/hammer/sys/amd64/acpica/madt.c#28 (text+ko) ====
@@ -320,13 +320,22 @@
}
/*
- * Run through the MP table enumerating I/O APICs.
+ * Enumerate I/O APICs and setup interrupt sources.
*/
static int
madt_setup_io(void)
{
int i;
+ /* Try to initialize ACPI so that we can access the FADT. */
+ i = acpi_Startup();
+ if (ACPI_FAILURE(i)) {
+ printf("MADT: ACPI Startup failed with %s\n",
+ AcpiFormatException(i));
+ printf("Try disabling either ACPI or apic support.\n");
+ panic("Using MADT but ACPI doesn't work");
+ }
+
/* First, we run through adding I/O APIC's. */
madt_walk_table(madt_parse_apics, NULL);
@@ -523,6 +532,7 @@
{
void *new_ioapic, *old_ioapic;
u_int new_pin, old_pin;
+ int force_lo;
if (bootverbose)
printf("MADT: intr override: source %u, irq %u\n",
@@ -535,9 +545,27 @@
return;
}
+ /*
+ * If the SCI is remapped to a non-ISA global interrupt,
+ * force it to level trigger and active-lo polarity.
+ * If the SCI is identity mapped but has edge trigger and
+ * active-hi polarity, also force it to use level/lo.
+ */
+ force_lo = 0;
+ if (intr->Source == AcpiGbl_FADT->SciInt)
+ if (intr->Interrupt > 15 || (intr->Interrupt == intr->Source &&
+ intr->TriggerMode == TRIGGER_EDGE &&
+ intr->Polarity == POLARITY_ACTIVE_HIGH))
+ force_lo = 1;
+
if (intr->Source != intr->Interrupt) {
- /* XXX: This assumes that the SCI uses IRQ 9. */
- if (intr->Interrupt > 15 && intr->Source == 9)
+ /*
+ * If the SCI is remapped to a non-ISA global interrupt,
+ * then override the vector we use to setup and allocate
+ * the interrupt.
+ */
+ if (intr->Interrupt > 15 &&
+ intr->Source == AcpiGbl_FADT->SciInt)
acpi_OverrideInterruptLevel(intr->Interrupt);
else
ioapic_remap_vector(new_ioapic, new_pin, intr->Source);
@@ -549,10 +577,18 @@
intr->Source)
ioapic_disable_pin(old_ioapic, old_pin);
}
- ioapic_set_triggermode(new_ioapic, new_pin,
- interrupt_trigger(intr->TriggerMode));
- ioapic_set_polarity(new_ioapic, new_pin,
- interrupt_polarity(intr->Polarity));
+ if (force_lo) {
+ printf(
+ "MADT: Forcing active-lo polarity and level trigger for IRQ %d\n",
+ intr->Source);
+ ioapic_set_polarity(new_ioapic, new_pin, 0);
+ ioapic_set_triggermode(new_ioapic, new_pin, 0);
+ } else {
+ ioapic_set_polarity(new_ioapic, new_pin,
+ interrupt_polarity(intr->Polarity));
+ ioapic_set_triggermode(new_ioapic, new_pin,
+ interrupt_trigger(intr->TriggerMode));
+ }
}
/*
==== //depot/projects/hammer/sys/amd64/amd64/apic_vector.S#14 (text+ko) ====
==== //depot/projects/hammer/sys/amd64/amd64/identcpu.c#19 (text+ko) ====
==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#31 (text+ko) ====
@@ -643,7 +643,6 @@
* private the sys/i386 code. The public interface for the rest of the
* kernel is defined in mp_machdep.c.
*/
-#define DETECT_DEADLOCK
int
lapic_ipi_wait(int delay)
==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#54 (text+ko) ====
@@ -80,8 +80,8 @@
/*
* CPU topology map datastructures for HTT.
*/
-struct cpu_group mp_groups[MAXCPU];
-struct cpu_top mp_top;
+static struct cpu_group mp_groups[MAXCPU];
+static struct cpu_top mp_top;
/* AP uses this during bootstrap. Do not staticize. */
char *bootSTK;
==== //depot/projects/hammer/sys/amd64/amd64/pmap.c#53 (text+ko) ====
@@ -117,6 +117,7 @@
#include <sys/sx.h>
#include <sys/user.h>
#include <sys/vmmeter.h>
+#include <sys/sched.h>
#include <sys/sysctl.h>
#ifdef SMP
#include <sys/smp.h>
==== //depot/projects/hammer/sys/amd64/amd64/trap.c#38 (text+ko) ====
==== //depot/projects/hammer/sys/amd64/conf/GENERIC#29 (text+ko) ====
==== //depot/projects/hammer/sys/amd64/isa/atpic_vector.S#12 (text+ko) ====
More information about the p4-projects
mailing list