Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Dec 2009 11:27:57 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 171529 for review
Message-ID:  <200912081127.nB8BRvov087018@repoman.freebsd.org>

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

Change 171529 by mav@mav_mavbook on 2009/12/08 11:27:30

	IFC

Affected files ...

.. //depot/projects/scottl-camlock/src/MAINTAINERS#6 integrate
.. //depot/projects/scottl-camlock/src/contrib/bind9/lib/isc/ia64/include/isc/atomic.h#4 integrate
.. //depot/projects/scottl-camlock/src/lib/libc/stdlib/getenv.3#3 integrate
.. //depot/projects/scottl-camlock/src/lib/libc/stdlib/getenv.c#4 integrate
.. //depot/projects/scottl-camlock/src/lib/libulog/Makefile#2 integrate
.. //depot/projects/scottl-camlock/src/lib/libulog/Symbol.map#2 integrate
.. //depot/projects/scottl-camlock/src/lib/libulog/utempter.c#1 branch
.. //depot/projects/scottl-camlock/src/lib/libulog/utempter.h#1 branch
.. //depot/projects/scottl-camlock/src/lib/libulog/utempter_add_record.3#1 branch
.. //depot/projects/scottl-camlock/src/release/i386/fixit_crunch.conf#3 integrate
.. //depot/projects/scottl-camlock/src/release/pc98/fixit-small_crunch.conf#3 integrate
.. //depot/projects/scottl-camlock/src/release/pc98/fixit_crunch.conf#3 integrate
.. //depot/projects/scottl-camlock/src/sbin/ipfw/ipfw2.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/boot/i386/libi386/biosmem.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/boot/i386/libi386/libi386.h#10 integrate
.. //depot/projects/scottl-camlock/src/sys/boot/i386/loader/main.c#10 integrate
.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_all.c#33 integrate
.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_da.c#44 integrate
.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_pmp.c#24 integrate
.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#66 integrate
.. //depot/projects/scottl-camlock/src/sys/cam/cam_periph.h#23 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/aac/aac.c#16 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/aac/aac_cam.c#15 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/aac/aacvar.h#10 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#90 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/bge/if_bge.c#31 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/LICENSE#2 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_80003es2lan.c#3 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_80003es2lan.h#2 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_82541.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_82571.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_82575.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_82575.h#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_api.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_defines.h#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_hw.h#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_ich8lan.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_ich8lan.h#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_mac.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_manage.c#2 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_osdep.h#2 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_phy.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_phy.h#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_regs.h#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/if_em.c#11 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/if_em.h#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/if_igb.c#12 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/e1000/if_igb.h#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe.c#14 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe_82598.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe_82599.c#3 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe_api.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe_api.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe_common.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe_common.h#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe_osdep.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe_phy.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe_phy.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ixgbe/ixgbe_type.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/mfi/mfi.c#20 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/puc/pucdata.c#15 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#29 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/siis/siis.h#13 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/uart/uart_bus_pci.c#8 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/input/atp.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/fs/ntfs/ntfs.h#6 integrate
.. //depot/projects/scottl-camlock/src/sys/fs/ntfs/ntfs_subr.c#8 integrate
.. //depot/projects/scottl-camlock/src/sys/fs/ntfs/ntfs_vfsops.c#13 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/ia64/clock.c#9 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/ia64/exception.S#7 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/ia64/genassym.c#7 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/ia64/interrupt.c#17 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/ia64/machdep.c#22 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/ia64/mp_machdep.c#12 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/ia64/pmap.c#22 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/include/kdb.h#6 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/include/param.h#13 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/include/pcpu.h#7 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/include/pmap.h#9 integrate
.. //depot/projects/scottl-camlock/src/sys/net80211/ieee80211_hostap.c#6 integrate
.. //depot/projects/scottl-camlock/src/sys/powerpc/psim/ata_iobus.c#8 integrate
.. //depot/projects/scottl-camlock/src/sys/sparc64/sparc64/trap.c#17 integrate
.. //depot/projects/scottl-camlock/src/sys/sys/param.h#36 integrate
.. //depot/projects/scottl-camlock/src/tools/regression/bin/sh/parser/for1.0#2 integrate

Differences ...

==== //depot/projects/scottl-camlock/src/MAINTAINERS#6 (text+ko) ====

@@ -1,4 +1,4 @@
-$FreeBSD: src/MAINTAINERS,v 1.154 2009/07/06 11:46:18 flz Exp $
+$FreeBSD: src/MAINTAINERS,v 1.155 2009/12/06 23:48:38 cperciva Exp $
 
 Please note that the content of this file is strictly advisory.
 No locks listed here are valid.  The only strict review requirements
