PERFORCE change 32860 for review

John Baldwin jhb at FreeBSD.org
Mon Jun 9 11:37:03 PDT 2003


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

Change 32860 by jhb at jhb_laptop on 2003/06/09 11:36:12

	IFC @32857.

Affected files ...

.. //depot/projects/smpng/sys/alpha/conf/GENERIC#30 integrate
.. //depot/projects/smpng/sys/boot/ficl/Makefile#4 integrate
.. //depot/projects/smpng/sys/boot/ficl/loader.c#6 integrate
.. //depot/projects/smpng/sys/boot/i386/kgzldr/Makefile#8 integrate
.. //depot/projects/smpng/sys/boot/i386/libi386/Makefile#9 integrate
.. //depot/projects/smpng/sys/boot/pc98/kgzldr/Makefile#6 integrate
.. //depot/projects/smpng/sys/boot/pc98/libpc98/Makefile#8 integrate
.. //depot/projects/smpng/sys/boot/pc98/libpc98/i386_module.c#1 branch
.. //depot/projects/smpng/sys/boot/pc98/loader/Makefile#9 integrate
.. //depot/projects/smpng/sys/boot/pc98/loader/help.pc98#1 branch
.. //depot/projects/smpng/sys/conf/NOTES#45 integrate
.. //depot/projects/smpng/sys/conf/ldscript.sparc64#3 integrate
.. //depot/projects/smpng/sys/conf/newvers.sh#6 integrate
.. //depot/projects/smpng/sys/ddb/db_ps.c#19 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/aic7770.c#8 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.c#13 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.h#11 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx_pci.c#11 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/aic7xxx.c#15 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/aic7xxx.h#9 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/aic7xxx_pci.c#11 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-chipset.c#14 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-pci.c#32 integrate
.. //depot/projects/smpng/sys/dev/exca/exca.c#8 integrate
.. //depot/projects/smpng/sys/dev/exca/excavar.h#5 integrate
.. //depot/projects/smpng/sys/dev/ofw/openfirm.c#5 integrate
.. //depot/projects/smpng/sys/dev/ofw/openfirm.h#5 integrate
.. //depot/projects/smpng/sys/dev/pccbb/pccbb.c#30 integrate
.. //depot/projects/smpng/sys/dev/pccbb/pccbbvar.h#10 integrate
.. //depot/projects/smpng/sys/dev/pci/pci.c#26 integrate
.. //depot/projects/smpng/sys/dev/vx/if_vx.c#10 integrate
.. //depot/projects/smpng/sys/geom/geom.h#30 integrate
.. //depot/projects/smpng/sys/geom/geom_ccd.c#2 integrate
.. //depot/projects/smpng/sys/geom/geom_ctl.c#14 integrate
.. //depot/projects/smpng/sys/geom/geom_dev.c#26 integrate
.. //depot/projects/smpng/sys/geom/geom_dump.c#19 integrate
.. //depot/projects/smpng/sys/geom/geom_event.c#18 integrate
.. //depot/projects/smpng/sys/geom/geom_slice.c#23 integrate
.. //depot/projects/smpng/sys/geom/geom_subr.c#29 integrate
.. //depot/projects/smpng/sys/gnu/dev/sound/pci/emu10k1-alsa.h#1 branch
.. //depot/projects/smpng/sys/i386/conf/GENERIC#39 integrate
.. //depot/projects/smpng/sys/i386/include/acpica_machdep.h#4 integrate
.. //depot/projects/smpng/sys/i386/include/apic.h#8 integrate
.. //depot/projects/smpng/sys/i386/include/legacyvar.h#2 integrate
.. //depot/projects/smpng/sys/i386/isa/apic_vector.s#16 integrate
.. //depot/projects/smpng/sys/i386/pci/pci_bus.c#15 integrate
.. //depot/projects/smpng/sys/ia64/conf/GENERIC#33 integrate
.. //depot/projects/smpng/sys/ia64/ia64/pmap.c#46 integrate
.. //depot/projects/smpng/sys/ia64/ia64/trap.c#50 integrate
.. //depot/projects/smpng/sys/ia64/include/cpu.h#14 integrate
.. //depot/projects/smpng/sys/kern/kern_exec.c#58 integrate
.. //depot/projects/smpng/sys/kern/kern_ktr.c#19 integrate
.. //depot/projects/smpng/sys/kern/kern_ktrace.c#31 integrate
.. //depot/projects/smpng/sys/kern/kern_mib.c#20 integrate
.. //depot/projects/smpng/sys/kern/kern_sig.c#69 integrate
.. //depot/projects/smpng/sys/kern/sched_ule.c#11 integrate
.. //depot/projects/smpng/sys/kern/vfs_mount.c#14 integrate
.. //depot/projects/smpng/sys/netinet/ip_input.c#35 integrate
.. //depot/projects/smpng/sys/nfsclient/bootp_subr.c#17 integrate
.. //depot/projects/smpng/sys/pc98/conf/GENERIC#33 integrate
.. //depot/projects/smpng/sys/pc98/pc98/wd.c#12 integrate
.. //depot/projects/smpng/sys/pc98/pc98/wd_cd.c#13 integrate
.. //depot/projects/smpng/sys/pci/if_dc.c#39 integrate
.. //depot/projects/smpng/sys/pci/if_dcreg.h#14 integrate
.. //depot/projects/smpng/sys/powerpc/conf/GENERIC#17 integrate
.. //depot/projects/smpng/sys/sparc64/conf/GENERIC#30 integrate
.. //depot/projects/smpng/sys/sparc64/include/db_machdep.h#6 integrate
.. //depot/projects/smpng/sys/sparc64/include/ofw_mem.h#3 integrate
.. //depot/projects/smpng/sys/sparc64/sparc64/dump_machdep.c#5 integrate
.. //depot/projects/smpng/sys/sparc64/sparc64/machdep.c#51 integrate
.. //depot/projects/smpng/sys/sparc64/sparc64/vm_machdep.c#32 integrate
.. //depot/projects/smpng/sys/sys/disklabel.h#26 integrate
.. //depot/projects/smpng/sys/sys/ktrace.h#8 integrate
.. //depot/projects/smpng/sys/sys/proc.h#91 integrate
.. //depot/projects/smpng/sys/sys/sysctl.h#18 integrate
.. //depot/projects/smpng/sys/vm/swap_pager.c#27 integrate
.. //depot/projects/smpng/sys/vm/vm_kern.c#13 integrate
.. //depot/projects/smpng/sys/vm/vm_map.c#36 integrate
.. //depot/projects/smpng/sys/vm/vm_mmap.c#28 integrate
.. //depot/projects/smpng/sys/vm/vm_object.c#39 integrate
.. //depot/projects/smpng/sys/vm/vm_page.c#37 integrate

