Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jan 2005 02:09:47 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 69412 for review
Message-ID:  <200501210209.j0L29lbI010920@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=69412

Change 69412 by peter@peter_daintree on 2005/01/21 02:09:28

	integ -b i386_hammer

Affected files ...

.. //depot/projects/hammer/sys/amd64/amd64/db_trace.c#27 integrate
.. //depot/projects/hammer/sys/amd64/amd64/io_apic.c#32 integrate
.. //depot/projects/hammer/sys/amd64/amd64/machdep.c#111 integrate
.. //depot/projects/hammer/sys/amd64/amd64/mptable.c#35 integrate
.. //depot/projects/hammer/sys/amd64/conf/NOTES#52 integrate
.. //depot/projects/hammer/sys/amd64/include/intr_machdep.h#16 integrate
.. //depot/projects/hammer/sys/amd64/isa/atpic.c#46 integrate
.. //depot/projects/hammer/sys/amd64/isa/elcr.c#3 integrate

Differences ...

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

@@ -302,10 +302,16 @@
 	rbp = db_get_value((long) &(*fp)->f_frame, 8, FALSE);
 
 	/*
-	 * Figure out frame type.
+	 * Figure out frame type.  We look at the address just before
+	 * the saved instruction pointer as the saved EIP is after the
+	 * call function, and if the function being called is marked as
+	 * dead (such as panic() at the end of dblfault_handler()), then
+	 * the instruction at the saved EIP will be part of a different
+	 * function (syscall() in this example) rather than the one that
+	 * actually made the call.
 	 */
 	frame_type = NORMAL;
-	sym = db_search_symbol(rip, DB_STGY_ANY, &offset);
+	sym = db_search_symbol(rip - 1, DB_STGY_ANY, &offset);
 	db_symbol_values(sym, &name, NULL);
 	if (name != NULL) {
 		if (strcmp(name, "calltrap") == 0 ||

==== //depot/projects/hammer/sys/amd64/amd64/io_apic.c#32 (text+ko) ====

@@ -424,7 +424,7 @@
 	 * them to be set to active low.
 	 *
 	 * XXX: Should we write to the ELCR if the trigger mode changes for
-	 * an EISA IRQ?
+	 * an EISA IRQ or an ISA IRQ with the ELCR present?
 	 */
 	if (intpin->io_bus == APIC_BUS_EISA)
 		pol = INTR_POLARITY_HIGH;

==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#111 (text+ko) ====

@@ -1213,6 +1213,7 @@
 	cninit();
 
 #ifdef DEV_ATPIC
+	elcr_probe();
 	atpic_startup();
 #endif
 

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

@@ -575,11 +575,17 @@
 	KASSERT(src_bus <= mptable_maxbusid, ("bus id %d too large", src_bus));
 	switch (busses[src_bus].bus_type) {
 	case ISA:
-		return (INTR_TRIGGER_EDGE);
+#ifndef PC98
+		if (elcr_found)
+			return (elcr_read_trigger(src_bus_irq));
+		else
+#endif
+			return (INTR_TRIGGER_EDGE);
 	case PCI:
 		return (INTR_TRIGGER_LEVEL);
 	case EISA:
 		KASSERT(src_bus_irq < 16, ("Invalid EISA IRQ %d", src_bus_irq));
+		KASSERT(elcr_found, ("Missing ELCR"));
 		return (elcr_read_trigger(src_bus_irq));
 	default:
 		panic("%s: unknown bus type %d", __func__,

==== //depot/projects/hammer/sys/amd64/conf/NOTES#52 (text+ko) ====

@@ -4,7 +4,7 @@
 # This file contains machine dependent kernel configuration notes.  For
 # machine independent notes, look in /sys/conf/NOTES.
 #
-# (XXX from i386:NOTES,v 1.1177)
+# (XXX from i386:NOTES,v 1.1178)
 # $FreeBSD: src/sys/amd64/conf/NOTES,v 1.20 2004/09/22 01:04:54 peter Exp $
 #
 

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

@@ -84,6 +84,7 @@
 struct intrframe;
 
 extern struct mtx icu_lock;
+extern int elcr_found;
 
 /* XXX: The elcr_* prototypes probably belong somewhere else. */
 int	elcr_probe(void);

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

@@ -95,7 +95,6 @@
 static void	atpic_init(void *dummy);
 
 unsigned int imen;	/* XXX */
-static int using_elcr;
 
 inthand_t
 	IDTVEC(atpic_intr0), IDTVEC(atpic_intr1), IDTVEC(atpic_intr2),
@@ -293,7 +292,7 @@
 
 	if (ai->at_irq == 0) {
 		i8259_init(ap, ap == &atpics[SLAVE]);
-		if (ap == &atpics[SLAVE] && using_elcr)
+		if (ap == &atpics[SLAVE] && elcr_found)
 			elcr_resume();
 	}
 }
@@ -337,7 +336,7 @@
 			    vector);
 		return (EINVAL);
 	}
-	if (!using_elcr) {
+	if (!elcr_found) {
 		if (bootverbose)
 			printf("atpic: No ELCR to configure IRQ%u as %s\n",
 			    vector, trig == INTR_TRIGGER_EDGE ? "edge/high" :
@@ -428,8 +427,7 @@
 	 * assume level trigger for any interrupt that we aren't sure is
 	 * edge triggered.
 	 */
-	if (elcr_probe() == 0) {
-		using_elcr = 1;
+	if (elcr_found) {
 		for (i = 0, ai = atintrs; i < NUM_ISA_IRQS; i++, ai++)
 			ai->at_trigger = elcr_read_trigger(i);
 	} else {

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

@@ -57,9 +57,7 @@
 #define	ELCR_MASK(irq)	(1 << (irq))
 
 static int elcr_status;
-#ifdef INVARIANTS
-static int elcr_found;
-#endif
+int elcr_found;
 
 /*
  * Check to see if we have what looks like a valid ELCR.  We do this by
@@ -88,9 +86,7 @@
 	}
 	if (resource_disabled("elcr", 0))
 		return (ENXIO);
-#ifdef INVARIANTS
 	elcr_found = 1;
-#endif
 	return (0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501210209.j0L29lbI010920>