@@ -124,6 +124,8 @@
 usr.sbin/bluetooth	emax	Pre-commit review preferred.
 gnu/usr.bin/send-pr	bugmaster	Pre-commit review requested.
 ncurses		rafan	Heads-up appreciated, try not to break it.
+*env(3)		secteam	Due to the problematic security history of this
+			code, please have patches reviewed by secteam.
 
 Following are the entries from the Makefiles, and a few other sources.
 Please remove stale entries from both their origin, and this file.

==== //depot/projects/scottl-camlock/src/contrib/bind9/lib/isc/ia64/include/isc/atomic.h#4 (text+ko) ====

@@ -41,7 +41,7 @@
 	for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) {
 		swapped = prev + val;
 		__asm__ volatile(
-			"mov ar.ccv=%2;"
+			"mov ar.ccv=%2;;"
 			"cmpxchg4.acq %0=%4,%3,ar.ccv"
 			: "=r" (swapped), "=m" (*p)
 			: "r" (prev), "r" (swapped), "m" (*p)
@@ -84,7 +84,7 @@
 	isc_int32_t ret;
 
 	__asm__ volatile(
-		"mov ar.ccv=%2;"
+		"mov ar.ccv=%2;;"
 		"cmpxchg4.acq %0=%4,%3,ar.ccv"
 		: "=r" (ret), "=m" (*p)
 		: "r" (cmpval), "r" (val), "m" (*p)

==== //depot/projects/scottl-camlock/src/lib/libc/stdlib/getenv.3#3 (text+ko) ====

@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)getenv.3	8.2 (Berkeley) 12/11/93
-.\" $FreeBSD: src/lib/libc/stdlib/getenv.3,v 1.27 2007/07/04 00:00:39 scf Exp $
+.\" $FreeBSD: src/lib/libc/stdlib/getenv.3,v 1.28 2009/12/06 23:51:27 scf Exp $
 .\"
 .Dd June 20, 2007
 .Dt GETENV 3
@@ -107,6 +107,15 @@
 deletes all instances of the variable name pointed to by
 .Fa name
 from the list.
+.Pp
+If corruption (e.g., a name without a value) is detected while making a copy of
+environ for internal usage, then
+.Fn setenv ,
+.Fn unsetenv
+and
+.Fn putenv
+will output a warning to stderr about the issue, drop the corrupt entry and
+complete the task without error.
 .Sh RETURN VALUES
 The
 .Fn getenv
@@ -159,15 +168,6 @@
 or
 .Fn putenv
 failed because they were unable to allocate memory for the environment.
-.It Bq Er EFAULT
-The functions
-.Fn setenv ,
-.Fn unsetenv
-or
-.Fn putenv
-failed to make a valid copy of the environment due to the environment being
-corrupt (i.e., a name without a value).  A warning will be output to stderr with
-information about the issue.
 .El
 .Sh SEE ALSO
 .Xr csh 1 ,

==== //depot/projects/scottl-camlock/src/lib/libc/stdlib/getenv.c#4 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2008 Sean C. Farley <scf@FreeBSD.org>
+ * Copyright (c) 2007-2009 Sean C. Farley <scf@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/getenv.c,v 1.17 2009/12/01 06:42:47 green Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/getenv.c,v 1.20 2009/12/07 00:22:10 scf Exp $");
 
 
 #include "namespace.h"
@@ -160,7 +160,7 @@
 
 	/*
 	 * Find environment variable from end of array (more likely to be
-	 * active).  A variable created by putenv is always active or it is not
+	 * active).  A variable created by putenv is always active, or it is not
 	 * tracked in the array.
 	 */
 	for (ndx = *envNdx; ndx >= 0; ndx--)
@@ -426,13 +426,14 @@
 	}
 
 	/*
-	 * An empty environment (environ or its first value) regardless if
-	 * environ has been copied before will return a NULL.
+	 * Variable search order:
+	 * 1. Check for an empty environ.  This allows an application to clear
+	 *    the environment.
+	 * 2. Search the external environ array.
+	 * 3. Search the internal environment.
 	 *
-	 * If the environment is not empty, find an environment variable via
-	 * environ if environ has not been copied via an *env() call or been
-	 * replaced by a running program, otherwise, use the rebuilt
-	 * environment.
+	 * Since malloc() depends upon getenv(), getenv() must never cause the
+	 * internal environment storage to be generated.
 	 */
 	if (environ == NULL || environ[0] == NULL)
 		return (NULL);

==== //depot/projects/scottl-camlock/src/lib/libulog/Makefile#2 (text+ko) ====

@@ -1,12 +1,17 @@
-# $FreeBSD: src/lib/libulog/Makefile,v 1.2 2009/12/05 19:53:29 ed Exp $
+# $FreeBSD: src/lib/libulog/Makefile,v 1.4 2009/12/07 05:57:28 ed Exp $
+
+SHLIBDIR?=/lib
+
+.include <bsd.own.mk>
 
 LIB=	ulog
 SHLIB_MAJOR= 0
-INCS=	ulog.h
+INCS=	ulog.h utempter.h
 SRCS=	ulog.h ulog_getutxent.c ulog_internal.h ulog_login.c \
-	ulog_login_pseudo.c ulog_pututxline.c ulog_util.c
+	ulog_login_pseudo.c ulog_pututxline.c ulog_util.c utempter.c
 
-MAN=	ulog_getutxent.3 ulog_login.3 ulog_setutxfile.3
+MAN=	ulog_getutxent.3 ulog_login.3 ulog_setutxfile.3 \
+	utempter_add_record.3
 MLINKS+=ulog_getutxent.3 ulog_endutxent.3 \
 	ulog_getutxent.3 ulog_getutxline.3 \
 	ulog_getutxent.3 ulog_pututxline.3 \
@@ -14,7 +19,12 @@
 	ulog_login.3 ulog_login_pseudo.3 \
 	ulog_login.3 ulog_logout.3 \
 	ulog_login.3 ulog_logout_pseudo.3 \
-	ulog_setutxfile.3 ulog_getutxuser.3
+	ulog_setutxfile.3 ulog_getutxuser.3 \
+	utempter_add_record.3 utempter_remove_added_record.3 \
+	utempter_add_record.3 utempter_remove_record.3 \
+	utempter_add_record.3 addToUtmp.3 \
+	utempter_remove_added_record.3 removeFromUtmp.3 \
+	utempter_remove_record.3 removeLineFromUtmp.3
 
 # Add links to <utmpx.h>-style functions.
 MLINKS+=ulog_endutxent.3 endutxent.3 \
@@ -28,4 +38,14 @@
 VERSION_DEF= ${.CURDIR}/../libc/Versions.def
 SYMBOL_MAPS= ${.CURDIR}/Symbol.map
 
+.if ${MK_INSTALLLIB} != "no"
+SYMLINKS+=libulog.a ${LIBDIR}/libutempter.a
+.endif
+.if !defined(NO_PIC)
+SYMLINKS+=libulog.so ${LIBDIR}/libutempter.so
+.endif
+.if ${MK_PROFILE} != "no"
+SYMLINKS+=libulog_p.a ${LIBDIR}/libutempter_p.a
+.endif
+
 .include <bsd.lib.mk>

==== //depot/projects/scottl-camlock/src/lib/libulog/Symbol.map#2 (text+ko) ====

@@ -1,5 +1,5 @@
 /*
- * $FreeBSD: src/lib/libulog/Symbol.map,v 1.2 2009/12/05 19:53:29 ed Exp $
+ * $FreeBSD: src/lib/libulog/Symbol.map,v 1.3 2009/12/06 20:30:21 ed Exp $
  */	
 
 FBSD_1.2 {
@@ -14,4 +14,11 @@
 	ulog_pututxline;
 	ulog_setutxent;
 	ulog_setutxfile;
+
+	addToUtmp;
+	removeFromUtmp;
+	removeLineFromUtmp;
+	utempter_add_record;
+	utempter_remove_added_record;
+	utempter_remove_record;
 };

==== //depot/projects/scottl-camlock/src/release/i386/fixit_crunch.conf#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/release/i386/fixit_crunch.conf,v 1.17 2008/09/25 12:25:54 nyan Exp $
+# $FreeBSD: src/release/i386/fixit_crunch.conf,v 1.18 2009/12/06 14:22:14 ed Exp $
 
 buildopts -DRELEASE_CRUNCH
 
@@ -46,4 +46,4 @@
 progs chroot
 ln chown chgrp
 
-libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lutil
+libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lulog -lutil

==== //depot/projects/scottl-camlock/src/release/pc98/fixit-small_crunch.conf#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/release/pc98/fixit-small_crunch.conf,v 1.11 2008/09/25 12:25:54 nyan Exp $
+# $FreeBSD: src/release/pc98/fixit-small_crunch.conf,v 1.12 2009/12/06 14:22:14 ed Exp $
 
 buildopts -DRELEASE_CRUNCH
 
@@ -40,4 +40,4 @@
 progs chown
 ln chown chgrp
 
-libs -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lutil 
+libs -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lulog -lutil 

==== //depot/projects/scottl-camlock/src/release/pc98/fixit_crunch.conf#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/release/pc98/fixit_crunch.conf,v 1.17 2008/09/25 12:25:54 nyan Exp $
+# $FreeBSD: src/release/pc98/fixit_crunch.conf,v 1.18 2009/12/06 14:22:14 ed Exp $
 
 buildopts -DRELEASE_CRUNCH
 
@@ -44,4 +44,4 @@
 progs chown
 ln chown chgrp
 
-libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lutil
+libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lulog -lutil

==== //depot/projects/scottl-camlock/src/sbin/ipfw/ipfw2.c#4 (text+ko) ====

@@ -17,7 +17,7 @@
  *
  * NEW command line interface for IP firewall facility
  *
- * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.149 2009/06/08 10:53:18 luigi Exp $
+ * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.150 2009/12/06 18:04:26 luigi Exp $
  */
 
 #include <sys/types.h>
@@ -2740,9 +2740,11 @@
 
 		/*
 		 * In the kernel we assume AF_INET and use only
-		 * sin_port and sin_addr.
+		 * sin_port and sin_addr. Remember to set sin_len as
+		 * the routing code seems to use it too.
 		 */
 		p->sa.sin_family = AF_INET;
+		p->sa.sin_len = sizeof(struct sockaddr_in);
 		p->sa.sin_port = 0;
 		/*
 		 * locate the address-port separator (':' or ',')

==== //depot/projects/scottl-camlock/src/sys/boot/i386/libi386/biosmem.c#4 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosmem.c,v 1.9 2007/10/28 21:23:49 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosmem.c,v 1.11 2009/12/07 16:29:43 jhb Exp $");
 
 /*
  * Obtain memory configuration information from the BIOS
@@ -35,14 +35,20 @@
 #include "libi386.h"
 #include "btxv86.h"
 
-vm_offset_t	memtop, memtop_copyin;
-u_int32_t	bios_basemem, bios_extmem;
+vm_offset_t	memtop, memtop_copyin, high_heap_base;
+uint32_t	bios_basemem, bios_extmem, high_heap_size;
 
 static struct bios_smap smap;
 
+/*
+ * The minimum amount of memory to reserve in bios_extmem for the heap.
+ */
+#define	HEAP_MIN	(3 * 1024 * 1024)
+
 void
 bios_getmem(void)
 {
+    uint64_t size;
 
     /* Parse system memory map */
     v86.ebx = 0;
@@ -65,6 +71,26 @@
 	if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) {
 	    bios_extmem = smap.length;
 	}
+
+	/*
+	 * Look for the largest segment in 'extended' memory beyond
+	 * 1MB but below 4GB.
+	 */
+	if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) &&
+	    (smap.base < 0x100000000ull)) {
+	    size = smap.length;
+
+	    /*
+	     * If this segment crosses the 4GB boundary, truncate it.
+	     */
+	    if (smap.base + size > 0x100000000ull)
+		size = 0x100000000ull - smap.base;
+
+	    if (size > high_heap_size) {
+		high_heap_size = size;
+		high_heap_base = smap.base;
+	    }
+	}
     } while (v86.ebx != 0);
 
     /* Fall back to the old compatibility function for base memory */