Differences ...

==== //depot/projects/smpng/sys/alpha/conf/GENERIC#30 (text+ko) ====

@@ -18,7 +18,7 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.160 2003/05/18 20:39:15 ru Exp $
+# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.161 2003/06/08 02:03:01 jmallett Exp $
 
 machine		alpha
 cpu		EV4
@@ -101,7 +101,7 @@
 device		sym		# NCR/Symbios Logic (newer chipsets + those of `ncr')
 
 # SCSI peripherals
-device		scbus		# SCSI bus (required)
+device		scbus		# SCSI bus (required for SCSI)
 device		ch		# SCSI media changers
 device		da		# Direct Access (disks)
 device		sa		# Sequential Access (tape etc)

==== //depot/projects/smpng/sys/boot/ficl/Makefile#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/ficl/Makefile,v 1.32 2002/05/13 11:09:06 ru Exp $
+# $FreeBSD: src/sys/boot/ficl/Makefile,v 1.33 2003/06/08 03:11:16 nyan Exp $
 #
 .PATH: ${.CURDIR}/${MACHINE_ARCH}
 BASE_SRCS=	dict.c ficl.c fileaccess.c float.c loader.c math64.c \
@@ -13,6 +13,9 @@
 .if ${MACHINE_ARCH} == "i386"
 CFLAGS+=	-mpreferred-stack-boundary=2
 .endif
+.if ${MACHINE} == "pc98"
+CFLAGS+=	-DPC98
+.endif
 .if HAVE_PNP
 CFLAGS+=	-DHAVE_PNP
 .endif

