Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/sommerfeld_i386mp_1]: src/sys/arch/i386/i386 Remove pointless test.
details: https://anonhg.NetBSD.org/src/rev/b11c0d20624a
branches: sommerfeld_i386mp_1
changeset: 482516:b11c0d20624a
user: sommerfeld <sommerfeld%NetBSD.org@localhost>
date: Sat Apr 27 14:32:36 2002 +0000
description:
Remove pointless test.
diffstat:
sys/arch/i386/i386/mpbios.c | 125 +++++++++++++++++++++----------------------
1 files changed, 61 insertions(+), 64 deletions(-)
diffs (truncated from 459 to 300 lines):
diff -r dc8b6c0331a3 -r b11c0d20624a sys/arch/i386/i386/mpbios.c
--- a/sys/arch/i386/i386/mpbios.c Sat Apr 27 14:25:03 2002 +0000
+++ b/sys/arch/i386/i386/mpbios.c Sat Apr 27 14:32:36 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mpbios.c,v 1.1.2.13 2001/12/29 23:31:04 sommerfeld Exp $ */
+/* $NetBSD: mpbios.c,v 1.1.2.14 2002/04/27 14:32:36 sommerfeld Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -151,7 +151,7 @@
"bios"
};
-struct mp_map
+struct mp_map
{
vaddr_t baseva;
int vsize;
@@ -199,7 +199,7 @@
#else
int mp_verbose = 0;
#endif
-
+
struct cpu_functions mpbios_cpu_funcs = { mpbios_cpu_start, NULL, mpbios_cpu_start_cleanup };
int
@@ -241,7 +241,7 @@
paddr_t endpa = i386_round_page(pa + len);
vaddr_t va = uvm_km_valloc(kernel_map, endpa - pgpa);
vaddr_t retva = va + (pa & PGOFSET);
-
+
handle->pa = pa;
handle->pg = pgpa;
handle->psize = len;
@@ -278,22 +278,22 @@
int cthlen;
const u_int8_t *mpbios_page;
int scan_loc;
-
+
struct mp_map t;
-
+
/* see if EBDA exists */
mpbios_page = mpbios_map (0, NBPG, &t);
ebda = *(const u_int16_t *) (&mpbios_page[0x40e]);
ebda <<= 4;
-
+
memtop = *(const u_int16_t *) (&mpbios_page[0x413]);
memtop <<= 10;
mpbios_page = NULL;
mpbios_unmap(&t);
-
+
scan_loc = 0;
if (ebda && ebda < IOM_BEGIN ) {
@@ -301,7 +301,7 @@
if (mp_fps != NULL)
goto found;
}
-
+
scan_loc = 1;
if (memtop && memtop <= IOM_BEGIN ) {
@@ -309,9 +309,9 @@
if (mp_fps != NULL)
goto found;
}
-
+
scan_loc = 2;
-
+
mp_fps = mpbios_search(self, BIOS_BASE, BIOS_COUNT, &mp_fp_map);
if (mp_fps != NULL)
goto found;
@@ -329,7 +329,7 @@
printf("%s: MP fps invalid: "
"no default config and no configuration table\n",
self->dv_xname);
-
+
goto err;
}
printf("%s: MP default configuration %d\n",
@@ -342,9 +342,9 @@
mp_cth = mpbios_map (cthpa, sizeof (*mp_cth), &mp_cfg_table_map);
cthlen = mp_cth->base_len;
mpbios_unmap(&mp_cfg_table_map);
-
+
mp_cth = mpbios_map (cthpa, cthlen, &mp_cfg_table_map);
-
+
if (mp_verbose)
printf("%s: MP config table at 0x%lx, %d bytes long\n",
self->dv_xname, cthpa, cthlen);
@@ -355,7 +355,7 @@
MP_CT_SIG, mp_cth->signature);
goto err;
}
-
+
if (mpbios_cksum(mp_cth, cthlen)) {
printf ("%s: MP Configuration Table checksum mismatch\n",
self->dv_xname);
@@ -379,15 +379,15 @@
* Simple byte checksum used on config tables.
*/
-inline static int
-mpbios_cksum (start, len)
+inline static int
+mpbios_cksum (start, len)
const void *start;
int len;
{
unsigned char res=0;
const char *p = start;
const char *end = p + len;
-
+
while (p < end)
res += *p++;
@@ -415,15 +415,15 @@
int i, len;
const struct mpbios_fps *m;
int end = count - sizeof(*m);
- const u_int8_t *base = mpbios_map (start, count, &t);
+ const u_int8_t *base = mpbios_map (start, count, &t);
if (mp_verbose)
printf("%s: scanning 0x%lx to 0x%lx for MP signature\n",
self->dv_xname, start, start+count-sizeof(*m));
-
+
for (i = 0; i <= end; i += 4) {
m = (struct mpbios_fps *)&base[i];
-
+
if ((m->signature == MP_FP_SIG) &&
((len = m->length << 4) != 0) &&
mpbios_cksum(m, (m->length << 4)) == 0) {
@@ -434,7 +434,7 @@
}
}
mpbios_unmap(&t);
-
+
return 0;
}
@@ -505,7 +505,7 @@
int type;
int intr_cnt, cur_intr;
paddr_t lapic_base;
-
+
printf ("%s: Intel MP Specification ", self->dv_xname);
switch (mp_fps->spec_rev) {
@@ -518,7 +518,7 @@
default:
printf("(unrecognized rev %d)", mp_fps->spec_rev);
}
-
+
/*
* looks like we've got a MP system. start setting up
* infrastructure..
@@ -528,16 +528,16 @@
lapic_base = LAPIC_BASE;
if (mp_cth != NULL)
lapic_base = (paddr_t)mp_cth->apic_address;
-
+
lapic_boot_init(lapic_base);
-
+
/* check for use of 'default' configuration */
if (mp_fps->mpfb1 != 0) {
struct mpbios_proc pe;
printf("\n%s: MP default configuration %d\n",
self->dv_xname, mp_fps->mpfb1);
-
+
/* use default addresses */
pe.apic_id = lapic_cpu_number();
pe.cpu_flags = PROCENTRY_FLAG_EN|PROCENTRY_FLAG_BP;
@@ -575,10 +575,10 @@
position = (const u_int8_t *)(mp_cth);
end = position + mp_cth->base_len;
position += sizeof(*mp_cth);
-
+
count = mp_cth->entry_count;
intr_cnt = 0;
-
+
while ((count--) && (position < end)) {
type = *position;
if (type >= MPS_MCT_NTYPES) {
@@ -618,12 +618,12 @@
memset(mp_busses, 0, sizeof(struct mp_bus) * mp_nbus);
mp_intrs = malloc(sizeof(struct mp_intr_map)*intr_cnt,
M_DEVBUF, M_NOWAIT);
-
+
/* re-walk the table, recording info of interest */
position = (const u_int8_t *) mp_cth + sizeof(*mp_cth);
count = mp_cth->entry_count;
cur_intr = 0;
-
+
while ((count--) && (position < end)) {
switch (type = *(u_char *) position) {
case MPS_MCT_CPU:
@@ -652,7 +652,7 @@
}
if (mp_verbose && mp_cth->ext_len)
printf("%s: MP WARNING: %d bytes of extended entries not examined\n",
- self->dv_xname,
+ self->dv_xname,
mp_cth->ext_len);
}
/* Clean up. */
@@ -753,13 +753,13 @@
default:
panic("unknown MPS interrupt polarity %d", mpspo);
}
-
+
if (entry->int_type != MPS_INTTYPE_INT) {
mp_cfg_special_intr(entry, redir);
return;
}
*redir |= (IOAPIC_REDLO_DEL_LOPRI<<IOAPIC_REDLO_DEL_SHIFT);
-
+
switch (mpstrig) {
case MPS_INTTR_DEF:
case MPS_INTTR_LEVEL:
@@ -769,7 +769,7 @@
*redir &= ~IOAPIC_REDLO_LEVEL;
break;
default:
- panic("unknown MPS interrupt trigger %d", mpstrig);
+ panic("unknown MPS interrupt trigger %d", mpstrig);
}
}
@@ -792,13 +792,13 @@
default:
panic("unknown MPS interrupt polarity %d", mpspo);
}
-
+
if (entry->int_type != MPS_INTTYPE_INT) {
mp_cfg_special_intr(entry, redir);
return;
}
*redir |= (IOAPIC_REDLO_DEL_LOPRI<<IOAPIC_REDLO_DEL_SHIFT);
-
+
switch (mpstrig) {
case MPS_INTTR_LEVEL:
*redir |= IOAPIC_REDLO_LEVEL;
@@ -813,13 +813,13 @@
*/
if (mp_busses[entry->src_bus_id].mb_data &
(1<<entry->src_bus_irq)) {
- *redir |= IOAPIC_REDLO_LEVEL;
+ *redir |= IOAPIC_REDLO_LEVEL;
} else {
*redir &= ~IOAPIC_REDLO_LEVEL;
}
break;
default:
- panic("unknown MPS interrupt trigger %d", mpstrig);
+ panic("unknown MPS interrupt trigger %d", mpstrig);
}
Home |
Main Index |
Thread Index |
Old Index