@@ -97,5 +123,13 @@
     /* Set memtop to actual top of memory */
     memtop = memtop_copyin = 0x100000 + bios_extmem;
 
+    /*
+     * If we have extended memory and did not find a suitable heap
+     * region in the SMAP, use the last 3MB of 'extended' memory as a
+     * high heap candidate.
+     */
+    if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) {
+	high_heap_size = HEAP_MIN;
+	high_heap_base = memtop - HEAP_MIN;
+    }
 }    
-

==== //depot/projects/scottl-camlock/src/sys/boot/i386/libi386/libi386.h#10 (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/i386/libi386/libi386.h,v 1.28 2009/03/12 20:41:52 jhb Exp $
+ * $FreeBSD: src/sys/boot/i386/libi386/libi386.h,v 1.30 2009/12/07 16:29:43 jhb Exp $
  */
 
 
@@ -78,9 +78,9 @@
 int	bc_getdev(struct i386_devdesc *dev);	/* return dev_t for (dev) */
 int	bc_bios2unit(int biosdev);	/* xlate BIOS device -> bioscd unit */
 int	bc_unit2bios(int unit);		/* xlate bioscd unit -> BIOS device */
-u_int32_t	bd_getbigeom(int bunit);	/* return geometry in bootinfo format */
-int	bd_bios2unit(int biosdev);		/* xlate BIOS device -> biosdisk unit */
-int	bd_unit2bios(int unit);			/* xlate biosdisk unit -> BIOS device */
+uint32_t bd_getbigeom(int bunit);	/* return geometry in bootinfo format */
+int	bd_bios2unit(int biosdev);	/* xlate BIOS device -> biosdisk unit */
+int	bd_unit2bios(int unit);		/* xlate biosdisk unit -> BIOS device */
 int	bd_getdev(struct i386_devdesc *dev);	/* return dev_t for (dev) */
 
 ssize_t	i386_copyin(const void *src, vm_offset_t dest, const size_t len);