==== //depot/projects/smpng/sys/boot/ficl/loader.c#6 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/boot/ficl/loader.c,v 1.8 2002/08/21 09:28:00 scottl Exp $
+ *	$FreeBSD: src/sys/boot/ficl/loader.c,v 1.9 2003/06/08 03:11:16 nyan Exp $
  */
 
 /*******************************************************************
@@ -656,7 +656,9 @@
     dictAppendWord(dp, "ccall",	    ficlCcall,	    FW_DEFAULT);
 #endif
 
-#if defined(__i386__)
+#if defined(PC98)
+    ficlSetEnv(pSys, "arch-pc98",         FICL_TRUE);
+#elif defined(__i386__)
     ficlSetEnv(pSys, "arch-i386",         FICL_TRUE);
     ficlSetEnv(pSys, "arch-alpha",        FICL_FALSE);
     ficlSetEnv(pSys, "arch-ia64",         FICL_FALSE);

==== //depot/projects/smpng/sys/boot/i386/kgzldr/Makefile#8 (text+ko) ====

@@ -1,6 +1,6 @@
-# $FreeBSD: src/sys/boot/i386/kgzldr/Makefile,v 1.13 2003/06/06 13:49:51 kuriyama Exp $
+# $FreeBSD: src/sys/boot/i386/kgzldr/Makefile,v 1.15 2003/06/07 17:42:26 obrien Exp $
 
-SRCS=	start.s boot.c inflate.c lib.c crt.s sio.s
+SRCS=	boot.c inflate.c lib.c
 OBJS=	${SRCS:N*.h:R:S/$/.o/g}
 CFLAGS=	-ffreestanding
 CFLAGS+=-Os
@@ -8,6 +8,12 @@
 LDFLAGS=-nostdlib -static -r
 .PATH:	${.CURDIR}/../../../kern
 
+.for asm in start crt sio
+OBJS+=	${asm}.o
+${asm}.o: ${asm}.s
+	${AS} ${AFLAGS} -o ${.TARGET} ${.ALLSRC:M*${asm}*}
+.endfor
+
 CLEANFILES=kgzldr.o
 
 BOOT_COMCONSOLE_PORT?=	0x3f8

==== //depot/projects/smpng/sys/boot/i386/libi386/Makefile#9 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.30 2003/06/02 02:37:27 obrien Exp $
+# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.31 2003/06/07 17:42:26 obrien Exp $
 #
 LIB=			i386
 INTERNALLIB=		true
@@ -47,6 +47,6 @@
 
 OBJS+=	pxetramp.o
 pxetramp.o: pxetramp.s
-	as -o ${.TARGET} ${.ALLSRC:M*pxetramp*}
+	${AS} ${AFLAGS} -o ${.TARGET} ${.ALLSRC:M*pxetramp*}
 
 .include <bsd.lib.mk>

==== //depot/projects/smpng/sys/boot/pc98/kgzldr/Makefile#6 (text+ko) ====

@@ -1,24 +1,34 @@
-# $FreeBSD: src/sys/boot/pc98/kgzldr/Makefile,v 1.7 2002/09/30 20:37:58 peter Exp $
+# $FreeBSD: src/sys/boot/pc98/kgzldr/Makefile,v 1.9 2003/06/07 17:42:26 obrien Exp $
 
-FILES=	kgzldr.o
-SRCS=	start.s boot.c inflate.c lib.c crt.s sio.s
+SRCS=	boot.c inflate.c lib.c
 OBJS=	${SRCS:N*.h:R:S/$/.o/g}
 CFLAGS=	-ffreestanding
 CFLAGS+=-Os
 CFLAGS+=-DKZIP
 LDFLAGS=-nostdlib -static -r
-BINDIR=	/usr/lib
 .PATH:	${.CURDIR}/../../../kern
 
 .PATH:	${.CURDIR}/../../i386/kgzldr
 AFLAGS+=--defsym PC98=1
 
-CLEANFILES=${FILES}
+.for asm in start crt sio
+OBJS+=	${asm}.o
+${asm}.o: ${asm}.s
+	${AS} ${AFLAGS} -o ${.TARGET} ${.ALLSRC:M*${asm}*}
+.endfor
+
+CLEANFILES=kgzldr.o
 
 BOOT_COMCONSOLE_PORT?=	0x238
 AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT}
 
+all: ${OBJS} kgzldr.o
+
 kgzldr.o: ${OBJS}
 	${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS}
 
-.include <bsd.prog.mk>
+realinstall:
+	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+	    kgzldr.o ${DESTDIR}${LIBDIR}
+
+.include <bsd.lib.mk>

==== //depot/projects/smpng/sys/boot/pc98/libpc98/Makefile#8 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.14 2003/05/01 13:17:06 nyan Exp $
+# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.17 2003/06/08 03:16:59 nyan Exp $
 #
 LIB=			pc98
 INTERNALLIB=		true
@@ -7,7 +7,7 @@
 
 SRCS=	bioscd.c biosdisk.c biosmem.c biospnp.c biospci.c biossmap.c \
 	bootinfo.c bootinfo32.c comconsole.c devicename.c elf32_freebsd.c \
-	gatea20.c i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \
+	gatea20.c i386_copy.c i386_module.c nullconsole.c pxe.c \
 	time.c vidconsole.c
 
 CFLAGS+=	-ffreestanding
@@ -28,7 +28,6 @@
 CFLAGS+=	-DPC98
 CFLAGS+=	-I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \
 		-I${.CURDIR}/../../i386/libi386 \
-		-I${.CURDIR}/../../../contrib/dev/acpica \
 		-I${.CURDIR}/../../.. -I.
 # the location of libstand
 CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
@@ -41,11 +40,14 @@
 .if exists(${.CURDIR}/../../../i386/include)
 beforedepend ${OBJS}: machine
 
+CLEANFILES+=	machine
 machine:
 	ln -sf ${.CURDIR}/../../../i386/include machine
 
 .endif
 
-CLEANFILES+=	machine
+OBJS+=	pxetramp.o
+pxetramp.o: pxetramp.s
+	${AS} ${AFLAGS} -o ${.TARGET} ${.ALLSRC:M*pxetramp*}
 
 .include <bsd.lib.mk>

==== //depot/projects/smpng/sys/boot/pc98/loader/Makefile#9 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/pc98/loader/Makefile,v 1.28 2003/01/21 13:57:43 nyan Exp $
+# $FreeBSD: src/sys/boot/pc98/loader/Makefile,v 1.30 2003/06/08 03:34:49 nyan Exp $
 
 PROG=		loader
 STRIP=
@@ -100,15 +100,16 @@
 	cp ${.ALLSRC} ${.TARGET}
 	strip -R .comment -R .note ${.TARGET}
 
-${PROG}.help: help.common help.i386
+${PROG}.help: help.common help.pc98
 	cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
 
 .PATH: ${.CURDIR}/../../forth 
 FILES=	${PROG}.help loader.4th support.4th loader.conf
+FILES+= screen.4th frames.4th beastie.4th
 FILESDIR_loader.conf=	/boot/defaults
 
 .if !exists(${DESTDIR}/boot/loader.rc)
-FILES+=	loader.rc
+FILES+=	${.CURDIR}/../../i386/loader/loader.rc
 .endif
 
 .include <${.CURDIR}/../Makefile.inc>

==== //depot/projects/smpng/sys/conf/NOTES#45 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1149 2003/05/15 02:10:29 jmallett Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1150 2003/06/09 17:09:51 hmp Exp $
 #
 # NOTES -- Lines that can be cut/pasted into kernel and hints configs.
 #
@@ -102,6 +102,7 @@
 options 	BLKDEV_IOSIZE=8192
 
 # Options for the VM subsystem
+# L2 cache size (in KB) can be specified in PQ_CACHESIZE
 options 	PQ_CACHESIZE=512	# color for 512k/16k cache
 # Deprecated options supported for backwards compatibility
 #options 	PQ_NOOPT		# No coloring

==== //depot/projects/smpng/sys/conf/ldscript.sparc64#3 (text+ko) ====

@@ -1,9 +1,9 @@
-/* $FreeBSD: src/sys/conf/ldscript.sparc64,v 1.3 2001/09/21 05:43:37 jake Exp $ */
+/* $FreeBSD: src/sys/conf/ldscript.sparc64,v 1.4 2003/06/07 18:23:50 jake Exp $ */
 OUTPUT_FORMAT("elf64-sparc", "elf64-sparc",
 	      "elf64-sparc")
 OUTPUT_ARCH(sparc:v9)
 ENTRY(_start)
