summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-12-06 03:47:14 +0000
committerpeter <peter@FreeBSD.org>2000-12-06 03:47:14 +0000
commitf21988fc406987260c7a9e6dae3a9095511363ba (patch)
treef3c0d2446906eb537fe791be8cd7da5a0f08a1c6 /sys
parente40c6d5192329b031191f5c5f4dafc5893273528 (diff)
downloadFreeBSD-src-f21988fc406987260c7a9e6dae3a9095511363ba.zip
FreeBSD-src-f21988fc406987260c7a9e6dae3a9095511363ba.tar.gz
This is kind of a nasty hack, but it appears to solve the Compaq DL360
SMP problem. Compaq, in their infinite wisdom, forgot to put the IO apic intpin #0 connection to the 8259 PIC into the mptable. This hack is to look and see if intpin #0 has *no* table entry and adds a fake ExtInt entry for the remap routines to use. isa/clock.c will still test the interrupts. This entry is only ever used on an already broken system.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/mp_machdep.c15
-rw-r--r--sys/amd64/amd64/mptable.c15
-rw-r--r--sys/amd64/include/mptable.h15
-rw-r--r--sys/i386/i386/mp_machdep.c15
-rw-r--r--sys/i386/i386/mptable.c15
-rw-r--r--sys/i386/include/mptable.h15
-rw-r--r--sys/kern/subr_smp.c15
7 files changed, 91 insertions, 14 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index d37b6d6..bed96be 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -875,7 +875,7 @@ mptable_pass2(void)
M_DEVBUF, M_WAITOK);
MALLOC(ioapic, volatile ioapic_t **, sizeof(ioapic_t *) * mp_napics,
M_DEVBUF, M_WAITOK);
- MALLOC(io_apic_ints, io_int *, sizeof(io_int) * nintrs,
+ MALLOC(io_apic_ints, io_int *, sizeof(io_int) * (nintrs + 1),
M_DEVBUF, M_WAITOK);
MALLOC(bus_data, bus_datum *, sizeof(bus_datum) * mp_nbusses,
M_DEVBUF, M_WAITOK);
@@ -916,7 +916,7 @@ mptable_pass2(void)
bus_data[x].bus_id = 0xff;
/* clear IO APIC INT table */
- for (x = 0; x < nintrs; ++x) {
+ for (x = 0; x < (nintrs + 1); ++x) {
io_apic_ints[x].int_type = 0xff;
io_apic_ints[x].int_vector = 0xff;
}
@@ -1229,6 +1229,17 @@ fix_mp_table(void)
panic("Free physical APIC ID not usable");
}
fix_id_to_io_mapping();
+
+ /* detect and fix broken Compaq MP table */
+ if (apic_int_type(0, 0) == -1) {
+ printf("APIC_IO: MP table broken: 8259->APIC entry missing!\n");
+ io_apic_ints[nintrs].int_type = 3; /* ExtInt */
+ io_apic_ints[nintrs].int_vector = 0xff; /* Unassigned */
+ /* XXX fixme, set src bus id etc, but it doesn't seem to hurt */
+ io_apic_ints[nintrs].dst_apic_id = IO_TO_ID(0);
+ io_apic_ints[nintrs].dst_apic_int = 0; /* Pin 0 */
+ nintrs++;
+ }
}
diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c
index d37b6d6..bed96be 100644
--- a/sys/amd64/amd64/mptable.c
+++ b/sys/amd64/amd64/mptable.c
@@ -875,7 +875,7 @@ mptable_pass2(void)
M_DEVBUF, M_WAITOK);
MALLOC(ioapic, volatile ioapic_t **, sizeof(ioapic_t *) * mp_napics,
M_DEVBUF, M_WAITOK);
- MALLOC(io_apic_ints, io_int *, sizeof(io_int) * nintrs,
+ MALLOC(io_apic_ints, io_int *, sizeof(io_int) * (nintrs + 1),
M_DEVBUF, M_WAITOK);
MALLOC(bus_data, bus_datum *, sizeof(bus_datum) * mp_nbusses,
M_DEVBUF, M_WAITOK);
@@ -916,7 +916,7 @@ mptable_pass2(void)
bus_data[x].bus_id = 0xff;
/* clear IO APIC INT table */
- for (x = 0; x < nintrs; ++x) {
+ for (x = 0; x < (nintrs + 1); ++x) {
io_apic_ints[x].int_type = 0xff;
io_apic_ints[x].int_vector = 0xff;
}
@@ -1229,6 +1229,17 @@ fix_mp_table(void)
panic("Free physical APIC ID not usable");
}
fix_id_to_io_mapping();
+
+ /* detect and fix broken Compaq MP table */
+ if (apic_int_type(0, 0) == -1) {
+ printf("APIC_IO: MP table broken: 8259->APIC entry missing!\n");
+ io_apic_ints[nintrs].int_type = 3; /* ExtInt */
+ io_apic_ints[nintrs].int_vector = 0xff; /* Unassigned */
+ /* XXX fixme, set src bus id etc, but it doesn't seem to hurt */
+ io_apic_ints[nintrs].dst_apic_id = IO_TO_ID(0);
+ io_apic_ints[nintrs].dst_apic_int = 0; /* Pin 0 */
+ nintrs++;
+ }
}
diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h
index d37b6d6..bed96be 100644
--- a/sys/amd64/include/mptable.h
+++ b/sys/amd64/include/mptable.h
@@ -875,7 +875,7 @@ mptable_pass2(void)
M_DEVBUF, M_WAITOK);
MALLOC(ioapic, volatile ioapic_t **, sizeof(ioapic_t *) * mp_napics,
M_DEVBUF, M_WAITOK);
- MALLOC(io_apic_ints, io_int *, sizeof(io_int) * nintrs,
+ MALLOC(io_apic_ints, io_int *, sizeof(io_int) * (nintrs + 1),
M_DEVBUF, M_WAITOK);
MALLOC(bus_data, bus_datum *, sizeof(bus_datum) * mp_nbusses,
M_DEVBUF, M_WAITOK);
@@ -916,7 +916,7 @@ mptable_pass2(void)
bus_data[x].bus_id = 0xff;
/* clear IO APIC INT table */
- for (x = 0; x < nintrs; ++x) {
+ for (x = 0; x < (nintrs + 1); ++x) {
io_apic_ints[x].int_type = 0xff;
io_apic_ints[x].int_vector = 0xff;
}
@@ -1229,6 +1229,17 @@ fix_mp_table(void)
panic("Free physical APIC ID not usable");
}
fix_id_to_io_mapping();
+
+ /* detect and fix broken Compaq MP table */
+ if (apic_int_type(0, 0) == -1) {
+ printf("APIC_IO: MP table broken: 8259->APIC entry missing!\n");
+ io_apic_ints[nintrs].int_type = 3; /* ExtInt */
+ io_apic_ints[nintrs].int_vector = 0xff; /* Unassigned */
+ /* XXX fixme, set src bus id etc, but it doesn't seem to hurt */
+ io_apic_ints[nintrs].dst_apic_id = IO_TO_ID(0);
+ io_apic_ints[nintrs].dst_apic_int = 0; /* Pin 0 */
+ nintrs++;
+ }
}
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index d37b6d6..bed96be 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -875,7 +875,7 @@ mptable_pass2(void)
M_DEVBUF, M_WAITOK);
MALLOC(ioapic, volatile ioapic_t **, sizeof(ioapic_t *) * mp_napics,
M_DEVBUF, M_WAITOK);
- MALLOC(io_apic_ints, io_int *, sizeof(io_int) * nintrs,
+ MALLOC(io_apic_ints, io_int *, sizeof(io_int) * (nintrs + 1),
M_DEVBUF, M_WAITOK);
MALLOC(bus_data, bus_datum *, sizeof(bus_datum) * mp_nbusses,
M_DEVBUF, M_WAITOK);
@@ -916,7 +916,7 @@ mptable_pass2(void)
bus_data[x].bus_id = 0xff;
/* clear IO APIC INT table */
- for (x = 0; x < nintrs; ++x) {
+ for (x = 0; x < (nintrs + 1); ++x) {
io_apic_ints[x].int_type = 0xff;
io_apic_ints[x].int_vector = 0xff;
}
@@ -1229,6 +1229,17 @@ fix_mp_table(void)
panic("Free physical APIC ID not usable");
}
fix_id_to_io_mapping();
+
+ /* detect and fix broken Compaq MP table */
+ if (apic_int_type(0, 0) == -1) {
+ printf("APIC_IO: MP table broken: 8259->APIC entry missing!\n");
+ io_apic_ints[nintrs].int_type = 3; /* ExtInt */
+ io_apic_ints[nintrs].int_vector = 0xff; /* Unassigned */
+ /* XXX fixme, set src bus id etc, but it doesn't seem to hurt */
+ io_apic_ints[nintrs].dst_apic_id = IO_TO_ID(0);
+ io_apic_ints[nintrs].dst_apic_int = 0; /* Pin 0 */
+ nintrs++;
+ }
}
diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c
index d37b6d6..bed96be 100644
--- a/sys/i386/i386/mptable.c
+++ b/sys/i386/i386/mptable.c
@@ -875,7 +875,7 @@ mptable_pass2(void)
M_DEVBUF, M_WAITOK);
MALLOC(ioapic, volatile ioapic_t **, sizeof(ioapic_t *) * mp_napics,
M_DEVBUF, M_WAITOK);
- MALLOC(io_apic_ints, io_int *, sizeof(io_int) * nintrs,
+ MALLOC(io_apic_ints, io_int *, sizeof(io_int) * (nintrs + 1),
M_DEVBUF, M_WAITOK);
MALLOC(bus_data, bus_datum *, sizeof(bus_datum) * mp_nbusses,
M_DEVBUF, M_WAITOK);
@@ -916,7 +916,7 @@ mptable_pass2(void)
bus_data[x].bus_id = 0xff;
/* clear IO APIC INT table */
- for (x = 0; x < nintrs; ++x) {
+ for (x = 0; x < (nintrs + 1); ++x) {
io_apic_ints[x].int_type = 0xff;
io_apic_ints[x].int_vector = 0xff;
}
@@ -1229,6 +1229,17 @@ fix_mp_table(void)
panic("Free physical APIC ID not usable");
}
fix_id_to_io_mapping();
+
+ /* detect and fix broken Compaq MP table */
+ if (apic_int_type(0, 0) == -1) {
+ printf("APIC_IO: MP table broken: 8259->APIC entry missing!\n");
+ io_apic_ints[nintrs].int_type = 3; /* ExtInt */
+ io_apic_ints[nintrs].int_vector = 0xff; /* Unassigned */
+ /* XXX fixme, set src bus id etc, but it doesn't seem to hurt */
+ io_apic_ints[nintrs].dst_apic_id = IO_TO_ID(0);
+ io_apic_ints[nintrs].dst_apic_int = 0; /* Pin 0 */
+ nintrs++;
+ }
}
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index d37b6d6..bed96be 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -875,7 +875,7 @@ mptable_pass2(void)
M_DEVBUF, M_WAITOK);
MALLOC(ioapic, volatile ioapic_t **, sizeof(ioapic_t *) * mp_napics,
M_DEVBUF, M_WAITOK);
- MALLOC(io_apic_ints, io_int *, sizeof(io_int) * nintrs,
+ MALLOC(io_apic_ints, io_int *, sizeof(io_int) * (nintrs + 1),
M_DEVBUF, M_WAITOK);
MALLOC(bus_data, bus_datum *, sizeof(bus_datum) * mp_nbusses,
M_DEVBUF, M_WAITOK);
@@ -916,7 +916,7 @@ mptable_pass2(void)
bus_data[x].bus_id = 0xff;
/* clear IO APIC INT table */
- for (x = 0; x < nintrs; ++x) {
+ for (x = 0; x < (nintrs + 1); ++x) {
io_apic_ints[x].int_type = 0xff;
io_apic_ints[x].int_vector = 0xff;
}
@@ -1229,6 +1229,17 @@ fix_mp_table(void)
panic("Free physical APIC ID not usable");
}
fix_id_to_io_mapping();
+
+ /* detect and fix broken Compaq MP table */
+ if (apic_int_type(0, 0) == -1) {
+ printf("APIC_IO: MP table broken: 8259->APIC entry missing!\n");
+ io_apic_ints[nintrs].int_type = 3; /* ExtInt */
+ io_apic_ints[nintrs].int_vector = 0xff; /* Unassigned */
+ /* XXX fixme, set src bus id etc, but it doesn't seem to hurt */
+ io_apic_ints[nintrs].dst_apic_id = IO_TO_ID(0);
+ io_apic_ints[nintrs].dst_apic_int = 0; /* Pin 0 */
+ nintrs++;
+ }
}
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index d37b6d6..bed96be 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -875,7 +875,7 @@ mptable_pass2(void)
M_DEVBUF, M_WAITOK);
MALLOC(ioapic, volatile ioapic_t **, sizeof(ioapic_t *) * mp_napics,
M_DEVBUF, M_WAITOK);
- MALLOC(io_apic_ints, io_int *, sizeof(io_int) * nintrs,
+ MALLOC(io_apic_ints, io_int *, sizeof(io_int) * (nintrs + 1),
M_DEVBUF, M_WAITOK);
MALLOC(bus_data, bus_datum *, sizeof(bus_datum) * mp_nbusses,
M_DEVBUF, M_WAITOK);
@@ -916,7 +916,7 @@ mptable_pass2(void)
bus_data[x].bus_id = 0xff;
/* clear IO APIC INT table */
- for (x = 0; x < nintrs; ++x) {
+ for (x = 0; x < (nintrs + 1); ++x) {
io_apic_ints[x].int_type = 0xff;
io_apic_ints[x].int_vector = 0xff;
}
@@ -1229,6 +1229,17 @@ fix_mp_table(void)
panic("Free physical APIC ID not usable");
}
fix_id_to_io_mapping();
+
+ /* detect and fix broken Compaq MP table */
+ if (apic_int_type(0, 0) == -1) {
+ printf("APIC_IO: MP table broken: 8259->APIC entry missing!\n");
+ io_apic_ints[nintrs].int_type = 3; /* ExtInt */
+ io_apic_ints[nintrs].int_vector = 0xff; /* Unassigned */
+ /* XXX fixme, set src bus id etc, but it doesn't seem to hurt */
+ io_apic_ints[nintrs].dst_apic_id = IO_TO_ID(0);
+ io_apic_ints[nintrs].dst_apic_int = 0; /* Pin 0 */
+ nintrs++;
+ }
}
OpenPOWER on IntegriCloud