@@ -92,12 +92,15 @@
 void	bios_getsmap(void);
 
 void	bios_getmem(void);
-extern u_int32_t	bios_basemem;				/* base memory in bytes */
-extern u_int32_t	bios_extmem;				/* extended memory in bytes */
+extern uint32_t		bios_basemem;	/* base memory in bytes */
+extern uint32_t		bios_extmem;	/* extended memory in bytes */
 extern vm_offset_t	memtop;		/* last address of physical memory + 1 */
 extern vm_offset_t	memtop_copyin;	/* memtop less heap size for the cases */
-					/*  when heap is at the top of extended memory */
-					/*  for other cases - just the same as memtop */
+					/*  when heap is at the top of         */
+					/*  extended memory; for other cases   */
+					/*  just the same as memtop            */
+extern uint32_t		high_heap_size;	/* extended memory region available */
+extern vm_offset_t	high_heap_base;	/* for use as the heap */
 
 int biospci_find_devclass(uint32_t class, int index, uint32_t *locator);
 int biospci_write_config(uint32_t locator, int offset, int width, uint32_t val);

==== //depot/projects/scottl-camlock/src/sys/boot/i386/loader/main.c#10 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.44 2009/03/09 17:16:29 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.46 2009/12/07 16:29:43 jhb Exp $");
 
 /*
  * MD bootstrap main() and assorted miscellaneous
@@ -102,14 +102,19 @@
      */
     bios_getmem();
 
