PERFORCE change 68687 for review

Peter Wemm peter at FreeBSD.org
Mon Jan 10 19:26:29 PST 2005


http://perforce.freebsd.org/chv.cgi?CH=68687

Change 68687 by peter at peter_overcee on 2005/01/11 03:26:01

	integ -b i386_hammer

Affected files ...

.. //depot/projects/hammer/sys/amd64/amd64/busdma_machdep.c#30 integrate
.. //depot/projects/hammer/sys/amd64/amd64/db_disasm.c#5 integrate
.. //depot/projects/hammer/sys/amd64/amd64/db_interface.c#24 integrate
.. //depot/projects/hammer/sys/amd64/amd64/db_trace.c#26 integrate
.. //depot/projects/hammer/sys/amd64/amd64/exception.S#32 integrate
.. //depot/projects/hammer/sys/amd64/amd64/gdb_machdep.c#10 integrate
.. //depot/projects/hammer/sys/amd64/amd64/mpboot.S#13 integrate
.. //depot/projects/hammer/sys/amd64/amd64/mptable.c#33 integrate
.. //depot/projects/hammer/sys/amd64/amd64/sys_machdep.c#16 integrate
.. //depot/projects/hammer/sys/amd64/amd64/vm_machdep.c#62 integrate
.. //depot/projects/hammer/sys/amd64/conf/GENERIC#63 integrate
.. //depot/projects/hammer/sys/amd64/include/_limits.h#10 integrate
.. //depot/projects/hammer/sys/amd64/include/apicreg.h#12 integrate
.. //depot/projects/hammer/sys/amd64/include/bus_amd64.h#11 integrate
.. //depot/projects/hammer/sys/amd64/include/bus_dma.h#14 integrate
.. //depot/projects/hammer/sys/amd64/include/bus_memio.h#7 integrate
.. //depot/projects/hammer/sys/amd64/include/bus_pio.h#7 integrate
.. //depot/projects/hammer/sys/amd64/include/clock.h#14 integrate
.. //depot/projects/hammer/sys/amd64/include/cputypes.h#11 integrate
.. //depot/projects/hammer/sys/amd64/include/db_machdep.h#13 integrate
.. //depot/projects/hammer/sys/amd64/include/float.h#14 integrate
.. //depot/projects/hammer/sys/amd64/include/limits.h#9 integrate
.. //depot/projects/hammer/sys/amd64/include/metadata.h#6 integrate
.. //depot/projects/hammer/sys/amd64/include/mptable.h#9 integrate
.. //depot/projects/hammer/sys/amd64/include/pci_cfgreg.h#12 integrate
.. //depot/projects/hammer/sys/amd64/include/pmap.h#52 integrate
.. //depot/projects/hammer/sys/amd64/include/proc.h#14 integrate
.. //depot/projects/hammer/sys/amd64/include/profile.h#24 integrate
.. //depot/projects/hammer/sys/amd64/include/ptrace.h#8 integrate
.. //depot/projects/hammer/sys/amd64/include/resource.h#6 integrate
.. //depot/projects/hammer/sys/amd64/include/runq.h#10 integrate
.. //depot/projects/hammer/sys/amd64/include/signal.h#12 integrate
.. //depot/projects/hammer/sys/amd64/include/smp.h#20 integrate
.. //depot/projects/hammer/sys/amd64/isa/isa.c#14 integrate
.. //depot/projects/hammer/sys/amd64/pci/pci_bus.c#28 integrate
.. //depot/projects/hammer/sys/amd64/pci/pci_cfgreg.c#19 integrate

Differences ...

==== //depot/projects/hammer/sys/amd64/amd64/busdma_machdep.c#30 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/amd64/db_disasm.c#5 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/amd64/db_interface.c#24 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/amd64/db_trace.c#26 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/amd64/exception.S#32 (text+ko) ====

@@ -130,7 +130,7 @@
 	TRAP_ERR(T_PROTFLT)
 IDTVEC(align)
 	TRAP_ERR(T_ALIGNFLT)