- SEARCH_DIR(/home/jake/sparc64-unknown-elf/lib);
+SEARCH_DIR(/usr/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS

==== //depot/projects/smpng/sys/conf/newvers.sh#6 (text+ko) ====

@@ -32,7 +32,7 @@
 # SUCH DAMAGE.
 #
 #	@(#)newvers.sh	8.1 (Berkeley) 4/20/94
-# $FreeBSD: src/sys/conf/newvers.sh,v 1.51 2003/06/02 04:58:43 scottl Exp $
+# $FreeBSD: src/sys/conf/newvers.sh,v 1.53 2003/06/09 18:19:32 jmallett Exp $
 
 TYPE="FreeBSD"
 REVISION="5.1"
@@ -86,6 +86,7 @@
 
 touch version
 v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date`
+i=`make -V KERN_IDENT`
 cat << EOF > vers.c
 $COPYRIGHT
 char sccspad[32 - 4 /* sizeof(sccs) */] = { '\\0' };
@@ -94,6 +95,7 @@
 char ostype[] = "${TYPE}";
 char osrelease[] = "${RELEASE}";
 int osreldate = ${RELDATE};
+char kern_ident[] = "${i}";
 EOF
 
 echo `expr ${v} + 1` > version

==== //depot/projects/smpng/sys/ddb/db_ps.c#19 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/ddb/db_ps.c,v 1.41 2003/04/10 17:35:43 julian Exp $
+ * $FreeBSD: src/sys/ddb/db_ps.c,v 1.44 2003/06/06 20:28:11 julian Exp $
  */
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -43,8 +43,8 @@
 #include <vm/pmap.h>
 
 #include <ddb/ddb.h>
-static void
-dumpthread(volatile struct proc *p, volatile struct thread *td);
+
+static void	dumpthread(volatile struct proc *p, volatile struct thread *td);
 
 void
 db_ps(dummy1, dummy2, dummy3, dummy4)
@@ -72,7 +72,7 @@
 		/*
 		 * XXX just take 20 for now...
 		 */
-		if (nl++ == 20) {
+		if (nl++ >= 20) {
 			int c;
 
 			db_printf("--More--");
@@ -108,7 +108,7 @@
 			if (P_SHOULDSTOP(p))
 				state = "stop";
 			else
-				state = "norm";
+				state = "";
 			break;
 		case PRS_NEW:
 			state = "new ";
@@ -120,7 +120,7 @@
 			state = "Unkn";
 			break;
 		}
-		db_printf("%5d %8p %8p %4d %5d %5d %07x %-4s",
+		db_printf("%5d %8p %8p %4d %5d %5d %07x %s",
 		    p->p_pid, (volatile void *)p, (void *)p->p_uarea, 
 		    p->p_ucred != NULL ? p->p_ucred->cr_ruid : 0, pp->p_pid,
 		    p->p_pgrp != NULL ? p->p_pgrp->pg_id : 0, p->p_flag,
@@ -129,6 +129,7 @@
 			db_printf("(threaded)  %s\n", p->p_comm);
 		FOREACH_THREAD_IN_PROC(p, td) {
 			dumpthread(p, td);
+			nl++;
 		}
 		/* PROC_UNLOCK(p); */
 
@@ -138,6 +139,7 @@
     	}
 	/* sx_sunlock(&allproc_lock); */
 }
+
 static void
 dumpthread(volatile struct proc *p, volatile struct thread *td)
 {
@@ -145,10 +147,16 @@
 		db_printf( "   thread %p ksegrp %p ", td, td->td_ksegrp);
 	if (TD_ON_SLEEPQ(td)) {
 		if (td->td_flags & TDF_CVWAITQ)
-			db_printf("[CVQ ");
+			if (TD_IS_SLEEPING(td))
+				db_printf("[CV]");
+			else
+				db_printf("[CVQ");
 		else
-			db_printf("[SLPQ ");
-		db_printf(" %6s %8p]", td->td_wmesg,
+			if (TD_IS_SLEEPING(td))
+				db_printf("[SLP]");
+			else
+				db_printf("[SLPQ");
+		db_printf("%s %p]", td->td_wmesg,
 		    (void *)td->td_wchan);
 	}
 	switch (td->td_state) {
@@ -158,9 +166,11 @@
 			    td->td_lockname,
 			    (void *)td->td_blocked);
 		}
+#if 0 /* covered above */
 		if (TD_IS_SLEEPING(td)) {
 			db_printf("[SLP]");
 		}  
+#endif
 		if (TD_IS_SWAPPED(td)) {
 			db_printf("[SWAP]");
 		}
@@ -180,8 +190,11 @@
 	case TDS_RUNNING:
 		db_printf("[CPU %d]", td->td_oncpu);
 		break;
+	case TDS_INACTIVE:
+		db_printf("[INACTIVE]");
+		break;
 	default:
-		panic("unknown thread state");
+		db_printf("[UNK: %#x]", td->td_state);
 	}
 	if (p->p_flag & P_THREADED) {
 		if (td->td_kse)

==== //depot/projects/smpng/sys/dev/aic7xxx/aic7770.c#8 (text+ko) ====

@@ -37,9 +37,9 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic7770.c#30 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7770.c#32 $
  *
- * $FreeBSD: src/sys/dev/aic7xxx/aic7770.c,v 1.12 2003/05/03 23:55:38 gibbs Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/aic7770.c,v 1.14 2003/06/06 23:48:18 gibbs Exp $
  */
 
 #ifdef __linux__
@@ -67,8 +67,7 @@
 static ahc_device_setup_t ahc_aic7770_EISA_setup;;
 static ahc_device_setup_t ahc_aic7770_setup;
 
-
-struct aic7770_identity aic7770_ident_table [] =
+struct aic7770_identity aic7770_ident_table[] =
 {
 	{
 		ID_AHA_274x,
@@ -83,6 +82,12 @@
 		ahc_aic7770_VL_setup
 	},
 	{
+		ID_AHA_284x,
+		0xFFFFFFFE,
+		"Adaptec 284X SCSI adapter (BIOS Disabled)",
+		ahc_aic7770_VL_setup
+	},
+	{
 		ID_OLV_274x,
 		0xFFFFFFFF,
 		"Adaptec (Olivetti OEM) 274X SCSI adapter",
@@ -154,7 +159,7 @@
 	ahc->bus_suspend = aic7770_suspend;
 	ahc->bus_resume = aic7770_resume;
 
-	error = ahc_reset(ahc);
+	error = ahc_reset(ahc, /*reinit*/FALSE);
 	if (error != 0)
 		return (error);
 

==== //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.c#13 (text+ko) ====

@@ -37,9 +37,9 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: aic79xx.c,v 1.16 2003/05/26 21:43:29 gibbs Exp $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#198 $
  *
- * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.17 2003/05/30 02:15:15 scottl Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.20 2003/06/06 23:53:39 gibbs Exp $
  */
 
 #ifdef __linux__
@@ -1880,21 +1880,32 @@
 			tinfo->goal.ppr_options = 0;
 			ahd_qinfifo_requeue_tail(ahd, scb);
 			printerror = 0;
-		} else if ((ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_WDTR, FALSE)
-			 || ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_SDTR, FALSE))
+		} else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_WDTR, FALSE)
 			&& ppr_busfree == 0) {
 			/*
-			 * Negotiation Rejected.  Go-async and
+			 * Negotiation Rejected.  Go-narrow and
 			 * retry command.
 			 */
 #ifdef AHD_DEBUG
 			if ((ahd_debug & AHD_SHOW_MESSAGES) != 0)
-				printf("Negotiation rejected busfree.\n");
+				printf("WDTR negotiation rejected busfree.\n");
 #endif
 			ahd_set_width(ahd, &devinfo,
 				      MSG_EXT_WDTR_BUS_8_BIT,
 				      AHD_TRANS_CUR|AHD_TRANS_GOAL,
 				      /*paused*/TRUE);
+			ahd_qinfifo_requeue_tail(ahd, scb);
+			printerror = 0;
+		} else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_SDTR, FALSE)
+			&& ppr_busfree == 0) {
+			/*
+			 * Negotiation Rejected.  Go-async and
+			 * retry command.
+			 */
+#ifdef AHD_DEBUG
+			if ((ahd_debug & AHD_SHOW_MESSAGES) != 0)
+				printf("SDTR negotiation rejected busfree.\n");
+#endif
 			ahd_set_syncrate(ahd, &devinfo,
 					/*period*/0, /*offset*/0,
 					/*ppr_options*/0,
@@ -2188,7 +2199,7 @@
 			ahd_outb(ahd, LQOMODE1, 0);
 			ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
   			simode1 = ahd_inb(ahd, SIMODE1);
-  			ahd_outb(ahd, SIMODE1, ENBUSFREE);
+  			ahd_outb(ahd, SIMODE1, simode1 & ENBUSFREE);
 			ahd_outb(ahd, SEQCTL0, ahd_inb(ahd, SEQCTL0) | STEP);
 			stepping = TRUE;
 		}
@@ -3232,6 +3243,7 @@
 	 * may change.
 	 */
 	period = tinfo->goal.period;
+	offset = tinfo->goal.offset;
 	ppr_options = tinfo->goal.ppr_options;
 	/* Target initiated PPR is not allowed in the SCSI spec */
 	if (devinfo->role == ROLE_TARGET)
@@ -3239,7 +3251,7 @@
 	ahd_devlimited_syncrate(ahd, tinfo, &period,
 				&ppr_options, devinfo->role);
 	dowide = tinfo->curr.width != tinfo->goal.width;
-	dosync = tinfo->curr.period != period;
+	dosync = tinfo->curr.offset != offset || tinfo->curr.period != period;
 	/*
 	 * Only use PPR if we have options that need it, even if the device
 	 * claims to support it.  There might be an expander in the way
@@ -3249,7 +3261,7 @@
 
 	if (!dowide && !dosync && !doppr) {
 		dowide = tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT;
-		dosync = tinfo->goal.period != 0;
+		dosync = tinfo->goal.offset != 0;
 	}
 
 	if (!dowide && !dosync && !doppr) {
@@ -3983,22 +3995,30 @@
 				response = TRUE;
 				sending_reply = TRUE;
 			}
+			/*
+			 * After a wide message, we are async, but
+			 * some devices don't seem to honor this portion
+			 * of the spec.  Force a renegotiation of the
+			 * sync component of our transfer agreement even
+			 * if our goal is async.  By updating our width
+			 * after forcing the negotiation, we avoid
+			 * renegotiating for width.
+			 */
+			ahd_update_neg_request(ahd, devinfo, tstate,
+					       tinfo, AHD_NEG_ALWAYS);
 			ahd_set_width(ahd, devinfo, bus_width,
 				      AHD_TRANS_ACTIVE|AHD_TRANS_GOAL,
 				      /*paused*/TRUE);
-			/* After a wide message, we are async */
-			ahd_set_syncrate(ahd, devinfo, /*period*/0,
-					 /*offset*/0, /*ppr_options*/0,
-					 AHD_TRANS_ACTIVE, /*paused*/TRUE);
 			if (sending_reply == FALSE && reject == FALSE) {
 
-				if (tinfo->goal.offset) {
-					ahd->msgout_index = 0;
-					ahd->msgout_len = 0;
-					ahd_build_transfer_msg(ahd, devinfo);
-					ahd->msgout_index = 0;
-					response = TRUE;
-				}
+				/*
+				 * We will always have an SDTR to send.
+				 */
+				ahd->msgout_index = 0;
+				ahd->msgout_len = 0;
+				ahd_build_transfer_msg(ahd, devinfo);
+				ahd->msgout_index = 0;
+				response = TRUE;
 			}
 			done = MSGLOOP_MSGCOMPLETE;
 			break;
@@ -5000,15 +5020,20 @@
 	ahd_timer_stop(&ahd->stat_timer);
 
 	/* This will reset most registers to 0, but not all */
-	ahd_reset(ahd);
+	ahd_reset(ahd, /*reinit*/FALSE);
 }
 
 /*
  * Reset the controller and record some information about it
- * that is only available just after a reset.
+ * that is only available just after a reset.  If "reinit" is
+ * non-zero, this reset occured after initial configuration
+ * and the caller requests that the chip be fully reinitialized
+ * to a runable state.  Chip interrupts are *not* enabled after
+ * a reinitialization.  The caller must enable interrupts via
+ * ahd_intr_enable().
  */
 int
-ahd_reset(struct ahd_softc *ahd)
+ahd_reset(struct ahd_softc *ahd, int reinit)
 {
 	u_int	 sxfrctl1;
 	int	 wait;
@@ -5101,7 +5126,7 @@
 	 * If a recovery action has forced a chip reset,
 	 * re-initialize the chip to our liking.
 	 */
-	if (ahd->init_level > 0)
+	if (reinit != 0)
 		ahd_chip_init(ahd);
 
 	return (0);
@@ -6703,141 +6728,24 @@
 int
 ahd_suspend(struct ahd_softc *ahd)
 {
-#if 0
-	uint8_t *ptr;
-	int	 i;
 
 	ahd_pause_and_flushwork(ahd);
 
-	if (LIST_FIRST(&ahd->pending_scbs) != NULL)
+	if (LIST_FIRST(&ahd->pending_scbs) != NULL) {
+		ahd_unpause(ahd);
 		return (EBUSY);
-
-#if AHD_TARGET_MODE
-	/*
-	 * XXX What about ATIOs that have not yet been serviced?
-	 * Perhaps we should just refuse to be suspended if we
-	 * are acting in a target role.
-	 */
-	if (ahd->pending_device != NULL)
-		return (EBUSY);
-#endif
-
-	/* Save volatile registers */
-	ahd->suspend_state.channel[0].scsiseq = ahd_inb(ahd, SCSISEQ0);
-	ahd->suspend_state.channel[0].sxfrctl0 = ahd_inb(ahd, SXFRCTL0);
-	ahd->suspend_state.channel[0].sxfrctl1 = ahd_inb(ahd, SXFRCTL1);
-	ahd->suspend_state.channel[0].simode0 = ahd_inb(ahd, SIMODE0);
-	ahd->suspend_state.channel[0].simode1 = ahd_inb(ahd, SIMODE1);
-	ahd->suspend_state.channel[0].seltimer = ahd_inb(ahd, SELTIMER);
-	ahd->suspend_state.channel[0].seqctl = ahd_inb(ahd, SEQCTL0);
-	ahd->suspend_state.dscommand0 = ahd_inb(ahd, DSCOMMAND0);
-	ahd->suspend_state.dspcistatus = ahd_inb(ahd, DSPCISTATUS);
-
-	if ((ahd->features & AHD_DT) != 0) {
-		u_int sfunct;
-
-		sfunct = ahd_inb(ahd, SFUNCT) & ~ALT_MODE;
-		ahd_outb(ahd, SFUNCT, sfunct | ALT_MODE);
-		ahd->suspend_state.optionmode = ahd_inb(ahd, OPTIONMODE);
-		ahd_outb(ahd, SFUNCT, sfunct);
-		ahd->suspend_state.crccontrol1 = ahd_inb(ahd, CRCCONTROL1);
-	}
-
-	if ((ahd->features & AHD_MULTI_FUNC) != 0)
-		ahd->suspend_state.scbbaddr = ahd_inb(ahd, SCBBADDR);
-
-	if ((ahd->features & AHD_ULTRA2) != 0)
-		ahd->suspend_state.dff_thrsh = ahd_inb(ahd, DFF_THRSH);
-
-	ptr = ahd->suspend_state.scratch_ram;
-	for (i = 0; i < 64; i++)
-		*ptr++ = ahd_inb(ahd, SRAM_BASE + i);
-
-	if ((ahd->features & AHD_MORE_SRAM) != 0) {
-		for (i = 0; i < 16; i++)
-			*ptr++ = ahd_inb(ahd, TARG_OFFSET + i);
-	}
-
-	ptr = ahd->suspend_state.btt;
-	for (i = 0;i < AHD_NUM_TARGETS; i++) {
-		int j;
-
-		for (j = 0;j < AHD_NUM_LUNS_NONPKT; j++) {
-			u_int tcl;
-
-			tcl = BUILD_TCL_RAW(i, 'A', j);
-			*ptr = ahd_find_busy_tcl(ahd, tcl);
-		}
 	}
 	ahd_shutdown(ahd);
-#endif
 	return (0);
 }
 
 int
 ahd_resume(struct ahd_softc *ahd)
 {
-#if 0
-	uint8_t *ptr;
-	int	 i;
 
-	ahd_reset(ahd);
-
-	ahd_build_free_scb_list(ahd);
-
-	/* Restore volatile registers */
-	ahd_outb(ahd, SCSISEQ0, ahd->suspend_state.channel[0].scsiseq);
-	ahd_outb(ahd, SXFRCTL0, ahd->suspend_state.channel[0].sxfrctl0);
-	ahd_outb(ahd, SXFRCTL1, ahd->suspend_state.channel[0].sxfrctl1);
-	ahd_outb(ahd, SIMODE0, ahd->suspend_state.channel[0].simode0);
-	ahd_outb(ahd, SIMODE1, ahd->suspend_state.channel[0].simode1);
-	ahd_outb(ahd, SELTIMER, ahd->suspend_state.channel[0].seltimer);
-	ahd_outb(ahd, SEQCTL0, ahd->suspend_state.channel[0].seqctl);
-	if ((ahd->features & AHD_ULTRA2) != 0)
-		ahd_outb(ahd, SCSIID_ULTRA2, ahd->our_id);
-	else
-		ahd_outb(ahd, SCSIID, ahd->our_id);
-
-	ahd_outb(ahd, DSCOMMAND0, ahd->suspend_state.dscommand0);
-	ahd_outb(ahd, DSPCISTATUS, ahd->suspend_state.dspcistatus);
-
-	if ((ahd->features & AHD_DT) != 0) {
-		u_int sfunct;
-
-		sfunct = ahd_inb(ahd, SFUNCT) & ~ALT_MODE;
-		ahd_outb(ahd, SFUNCT, sfunct | ALT_MODE);
-		ahd_outb(ahd, OPTIONMODE, ahd->suspend_state.optionmode);
-		ahd_outb(ahd, SFUNCT, sfunct);
-		ahd_outb(ahd, CRCCONTROL1, ahd->suspend_state.crccontrol1);
-	}
-
-	if ((ahd->features & AHD_MULTI_FUNC) != 0)
-		ahd_outb(ahd, SCBBADDR, ahd->suspend_state.scbbaddr);
-
-	if ((ahd->features & AHD_ULTRA2) != 0)
-		ahd_outb(ahd, DFF_THRSH, ahd->suspend_state.dff_thrsh);
-
-	ptr = ahd->suspend_state.scratch_ram;
-	for (i = 0; i < 64; i++)
-		ahd_outb(ahd, SRAM_BASE + i, *ptr++);
-
-	if ((ahd->features & AHD_MORE_SRAM) != 0) {
-		for (i = 0; i < 16; i++)
-			ahd_outb(ahd, TARG_OFFSET + i, *ptr++);
-	}
-
-	ptr = ahd->suspend_state.btt;
-	for (i = 0;i < AHD_NUM_TARGETS; i++) {
-		int j;
-
-		for (j = 0;j < AHD_NUM_LUNS; j++) {
-			u_int tcl;
-
-			tcl = BUILD_TCL(i << 4, j);
-			ahd_busy_tcl(ahd, tcl, *ptr);
-		}
-	}
-#endif
+	ahd_reset(ahd, /*reinit*/TRUE);
+	ahd_intr_enable(ahd, TRUE); 
+	ahd_restart(ahd);
 	return (0);
 }
 
@@ -7490,7 +7398,7 @@
 		 * we must reset the chip.
 		 */
 		ahd_delay(AHD_BUSRESET_DELAY);
-		ahd_reset(ahd);
+		ahd_reset(ahd, /*reinit*/TRUE);
 		ahd_intr_enable(ahd, /*enable*/TRUE);
 		AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
 	}
@@ -9192,6 +9100,7 @@
 			ahd->flags &= ~AHD_INITIATORROLE;
 		ahd_pause(ahd);
 		ahd_loadseq(ahd);
+		ahd_restart(ahd);
 		ahd_unlock(ahd, &s);
 	}
 	cel = &ccb->cel;
@@ -9425,6 +9334,11 @@
 				ahd->flags |= AHD_INITIATORROLE;
 				ahd_pause(ahd);
 				ahd_loadseq(ahd);
+				ahd_restart(ahd);
+				/*
+				 * Unpaused.  The extra unpause
+				 * that follows is harmless.
+				 */
 			}
 		}
 		ahd_unpause(ahd);

==== //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.h#11 (text+ko) ====

@@ -37,9 +37,9 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: aic79xx.h,v 1.11 2003/05/26 21:10:58 gibbs Exp $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#92 $
  *
- * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.h,v 1.12 2003/05/30 02:14:22 scottl Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.h,v 1.13 2003/06/06 23:48:18 gibbs Exp $
  */
 
 #ifndef _AIC79XX_H_
@@ -1379,13 +1379,13 @@
 void			 ahd_free_scb(struct ahd_softc *ahd, struct scb *scb);
 void			 ahd_alloc_scbs(struct ahd_softc *ahd);
 void			 ahd_free(struct ahd_softc *ahd);
-int			 ahd_reset(struct ahd_softc *ahd);
+int			 ahd_reset(struct ahd_softc *ahd, int reinit);
 void			 ahd_shutdown(void *arg);
-int			ahd_write_flexport(struct ahd_softc *ahd,
-					   u_int addr, u_int value);
-int			ahd_read_flexport(struct ahd_softc *ahd, u_int addr,
-					  uint8_t *value);
-int			ahd_wait_flexport(struct ahd_softc *ahd);
+int			 ahd_write_flexport(struct ahd_softc *ahd,
+					    u_int addr, u_int value);
+int			 ahd_read_flexport(struct ahd_softc *ahd, u_int addr,
+					   uint8_t *value);
+int			 ahd_wait_flexport(struct ahd_softc *ahd);
 
 /*************************** Interrupt Services *******************************/
 void			ahd_pci_intr(struct ahd_softc *ahd);

==== //depot/projects/smpng/sys/dev/aic7xxx/aic79xx_pci.c#11 (text+ko) ====

@@ -38,9 +38,9 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#73 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#75 $
  *
- * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_pci.c,v 1.11 2003/05/26 21:15:52 gibbs Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_pci.c,v 1.13 2003/06/06 23:52:34 gibbs Exp $
  */
 
 #ifdef __linux__
@@ -375,7 +375,7 @@
 
 	ahd->bus_intr = ahd_pci_intr;
 
-	error = ahd_reset(ahd);
+	error = ahd_reset(ahd, /*reinit*/FALSE);
 	if (error != 0)
 		return (ENXIO);
 
@@ -418,9 +418,11 @@
 int
 ahd_pci_test_register_access(struct ahd_softc *ahd)
 {
-	uint32_t	cmd;
-	int		error;
-	uint8_t		hcntrl;
+	uint32_t cmd;
+	u_int	 targpcistat;
+	u_int	 pci_status1;
+	int	 error;
+	uint8_t	 hcntrl;
 
 	error = EIO;
 
@@ -454,6 +456,18 @@
 	ahd_outb(ahd, HCNTRL, hcntrl|PAUSE);
 	while (ahd_is_paused(ahd) == 0)
 		;
+
+	/* Clear any PCI errors that occurred before our driver attached. */
+	ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
+	targpcistat = ahd_inb(ahd, TARGPCISTAT);
+	ahd_outb(ahd, TARGPCISTAT, targpcistat);
+	pci_status1 = ahd_pci_read_config(ahd->dev_softc,
+					  PCIR_STATUS + 1, /*bytes*/1);
+	ahd_pci_write_config(ahd->dev_softc, PCIR_STATUS + 1,
+			     pci_status1, /*bytes*/1);
+	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
+	ahd_outb(ahd, CLRINT, CLRPCIINT);
+
 	ahd_outb(ahd, SEQCTL0, PERRORDIS);
 	ahd_outl(ahd, SRAM_BASE, 0x5aa555aa);
 	if (ahd_inl(ahd, SRAM_BASE) != 0x5aa555aa)
@@ -472,8 +486,6 @@
 
 fail:
 	if ((ahd_inb(ahd, INTSTAT) & PCIINT) != 0) {
-		u_int targpcistat;
-		u_int pci_status1;
 
 		ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
 		targpcistat = ahd_inb(ahd, TARGPCISTAT);
@@ -486,7 +498,6 @@
 				     pci_status1, /*bytes*/1);
 		ahd_outb(ahd, CLRINT, CLRPCIINT);
 	}
-
 	ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS);
 	ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
 	return (error);

==== //depot/projects/smpng/sys/dev/aic7xxx/aic7xxx.c#15 (text+ko) ====

@@ -37,9 +37,9 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#130 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#134 $
  *
- * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.92 2003/05/26 21:44:03 gibbs Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.95 2003/06/06 23:53:39 gibbs Exp $
  */
 
 #ifdef __linux__
@@ -1304,17 +1304,23 @@
 				ahc_qinfifo_requeue_tail(ahc, scb);
 				printerror = 0;
 			} else if (ahc_sent_msg(ahc, AHCMSG_EXT,
-						MSG_EXT_WDTR, FALSE)
-				|| ahc_sent_msg(ahc, AHCMSG_EXT,
-						MSG_EXT_SDTR, FALSE)) {
+						MSG_EXT_WDTR, FALSE)) {
 				/*
-				 * Negotiation Rejected.  Go-async and
+				 * Negotiation Rejected.  Go-narrow and

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list