-#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT)
-    heap_top = PTOV(memtop_copyin);
-    memtop_copyin -= 0x300000;
-    heap_bottom = PTOV(memtop_copyin);
-#else
-    heap_top = (void *)bios_basemem;
-    heap_bottom = (void *)end;
+#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || \
+    defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT)
+    if (high_heap_size > 0) {
+	heap_top = PTOV(high_heap_base + high_heap_size);
+	heap_bottom = PTOV(high_heap_base);
+	if (high_heap_base < memtop_copyin)
+	    memtop_copyin = high_heap_base;
+    } else
 #endif
+    {
+	heap_top = (void *)PTOV(bios_basemem);
+	heap_bottom = (void *)end;
+    }
     setheap(heap_bottom, heap_top);
 
     /* 

==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_all.c#33 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/ata/ata_all.c,v 1.10 2009/12/01 23:01:29 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/ata/ata_all.c,v 1.11 2009/12/07 16:23:25 mav Exp $");
 
 #include <sys/param.h>
 

==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_da.c#44 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/ata/ata_da.c,v 1.11 2009/11/11 11:10:36 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/ata/ata_da.c,v 1.12 2009/12/06 11:48:53 mav Exp $");
 
 #include <sys/param.h>
 

==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_pmp.c#24 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/ata/ata_pmp.c,v 1.4 2009/11/24 12:47:58 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/ata/ata_pmp.c,v 1.5 2009/12/07 16:23:25 mav Exp $");
 
 #include <sys/param.h>
 

==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#66 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/ata/ata_xpt.c,v 1.17 2009/12/06 00:10:13 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/ata/ata_xpt.c,v 1.18 2009/12/07 16:23:25 mav Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>

==== //depot/projects/scottl-camlock/src/sys/cam/cam_periph.h#23 (text+ko) ====

@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/cam/cam_periph.h,v 1.22 2009/11/04 15:40:19 mav Exp $
+ * $FreeBSD: src/sys/cam/cam_periph.h,v 1.23 2009/12/06 11:48:53 mav Exp $
  */
 
 #ifndef _CAM_CAM_PERIPH_H