-	
+
 	/*
 	 * alltraps entry point.  Use swapgs if this is the first time in the
 	 * kernel from userland.  Reenable interrupts if they were enabled

==== //depot/projects/hammer/sys/amd64/amd64/gdb_machdep.c#10 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/amd64/mpboot.S#13 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/amd64/mptable.c#33 (text+ko) ====

@@ -157,6 +157,7 @@
 static void	mptable_parse_apics_and_busses(void);
 static void	mptable_parse_apics_and_busses_handler(u_char *entry,
     void *arg);
+static void	mptable_parse_default_config_ints(void);
 static void	mptable_parse_ints(void);
 static void	mptable_parse_ints_handler(u_char *entry, void *arg);
 static void	mptable_parse_io_int(int_entry_ptr intr);
@@ -246,9 +247,19 @@
 	mpfps = (mpfps_t)(KERNBASE + x);
 
 	/* Map in the configuration table if it exists. */
-	if (mpfps->config_type != 0)
+	if (mpfps->config_type != 0) {
+		if (bootverbose)
+			printf(
+		"MP Table version 1.%d found using Default Configuration %d\n",
+			    mpfps->spec_rev, mpfps->config_type);
+		if (mpfps->config_type != 5 && mpfps->config_type != 6) {
+			printf(
+			"MP Table Default Configuration %d is unsupported\n",
+			    mpfps->config_type);
+			return (ENXIO);
+		}
 		mpct = NULL;
-	else {
+	} else {
 		if ((uintptr_t)mpfps->pap >= 1024 * 1024) {
 			printf("%s: Unable to map MP Configuration Table\n",
 			    __func__);
@@ -310,7 +321,7 @@
 	printf("MPTable: <");
 	if (mpfps->config_type != 0) {
 		lapic_init(DEFAULT_APIC_BASE);
-		printf("Preset Config %d", mpfps->config_type);
+		printf("Default Configuration %d", mpfps->config_type);
 	} else {
 		lapic_init((uintptr_t)mpct->apic_address);
 		printf("%.*s %.*s", (int)sizeof(mpct->oem_id), mpct->oem_id,
@@ -521,13 +532,13 @@
 
 	/* Is this a pre-defined config? */
 	if (mpfps->config_type != 0) {
-		ioapics[0] = ioapic_create(DEFAULT_IO_APIC_BASE, 2, 0);
+		ioapics[2] = ioapic_create(DEFAULT_IO_APIC_BASE, 2, 0);
 		busses[0].bus_id = 0;
-		busses[0].bus_type = default_data[mpfps->config_type][2];
+		busses[0].bus_type = default_data[mpfps->config_type - 1][2];
 		if (mptable_nbusses > 1) {
 			busses[1].bus_id = 1;
 			busses[1].bus_type =
-			    default_data[mpfps->config_type][4];
+			    default_data[mpfps->config_type - 1][4];
 		}
 	} else
 		mptable_walk_table(mptable_parse_apics_and_busses_handler,
@@ -753,7 +764,58 @@
 		break;
 	}
 }
-	
+
+/*
+ * Configure interrupt pins for a default configuration.  For details see
+ * Table 5-2 in Section 5 of the MP Table specification.
+ */
+static void
+mptable_parse_default_config_ints(void)
+{
+	struct INTENTRY entry;
+	int pin;
+
+	/*
+	 * All default configs route IRQs from bus 0 to the first 16 pins
+	 * of the first I/O APIC with an APIC ID of 2.
+	 */
+	entry.type = MPCT_ENTRY_INT;
+	entry.int_flags = INTENTRY_FLAGS_POLARITY_CONFORM |
+	    INTENTRY_FLAGS_TRIGGER_CONFORM;
+	entry.src_bus_id = 0;
+	entry.dst_apic_id = 2;
+
+	/* Run through all 16 pins. */
+	for (pin = 0; pin < 16; pin++) {
+		entry.dst_apic_int = pin;
+		switch (pin) {
+		case 0:
+			/* Pin 0 is an ExtINT pin. */
+			entry.int_type = INTENTRY_TYPE_EXTINT;
+			break;
+		case 2:
+			/* IRQ 0 is routed to pin 2. */
+			entry.int_type = INTENTRY_TYPE_INT;
+			entry.src_bus_irq = 0;
+			break;
+		default:
+			/* All other pins are identity mapped. */
+			entry.int_type = INTENTRY_TYPE_INT;
+			entry.src_bus_irq = pin;
+			break;
+		}
+		mptable_parse_io_int(&entry);
+	}
+
+	/* Certain configs disable certain pins. */
+	if (mpfps->config_type == 7)
+		ioapic_disable_pin(ioapics[2], 0);
+	if (mpfps->config_type == 2) {
+		ioapic_disable_pin(ioapics[2], 2);
+		ioapic_disable_pin(ioapics[2], 13);
+	}
+}
+
 /*
  * Configure the interrupt pins
  */
@@ -768,16 +830,7 @@
 		lapic_set_lvt_mode(APIC_ID_ALL, LVT_LINT1, APIC_LVT_DM_NMI);
 
 		/* Configure I/O APIC pins. */
-		if (mpfps->config_type != 7)
-			ioapic_set_extint(ioapics[0], 0);
-		else
-			ioapic_disable_pin(ioapics[0], 0);
-		if (mpfps->config_type != 2)
-			ioapic_remap_vector(ioapics[0], 2, 0);
-		else
-			ioapic_disable_pin(ioapics[0], 2);
-		if (mpfps->config_type == 2)
-			ioapic_disable_pin(ioapics[0], 13);
+		mptable_parse_default_config_ints();
 	} else
 		mptable_walk_table(mptable_parse_ints_handler, NULL);
 }
@@ -887,7 +940,7 @@
 
 	if (bus < 0)
 		return (EINVAL);
-	if (pci0 == -1 || pci0 + bus > mptable_maxbusid)
+	if (mpct == NULL || pci0 == -1 || pci0 + bus > mptable_maxbusid)
 		return (ENXIO);
 	if (busses[pci0 + bus].bus_type != PCI)
 		return (ENXIO);

==== //depot/projects/hammer/sys/amd64/amd64/sys_machdep.c#16 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/amd64/vm_machdep.c#62 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/conf/GENERIC#63 (text+ko) ====

@@ -71,11 +71,11 @@
 options 	WITNESS_SKIPSPIN	# Don't run witness on spinlocks for speed
 
 # Make an SMP-capable kernel by default
-options 	SMP		# Symmetric MultiProcessor Kernel
+options 	SMP			# Symmetric MultiProcessor Kernel
 
 # Workarounds for some known-to-be-broken chipsets (nVidia nForce3-Pro150)
-device		atpic		# 8259A compatability
-options 	NO_MIXED_MODE	# Don't penalize working chipsets
+device		atpic			# 8259A compatability
+options 	NO_MIXED_MODE		# Don't penalize working chipsets
 
 # Bus support.  Do not remove isa, even if you have no isa slots
 device		acpi
@@ -254,7 +254,7 @@
 device		ums		# Mouse
 device		urio		# Diamond Rio 500 MP3 player
 device		uscanner	# Scanners
-# USB Ethernet, requires mii
+# USB Ethernet, requires miibus
 device		aue		# ADMtek USB Ethernet
 device		axe		# ASIX Electronics USB Ethernet
 device		cue		# CATC USB Ethernet

==== //depot/projects/hammer/sys/amd64/include/_limits.h#10 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/apicreg.h#12 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/bus_amd64.h#11 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/bus_dma.h#14 (text+ko) ====

@@ -37,7 +37,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
+/*-
  * Copyright (c) 1996 Charles M. Hannum.  All rights reserved.
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
  *

==== //depot/projects/hammer/sys/amd64/include/bus_memio.h#7 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/bus_pio.h#7 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/clock.h#14 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/cputypes.h#11 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/db_machdep.h#13 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/float.h#14 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/limits.h#9 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/metadata.h#6 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/mptable.h#9 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/pci_cfgreg.h#12 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/pmap.h#52 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/proc.h#14 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/profile.h#24 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/ptrace.h#8 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/resource.h#6 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/runq.h#10 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/signal.h#12 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/include/smp.h#20 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/isa/isa.c#14 (text+ko) ====

@@ -27,7 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/sys/amd64/isa/isa.c,v 1.147 2004/12/24 23:03:17 imp Exp $");
 
-/*
+/*-
  * Modifications for Intel architecture by Garrett A. Wollman.
  * Copyright 1998 Massachusetts Institute of Technology
  *

==== //depot/projects/hammer/sys/amd64/pci/pci_bus.c#28 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/pci/pci_cfgreg.c#19 (text+ko) ====



More information about the p4-projects mailing list