==== //depot/projects/scottl-camlock/src/sys/dev/aac/aac.c#16 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.150 2009/10/29 14:53:45 emaste Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.151 2009/12/08 05:35:51 jkim Exp $");
 
 /*
  * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
@@ -604,7 +604,7 @@
 	TAILQ_INIT(&sc->aac_fibmap_tqh);
 	sc->aac_commands = malloc(sc->aac_max_fibs * sizeof(struct aac_command),
 				  M_AACBUF, M_WAITOK|M_ZERO);
-	while (sc->total_fibs < AAC_PREALLOCATE_FIBS) {
+	while (sc->total_fibs < sc->aac_max_fibs) {
 		if (aac_alloc_commands(sc) != 0)
 			break;
 	}

==== //depot/projects/scottl-camlock/src/sys/dev/aac/aac_cam.c#15 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.33 2009/10/29 17:14:18 emaste Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.34 2009/12/08 05:35:51 jkim Exp $");
 
 /*
  * CAM front-end for communicating with non-DASD devices
@@ -260,8 +260,11 @@
 		cpi->hba_inquiry = PI_WIDE_16;
 		cpi->target_sprt = 0;
 
-		/* Resetting via the passthrough causes problems. */
-		cpi->hba_misc = PIM_NOBUSRESET;
+		/*
+		 * Resetting via the passthrough or parallel bus scan
+		 * causes problems.
+		 */
+		cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN;
 		cpi->hba_eng_cnt = 0;
 		cpi->max_target = camsc->inf->TargetsPerBus;
 		cpi->max_lun = 8;	/* Per the controller spec */

==== //depot/projects/scottl-camlock/src/sys/dev/aac/aacvar.h#10 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/dev/aac/aacvar.h,v 1.54 2009/10/29 14:53:45 emaste Exp $
+ *	$FreeBSD: src/sys/dev/aac/aacvar.h,v 1.55 2009/12/08 05:35:51 jkim Exp $
  */
 
 #include <sys/bio.h>
@@ -57,13 +57,6 @@
 #define AAC_ADAPTER_FIBS	8
 
 /*
- * FIBs are allocated in page-size chunks and can grow up to the 512
- * limit imposed by the hardware.
- */
-#define AAC_PREALLOCATE_FIBS	128
-#define AAC_NUM_MGT_FIB		8
-
-/*
  * The controller reports status events in AIFs.  We hang on to a number of
  * these in order to pass them out to user-space management tools.
  */

==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#90 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ahci/ahci.c,v 1.18 2009/11/26 08:49:46 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ahci/ahci.c,v 1.19 2009/12/06 23:56:54 mav Exp $");
 
 #include <sys/param.h>
 #include <sys/module.h>

==== //depot/projects/scottl-camlock/src/sys/dev/bge/if_bge.c#31 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.262 2009/12/03 23:57:06 yongari Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.265 2009/12/08 03:24:29 yongari Exp $");
 
 /*
  * Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
@@ -1642,7 +1642,9 @@
 	else
 		val = BGE_STD_RX_RING_CNT / 8;
 	CSR_WRITE_4(sc, BGE_RBDI_STD_REPL_THRESH, val);
-	CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, BGE_JUMBO_RX_RING_CNT/8);
+	if (BGE_IS_JUMBO_CAPABLE(sc))
+		CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH,
+		    BGE_JUMBO_RX_RING_CNT/8);
 
 	/*
 	 * Disable all unused send rings by setting the 'ring disabled'
@@ -1684,8 +1686,10 @@
 
 	/* Initialize RX ring indexes */
 	bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, 0);
-	bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, 0);
-	bge_writembx(sc, BGE_MBX_RX_MINI_PROD_LO, 0);
+	if (BGE_IS_JUMBO_CAPABLE(sc))
+		bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, 0);
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5700)
+		bge_writembx(sc, BGE_MBX_RX_MINI_PROD_LO, 0);
 
 	/*
 	 * Set up RX return ring 0
@@ -4588,17 +4592,11 @@
 bge_stop(struct bge_softc *sc)
 {
 	struct ifnet *ifp;
-	struct ifmedia_entry *ifm;
-	struct mii_data *mii = NULL;
-	int mtmp, itmp;
 
 	BGE_LOCK_ASSERT(sc);
 
 	ifp = sc->bge_ifp;
 
-	if ((sc->bge_flags & BGE_FLAG_TBI) == 0)
-		mii = device_get_softc(sc->bge_miibus);
-
 	callout_stop(&sc->bge_stat_ch);
 
 	/* Disable host interrupts. */
@@ -4672,27 +4670,6 @@
 	/* Free TX buffers. */
 	bge_free_tx_ring(sc);
 
-	/*
-	 * Isolate/power down the PHY, but leave the media selection
-	 * unchanged so that things will be put back to normal when
-	 * we bring the interface back up.
-	 */
-	if ((sc->bge_flags & BGE_FLAG_TBI) == 0) {
-		itmp = ifp->if_flags;
-		ifp->if_flags |= IFF_UP;
-		/*
-		 * If we are called from bge_detach(), mii is already NULL.
-		 */
-		if (mii != NULL) {
-			ifm = mii->mii_media.ifm_cur;
-			mtmp = ifm->ifm_media;
-			ifm->ifm_media = IFM_ETHER | IFM_NONE;
-			mii_mediachg(mii);
-			ifm->ifm_media = mtmp;
-		}
-		ifp->if_flags = itmp;
-	}
-
 	sc->bge_tx_saved_considx = BGE_TXCONS_UNSET;
 
 	/* Clear MAC's link state (PHY may still have link UP). */

==== //depot/projects/scottl-camlock/src/sys/dev/e1000/LICENSE#2 (text+ko) ====

@@ -1,6 +1,6 @@
-$FreeBSD: src/sys/dev/e1000/LICENSE,v 1.1 2008/07/30 21:56:53 jfv Exp $
+$FreeBSD: src/sys/dev/e1000/LICENSE,v 1.2 2009/12/08 01:07:44 jfv Exp $
 
-  Copyright (c) 2001-2008, Intel Corporation 
+  Copyright (c) 2001-2009, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 

==== //depot/projects/scottl-camlock/src/sys/dev/e1000/e1000_80003es2lan.c#3 (text+ko) ====

@@ -30,7 +30,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 ******************************************************************************/
-/*$FreeBSD: src/sys/dev/e1000/e1000_80003es2lan.c,v 1.3 2009/04/10 00:05:46 jfv Exp $*/
+/*$FreeBSD: src/sys/dev/e1000/e1000_80003es2lan.c,v 1.4 2009/12/08 01:07:44 jfv Exp $*/
 
 /*
  * 80003ES2LAN Gigabit Ethernet Controller (Copper)
@@ -171,7 +171,7 @@
 		break;
 	}
 
-	nvm->type               = e1000_nvm_eeprom_spi;
+	nvm->type = e1000_nvm_eeprom_spi;
 
 	size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
 	                  E1000_EECD_SIZE_EX_SHIFT);
@@ -206,17 +206,22 @@
 static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw)
 {
 	struct e1000_mac_info *mac = &hw->mac;
-	s32 ret_val = E1000_SUCCESS;
 
 	DEBUGFUNC("e1000_init_mac_params_80003es2lan");
 
-	/* Set media type */
+	/* Set media type and media-dependent function pointers */
 	switch (hw->device_id) {
 	case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
 		hw->phy.media_type = e1000_media_type_internal_serdes;
+		mac->ops.check_for_link = e1000_check_for_serdes_link_generic;
+		mac->ops.setup_physical_interface =
+			e1000_setup_fiber_serdes_link_generic;
 		break;
 	default:
 		hw->phy.media_type = e1000_media_type_copper;
+		mac->ops.check_for_link = e1000_check_for_copper_link_generic;
+		mac->ops.setup_physical_interface =
+			e1000_setup_copper_link_80003es2lan;
 		break;
 	}
 
@@ -230,6 +235,8 @@
 	mac->arc_subsystem_valid =
 	        (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK)
 	                ? TRUE : FALSE;
+	/* Adaptive IFS not supported */
+	mac->adaptive_ifs = FALSE;
 
 	/* Function pointers */
 
@@ -241,27 +248,6 @@
 	mac->ops.init_hw = e1000_init_hw_80003es2lan;
 	/* link setup */
 	mac->ops.setup_link = e1000_setup_link_generic;
-	/* physical interface link setup */
-	mac->ops.setup_physical_interface =
-	        (hw->phy.media_type == e1000_media_type_copper)
-	                ? e1000_setup_copper_link_80003es2lan
-	                : e1000_setup_fiber_serdes_link_generic;
-	/* check for link */
-	switch (hw->phy.media_type) {
-	case e1000_media_type_copper:
-		mac->ops.check_for_link = e1000_check_for_copper_link_generic;
-		break;
-	case e1000_media_type_fiber:
-		mac->ops.check_for_link = e1000_check_for_fiber_link_generic;
-		break;
-	case e1000_media_type_internal_serdes:
-		mac->ops.check_for_link = e1000_check_for_serdes_link_generic;
-		break;
-	default:
-		ret_val = -E1000_ERR_CONFIG;
-		goto out;
-		break;
-	}
 	/* check management mode */
 	mac->ops.check_mng_mode = e1000_check_mng_mode_generic;
 	/* multicast address update */
@@ -290,8 +276,10 @@
 	/* link info */
 	mac->ops.get_link_up_info = e1000_get_link_up_info_80003es2lan;
 
-out:
-	return ret_val;
+	/* set lan id for port to determine which phy lock to use */
+	hw->mac.ops.set_lan_id(hw);
+
+	return E1000_SUCCESS;
 }
 
 /**
@@ -307,7 +295,6 @@
 	hw->mac.ops.init_params = e1000_init_mac_params_80003es2lan;
 	hw->nvm.ops.init_params = e1000_init_nvm_params_80003es2lan;
 	hw->phy.ops.init_params = e1000_init_phy_params_80003es2lan;
-	e1000_get_bus_info_pcie_generic(hw);
 }
 
 /**
@@ -342,7 +329,6 @@
 	e1000_release_swfw_sync_80003es2lan(hw, mask);
 }
 
-
 /**
  *  e1000_acquire_mac_csr_80003es2lan - Acquire rights to access Kumeran register
  *  @hw: pointer to the HW structure
@@ -532,28 +518,36 @@
 		goto out;
 	}
 
-	/*
-	 * The "ready" bit in the MDIC register may be incorrectly set
-	 * before the device has completed the "Page Select" MDI
-	 * transaction.  So we wait 200us after each MDI command...
-	 */
-	usec_delay(200);
+	if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) {
+		/*
+		 * The "ready" bit in the MDIC register may be incorrectly set
+		 * before the device has completed the "Page Select" MDI
+		 * transaction.  So we wait 200us after each MDI command...
+		 */
+		usec_delay(200);
+
+		/* ...and verify the command was successful. */
+		ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
 
-	/* ...and verify the command was successful. */
-	ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
+		if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
+			ret_val = -E1000_ERR_PHY;
+			e1000_release_phy_80003es2lan(hw);
+			goto out;
+		}
 
-	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
-		ret_val = -E1000_ERR_PHY;
-		e1000_release_phy_80003es2lan(hw);
-		goto out;
-	}
+		usec_delay(200);
 
-	usec_delay(200);
+		ret_val = e1000_read_phy_reg_mdic(hw,
+		                                  MAX_PHY_REG_ADDRESS & offset,
+		                                  data);
 
-	ret_val = e1000_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
-	                                   data);
+		usec_delay(200);
+	} else {
+		ret_val = e1000_read_phy_reg_mdic(hw,
+		                                  MAX_PHY_REG_ADDRESS & offset,
+		                                  data);
+	}
 
-	usec_delay(200);
 	e1000_release_phy_80003es2lan(hw);
 
 out:
@@ -599,29 +593,36 @@
 		goto out;
 	}
 
+	if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) {
+		/*
+		 * The "ready" bit in the MDIC register may be incorrectly set
+		 * before the device has completed the "Page Select" MDI
+		 * transaction.  So we wait 200us after each MDI command...
+		 */
+		usec_delay(200);
 
-	/*
-	 * The "ready" bit in the MDIC register may be incorrectly set
-	 * before the device has completed the "Page Select" MDI
-	 * transaction.  So we wait 200us after each MDI command...
-	 */
-	usec_delay(200);
+		/* ...and verify the command was successful. */
+		ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
 
-	/* ...and verify the command was successful. */
-	ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
+		if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
+			ret_val = -E1000_ERR_PHY;
+			e1000_release_phy_80003es2lan(hw);
+			goto out;
+		}
 
-	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
-		ret_val = -E1000_ERR_PHY;
-		e1000_release_phy_80003es2lan(hw);
-		goto out;
-	}
+		usec_delay(200);
 
-	usec_delay(200);
+		ret_val = e1000_write_phy_reg_mdic(hw,
+		                                  MAX_PHY_REG_ADDRESS & offset,
+		                                  data);
 
-	ret_val = e1000_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
-	                                  data);
+		usec_delay(200);
+	} else {
+		ret_val = e1000_write_phy_reg_mdic(hw,
+		                                  MAX_PHY_REG_ADDRESS & offset,
+		                                  data);
+	}
 
-	usec_delay(200);
 	e1000_release_phy_80003es2lan(hw);
 
 out:
@@ -802,13 +803,13 @@
 
 	index = phy_data & GG82563_DSPD_CABLE_LENGTH;
 
-	if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE + 5) {
-		ret_val = E1000_ERR_PHY;
+	if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) {
+		ret_val = -E1000_ERR_PHY;
 		goto out;

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



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