PERFORCE change 137596 for review

Paolo Pisati piso at FreeBSD.org
Thu Mar 13 11:24:28 UTC 2008


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

Change 137596 by piso at piso_ferret on 2008/03/13 11:23:51

	IFC at 137593

Affected files ...

.. //depot/projects/soc2005/libalias/contrib/tcsh/sh.lex.c#4 integrate
.. //depot/projects/soc2005/libalias/lib/libalias/libalias/Makefile#7 integrate
.. //depot/projects/soc2005/libalias/lib/libarchive/archive_read_support_format_ar.c#5 integrate
.. //depot/projects/soc2005/libalias/lib/libarchive/test/test_read_format_ar.c#5 integrate
.. //depot/projects/soc2005/libalias/lib/libarchive/test/test_write_format_ar.c#5 integrate
.. //depot/projects/soc2005/libalias/lib/libc/gen/sem_timedwait.3#2 integrate
.. //depot/projects/soc2005/libalias/lib/libc/gen/sem_wait.3#2 integrate
.. //depot/projects/soc2005/libalias/lib/libc/sys/kldunload.2#3 integrate
.. //depot/projects/soc2005/libalias/lib/libpmc/libpmc.c#4 integrate
.. //depot/projects/soc2005/libalias/lib/libpmc/pmc_capabilities.3#2 integrate
.. //depot/projects/soc2005/libalias/share/man/man4/uart.4#3 integrate
.. //depot/projects/soc2005/libalias/sys/amd64/amd64/amd64_mem.c#3 integrate
.. //depot/projects/soc2005/libalias/sys/amd64/amd64/machdep.c#16 integrate
.. //depot/projects/soc2005/libalias/sys/amd64/amd64/mem.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/amd64/ia32/ia32_signal.c#3 integrate
.. //depot/projects/soc2005/libalias/sys/amd64/include/specialreg.h#9 integrate
.. //depot/projects/soc2005/libalias/sys/amd64/linux32/linux32_sysvec.c#11 integrate
.. //depot/projects/soc2005/libalias/sys/arm/arm/busdma_machdep.c#7 integrate
.. //depot/projects/soc2005/libalias/sys/arm/arm/nexus.c#5 integrate
.. //depot/projects/soc2005/libalias/sys/boot/common/dev_net.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/boot/powerpc/uboot/metadata.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/boot/uboot/lib/console.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/boot/uboot/lib/copy.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/boot/uboot/lib/glue.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/boot/uboot/lib/libuboot.h#2 integrate
.. //depot/projects/soc2005/libalias/sys/boot/uboot/lib/net.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/boot/uboot/lib/time.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/compat/svr4/svr4_sysvec.c#3 integrate
.. //depot/projects/soc2005/libalias/sys/dev/agp/agp_i810.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/dev/mxge/if_mxge.c#13 integrate
.. //depot/projects/soc2005/libalias/sys/dev/tsec/if_tsec.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/dev/tsec/if_tsec.h#2 integrate
.. //depot/projects/soc2005/libalias/sys/dev/uart/uart.h#4 integrate
.. //depot/projects/soc2005/libalias/sys/dev/uart/uart_dev_ns8250.c#4 integrate
.. //depot/projects/soc2005/libalias/sys/dev/usb/ehci_pci.c#7 integrate
.. //depot/projects/soc2005/libalias/sys/dev/usb/ums.c#7 integrate
.. //depot/projects/soc2005/libalias/sys/dev/wpi/if_wpi.c#3 integrate
.. //depot/projects/soc2005/libalias/sys/i386/i386/i686_mem.c#3 integrate
.. //depot/projects/soc2005/libalias/sys/i386/i386/k6_mem.c#3 integrate
.. //depot/projects/soc2005/libalias/sys/i386/i386/machdep.c#18 integrate
.. //depot/projects/soc2005/libalias/sys/i386/include/specialreg.h#8 integrate
.. //depot/projects/soc2005/libalias/sys/i386/linux/linux_sysvec.c#8 integrate
.. //depot/projects/soc2005/libalias/sys/i386/svr4/svr4_machdep.c#2 integrate
.. //depot/projects/soc2005/libalias/sys/ia64/ia64/machdep.c#11 integrate
.. //depot/projects/soc2005/libalias/sys/kern/subr_sleepqueue.c#8 integrate
.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#69 integrate
.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.h#17 integrate
.. //depot/projects/soc2005/libalias/sys/pc98/pc98/machdep.c#15 integrate
.. //depot/projects/soc2005/libalias/sys/powerpc/booke/machdep.c#3 integrate
.. //depot/projects/soc2005/libalias/sys/powerpc/include/bootinfo.h#3 integrate
.. //depot/projects/soc2005/libalias/sys/powerpc/include/ocpbus.h#2 integrate
.. //depot/projects/soc2005/libalias/sys/powerpc/mpc85xx/ocpbus.c#3 integrate
.. //depot/projects/soc2005/libalias/sys/sys/cpuset.h#2 integrate
.. //depot/projects/soc2005/libalias/sys/sys/disklabel.h#3 integrate
.. //depot/projects/soc2005/libalias/usr.bin/cpuset/cpuset.1#3 integrate
.. //depot/projects/soc2005/libalias/usr.bin/cpuset/cpuset.c#2 integrate
.. //depot/projects/soc2005/libalias/usr.bin/kdump/kdump.c#8 integrate
.. //depot/projects/soc2005/libalias/usr.bin/kdump/kdump_subr.h#4 integrate
.. //depot/projects/soc2005/libalias/usr.bin/kdump/mksubr#8 integrate
.. //depot/projects/soc2005/libalias/usr.bin/make/globals.h#3 integrate
.. //depot/projects/soc2005/libalias/usr.bin/make/hash_tables.c#2 integrate
.. //depot/projects/soc2005/libalias/usr.bin/make/main.c#9 integrate
.. //depot/projects/soc2005/libalias/usr.bin/make/make.1#8 integrate
.. //depot/projects/soc2005/libalias/usr.bin/make/parse.c#5 integrate
.. //depot/projects/soc2005/libalias/usr.sbin/ppp/command.c#4 integrate
.. //depot/projects/soc2005/libalias/usr.sbin/ppp/ipcp.c#2 integrate
.. //depot/projects/soc2005/libalias/usr.sbin/ppp/main.c#4 integrate
.. //depot/projects/soc2005/libalias/usr.sbin/ppp/nat_cmd.c#2 integrate

Differences ...

==== //depot/projects/soc2005/libalias/contrib/tcsh/sh.lex.c#4 (text+ko) ====

@@ -851,7 +851,8 @@
 	    return (en);
 	}
 	slhs.len = 0;
-	Strbuf_append(&slhs, lhsb.s);
+	if (lhsb.s != NULL && lhsb.len != 0)
+	    Strbuf_append(&slhs, lhsb.s);
 	Strbuf_terminate(&slhs);
 	if (exclc)
 	    en = dosub(sc, en, global);

==== //depot/projects/soc2005/libalias/lib/libalias/libalias/Makefile#7 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/lib/libalias/libalias/Makefile,v 1.4 2007/06/18 18:47:53 rafan Exp $
+# $FreeBSD: src/lib/libalias/libalias/Makefile,v 1.5 2008/03/12 11:58:28 piso Exp $
 
 .PATH: ${.CURDIR}/../../../sys/netinet/libalias
 

==== //depot/projects/soc2005/libalias/lib/libarchive/archive_read_support_format_ar.c#5 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_ar.c,v 1.8 2008/02/19 05:54:24 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_ar.c,v 1.9 2008/03/12 21:10:26 kaiw Exp $");
 
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
@@ -83,8 +83,7 @@
 		    struct archive_entry *e);
 static uint64_t	ar_atol8(const char *p, unsigned char_cnt);
 static uint64_t	ar_atol10(const char *p, unsigned char_cnt);
-static int	ar_parse_gnu_filename_table(struct archive_read *, struct ar *,
-		    const void *, size_t);
+static int	ar_parse_gnu_filename_table(struct archive_read *a);
 static int	ar_parse_common_header(struct ar *ar, struct archive_entry *,
 		    const char *h);
 
@@ -167,8 +166,8 @@
 	struct ar *ar;
 	uint64_t number; /* Used to hold parsed numbers before validation. */
 	ssize_t bytes_read;
-	size_t bsd_name_length, entry_size;
-	char *p;
+	size_t bsd_name_length, entry_size, s;
+	char *p, *st;
 	const void *b;
 	const char *h;
 	int r;
@@ -277,22 +276,42 @@
 			return (ARCHIVE_FATAL);
 		}
 		entry_size = (size_t)number;
+		if (entry_size == 0) {
+			archive_set_error(&a->archive, EINVAL,
+			    "Invalid string table");
+			return (ARCHIVE_WARN);
+		}
+		if (ar->strtab != NULL) {
+			archive_set_error(&a->archive, EINVAL,
+			    "More than one string tables exist");
+			return (ARCHIVE_WARN);
+		}
+
 		/* Read the filename table into memory. */
-		bytes_read = (a->decompressor->read_ahead)(a, &b, entry_size);
-		if (bytes_read <= 0)
+		st = malloc(entry_size);
+		if (st == NULL) {
+			archive_set_error(&a->archive, ENOMEM,
+			    "Can't allocate filename table buffer");
 			return (ARCHIVE_FATAL);
-		if ((size_t)bytes_read < entry_size) {
-			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
-			    "Truncated input file");
-			return (ARCHIVE_FATAL);
+		}
+		ar->strtab = st;
+		ar->strtab_size = entry_size;
+		for (s = entry_size; s > 0; s -= bytes_read) {
+			bytes_read = (a->decompressor->read_ahead)(a, &b, s);
+			if (bytes_read <= 0)
+				return (ARCHIVE_FATAL);
+			if (bytes_read > (ssize_t)s)
+				bytes_read = s;
+			memcpy(st, b, bytes_read);
+			st += bytes_read;
+			(a->decompressor->consume)(a, bytes_read);
 		}
-		/*
-		 * Don't consume the contents, so the client will
-		 * also get a shot at reading it.
-		 */
+		/* All contents are consumed. */
+		ar->entry_bytes_remaining = 0;
+		archive_entry_set_size(entry, ar->entry_bytes_remaining);
 
 		/* Parse the filename table. */
-		return (ar_parse_gnu_filename_table(a, ar, b, entry_size));
+		return (ar_parse_gnu_filename_table(a));
 	}
 
 	/*
@@ -492,31 +511,15 @@
 }
 
 static int
-ar_parse_gnu_filename_table(struct archive_read *a, struct ar *ar,
-    const void *h, size_t size)
+ar_parse_gnu_filename_table(struct archive_read *a)
 {
+	struct ar *ar;
 	char *p;
+	size_t size;
 
-	if (ar->strtab != NULL) {
-		archive_set_error(&a->archive, EINVAL,
-		    "More than one string tables exist");
-		return (ARCHIVE_WARN);
-	}
-
-	if (size == 0) {
-		archive_set_error(&a->archive, EINVAL, "Invalid string table");
-		return (ARCHIVE_WARN);
-	}
+	ar = (struct ar*)(a->format->data);
+	size = ar->strtab_size;
 
-	ar->strtab_size = size;
-	ar->strtab = malloc(size);
-	if (ar->strtab == NULL) {
-		archive_set_error(&a->archive, ENOMEM,
-		    "Can't allocate string table buffer");
-		return (ARCHIVE_FATAL);
-	}
-
-	(void)memcpy(ar->strtab, h, size);
 	for (p = ar->strtab; p < ar->strtab + size - 1; ++p) {
 		if (*p == '/') {
 			*p++ = '\0';

==== //depot/projects/soc2005/libalias/lib/libarchive/test/test_read_format_ar.c#5 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_ar.c,v 1.4 2007/07/06 15:43:11 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_ar.c,v 1.5 2008/03/12 21:10:26 kaiw Exp $");
 
 #if ARCHIVE_VERSION_STAMP >= 1009000
 /*
@@ -75,9 +75,7 @@
 	assertEqualInt(0, archive_entry_mtime(ae));
 	assertEqualInt(0, archive_entry_uid(ae));
 	assertEqualInt(0, archive_entry_gid(ae));
-	assertEqualInt(40, archive_entry_size(ae));
-	assertEqualIntA(a, 40, archive_read_data(a, buff, 50));
-	assert(0 == memcmp(buff, "yyytttsssaaafff.o/\nhhhhjjjjkkkkllll.o/\n\n", 40));
+	assertEqualInt(0, archive_entry_size(ae));
 
 	/* First Entry */
 	assertA(0 == archive_read_next_header(a, &ae));

==== //depot/projects/soc2005/libalias/lib/libarchive/test/test_write_format_ar.c#5 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_ar.c,v 1.5 2007/07/06 15:43:11 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_ar.c,v 1.6 2008/03/12 21:10:26 kaiw Exp $");
 
 char buff[4096];
 char buff2[64];
@@ -119,9 +119,7 @@
 	assertA(0 == archive_read_next_header(a, &ae));
 	assertEqualInt(0, archive_entry_mtime(ae));
 	assertEqualString("//", archive_entry_pathname(ae));
-	assertEqualInt(strlen(strtab), archive_entry_size(ae));
-	assertEqualIntA(a, strlen(strtab), archive_read_data(a, buff2, 100));
-	assert(0 == memcmp(buff2, strtab, strlen(strtab)));
+	assertEqualInt(0, archive_entry_size(ae));
 
 	assertA(0 == archive_read_next_header(a, &ae));
 	assert(1 == archive_entry_mtime(ae));

==== //depot/projects/soc2005/libalias/lib/libc/gen/sem_timedwait.3#2 (text+ko) ====

@@ -32,7 +32,7 @@
 .\" the referee document.  The original Standard can be obtained online at
 .\"	http://www.opengroup.org/unix/online.html.
 .\"
-.\" $FreeBSD: src/lib/libc/gen/sem_timedwait.3,v 1.2 2008/03/12 02:37:31 davidxu Exp $
+.\" $FreeBSD: src/lib/libc/gen/sem_timedwait.3,v 1.4 2008/03/13 10:26:17 ru Exp $
 .\"
 .Dd March 3, 2008
 .Dt SEM_TIMEDWAIT 3
@@ -106,17 +106,15 @@
 A signal interrupted this function.
 .El
 .Sh SEE ALSO
-.Xr semctl 2 ,
-.Xr semget 2 ,
-.Xr semop 2 ,
 .Xr sem_post 3 ,
 .Xr sem_trywait 3 ,
-.Xr sem_wait 3
+.Xr sem_wait 3 ,
+.Xr sem 4
 .Sh STANDARDS
 The
 .Fn sem_timedwait
 function conforms to
 .St -p1003.1-2004 .
 .Sh HISTORY
-The function first appeared in 
+The function first appeared in
 .Fx 5.0 .

==== //depot/projects/soc2005/libalias/lib/libc/gen/sem_wait.3#2 (text+ko) ====

@@ -25,7 +25,7 @@
 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/lib/libc/gen/sem_wait.3,v 1.13 2005/07/13 13:15:22 rwatson Exp $
+.\" $FreeBSD: src/lib/libc/gen/sem_wait.3,v 1.15 2008/03/13 10:25:30 ru Exp $
 .\"
 .Dd February 15, 2000
 .Dt SEM_WAIT 3
@@ -84,6 +84,7 @@
 .Sh SEE ALSO
 .Xr sem_getvalue 3 ,
 .Xr sem_post 3 ,
+.Xr sem_timedwait 3 ,
 .Xr sem 4
 .Sh STANDARDS
 The

==== //depot/projects/soc2005/libalias/lib/libc/sys/kldunload.2#3 (text+ko) ====

@@ -23,14 +23,13 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/lib/libc/sys/kldunload.2,v 1.19 2008/03/10 09:54:13 rwatson Exp $
+.\" $FreeBSD: src/lib/libc/sys/kldunload.2,v 1.20 2008/03/13 10:33:24 ru Exp $
 .\"
 .Dd March 10, 2008
 .Dt KLDUNLOAD 2
 .Os
 .Sh NAME
-.Nm kldunload
-.Nm kldunloadf
+.Nm kldunload , kldunloadf
 .Nd unload kld files
 .Sh LIBRARY
 .Lb libc
@@ -40,7 +39,7 @@
 .Ft int
 .Fn kldunload "int fileid"
 .Ft int
-.Fn kldunload "int fileid" "int flags"
+.Fn kldunloadf "int fileid" "int flags"
 .Sh DESCRIPTION
 The
 .Fn kldunload

==== //depot/projects/soc2005/libalias/lib/libpmc/libpmc.c#4 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2003-2006 Joseph Koshy
+ * Copyright (c) 2003-2008 Joseph Koshy
  * 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/libpmc/libpmc.c,v 1.12 2007/12/07 13:52:51 jkoshy Exp $");
+__FBSDID("$FreeBSD: src/lib/libpmc/libpmc.c,v 1.13 2008/03/12 15:51:32 jkoshy Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -1731,7 +1731,8 @@
 			*caps = cpu_info.pm_classes[i].pm_caps;
 			return (0);
 		}
-	return (EINVAL);
+	errno = EINVAL;
+	return (-1);
 }
 
 int
@@ -2194,7 +2195,8 @@
 			*width = cpu_info.pm_classes[i].pm_width;
 			return (0);
 		}
-	return (EINVAL);
+	errno = EINVAL;
+	return (-1);
 }
 
 int

==== //depot/projects/soc2005/libalias/lib/libpmc/pmc_capabilities.3#2 (text+ko) ====

@@ -21,7 +21,7 @@
 .\" out of the use of this software, even if advised of the possibility of
 .\" such damage.
 .\"
-.\" $FreeBSD: src/lib/libpmc/pmc_capabilities.3,v 1.1 2007/11/25 06:38:55 jkoshy Exp $
+.\" $FreeBSD: src/lib/libpmc/pmc_capabilities.3,v 1.2 2008/03/12 15:48:59 jkoshy Exp $
 .\"
 .Dd November 24, 2007
 .Os
@@ -157,7 +157,10 @@
 .Fn pmc_ncpu
 and
 .Fn pmc_npmc
-returns a positive integer if successful or -1 in case of an error.
+returns a positive integer if successful; otherwise the value -1 is
+returned and the global variable
+.Va errno
+is set to indicate the error.
 .Pp
 Functions
 .Fn pmc_capabilities ,

==== //depot/projects/soc2005/libalias/share/man/man4/uart.4#3 (text+ko) ====

@@ -23,9 +23,9 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/uart.4,v 1.11 2006/09/18 15:24:19 ru Exp $
+.\" $FreeBSD: src/share/man/man4/uart.4,v 1.12 2008/03/12 19:09:58 sam Exp $
 .\"
-.Dd March 29, 2006
+.Dd March 12, 2008
 .Dt UART 4
 .Os
 .\"
@@ -41,6 +41,33 @@
 .Pp
 .Cd "device scc"
 .Cd "device uart"
+.Pp
+.Bd -ragged offset -compact
+In
+.Pa /boot/device.hints :
+.Cd hint.uart.0.disabled="1"
+.Cd hint.uart.0.baud="38400"
+.Cd hint.uart.0.port="0x3f8"
+.Cd hint.uart.0.flags="0x10"
+.Ed
+.Pp
+With
+.Ar flags
+encoded as:
+.Bl -tag -compact -width 0x000000
+.It 0x00010
+device is potential system console
+.It 0x00080
+use this port for remote kernel debugging
+.It 0x00100
+set RX FIFO trigger level to ``low'' (NS8250 only)
+.It 0x00200
+set RX FIFO trigger level to ``medium low'' (NS8250 only)
+.It 0x00400
+set RX FIFO trigger level to ``medium high'' (default, NS8250 only)
+.It 0x00800
+set RX FIFO trigger level to ``high'' (NS8250 only)
+.El
 .\"
 .Sh DESCRIPTION
 The

==== //depot/projects/soc2005/libalias/sys/amd64/amd64/amd64_mem.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/amd64_mem.c,v 1.27 2008/03/11 21:41:36 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/amd64_mem.c,v 1.29 2008/03/12 22:09:19 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -57,7 +57,7 @@
 #define	mrvalid(base, len) 						\
 	((!(base & ((1 << 12) - 1))) &&	/* base is multiple of 4k */	\
 	    ((len) >= (1 << 12)) &&	/* length is >= 4k */		\
-	    powerof2((len)) && 		/* ... and power of two */	\
+	    powerof2((len)) &&		/* ... and power of two */	\
 	    !((base) & ((len) - 1)))	/* range is not discontiuous */
 
 #define	mrcopyflags(curr, new)						\
@@ -82,6 +82,9 @@
 /* XXX for AP startup hook */
 static u_int64_t mtrrcap, mtrrdef;
 
+/* The bitmask for the PhysBase and PhysMask fields of the variable MTRRs. */
+static u_int64_t mtrr_physmask;
+
 static struct mem_range_desc *mem_range_match(struct mem_range_softc *sc,
 		    struct mem_range_desc *mrd);
 static void	amd64_mrfetch(struct mem_range_softc *sc);
@@ -110,11 +113,6 @@
 
 #define	MTRRTOMRTLEN (sizeof(amd64_mtrrtomrt) / sizeof(amd64_mtrrtomrt[0]))
 
-/*
- * Used in /dev/mem drivers and elsewhere
- */
-MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
-
 static int
 amd64_mtrr2mrt(int val)
 {
@@ -219,15 +217,15 @@
 		msrv = rdmsr(msr);
 		mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) |
 		    amd64_mtrr2mrt(msrv & MTRR_PHYSBASE_TYPE);
-		mrd->mr_base = msrv & MTRR_PHYSBASE_PHYSBASE;
+		mrd->mr_base = msrv & mtrr_physmask;
 		msrv = rdmsr(msr + 1);
 		mrd->mr_flags = (msrv & MTRR_PHYSMASK_VALID) ?
 		    (mrd->mr_flags | MDF_ACTIVE) :
 		    (mrd->mr_flags & ~MDF_ACTIVE);
 
 		/* Compute the range from the mask. Ick. */
-		mrd->mr_len = (~(msrv & MTRR_PHYSMASK_PHYSMASK)
-		    & (MTRR_PHYSMASK_PHYSMASK | 0xfffL)) + 1;
+		mrd->mr_len = (~(msrv & mtrr_physmask) &
+		    (mtrr_physmask | 0xfffL)) + 1;
 		if (!mrvalid(mrd->mr_base, mrd->mr_len))
 			mrd->mr_flags |= MDF_BOGUS;
 
@@ -366,7 +364,7 @@
 		/* base/type register */
 		omsrv = rdmsr(msr);
 		if (mrd->mr_flags & MDF_ACTIVE) {
-			msrv = mrd->mr_base & MTRR_PHYSBASE_PHYSBASE;
+			msrv = mrd->mr_base & mtrr_physmask;
 			msrv |= amd64_mrt2mtrr(mrd->mr_flags, omsrv);
 		} else {
 			msrv = 0;
@@ -376,7 +374,7 @@
 		/* mask/active register */
 		if (mrd->mr_flags & MDF_ACTIVE) {
 			msrv = MTRR_PHYSMASK_VALID |
-			    (~(mrd->mr_len - 1) & MTRR_PHYSMASK_PHYSMASK);
+			    (~(mrd->mr_len - 1) & mtrr_physmask);
 		} else {
 			msrv = 0;
 		}
@@ -479,14 +477,17 @@
 			/* Exact match? */
 			if ((curr_md->mr_base == mrd->mr_base) &&
 			    (curr_md->mr_len == mrd->mr_len)) {
+
 				/* Whoops, owned by someone. */
 				if (curr_md->mr_flags & MDF_BUSY)
 					return (EBUSY);
+
 				/* Check that we aren't doing something risky */
 				if (!(mrd->mr_flags & MDF_FORCE) &&
 				    ((curr_md->mr_flags & MDF_ATTRMASK) ==
 				    MDF_UNKNOWN))
 					return (EACCES);
+
 				/* Ok, just hijack this entry. */
 				free_md = curr_md;
 				break;
@@ -580,7 +581,8 @@
 amd64_mrinit(struct mem_range_softc *sc)
 {
 	struct mem_range_desc *mrd;
-	int i, nmdesc = 0;
+	u_int regs[4];
+	int i, nmdesc = 0, pabits;
 
 	mtrrcap = rdmsr(MSR_MTRRcap);
 	mtrrdef = rdmsr(MSR_MTRRdefType);
@@ -593,6 +595,20 @@
 	}
 	nmdesc = mtrrcap & MTRR_CAP_VCNT;
 
+	/*
+	 * Determine the size of the PhysMask and PhysBase fields in
+	 * the variable range MTRRs.  If the extended CPUID 0x80000008
+	 * is present, use that to figure out how many physical
+	 * address bits the CPU supports.  Otherwise, default to 36
+	 * address bits.
+	 */
+	if (cpu_exthigh >= 0x80000008) {
+		do_cpuid(0x80000008, regs);
+		pabits = regs[0] & 0xff;
+	} else
+		pabits = 36;
+	mtrr_physmask = ((1UL << pabits) - 1) & ~0xfffUL;
+
 	/* If fixed MTRRs supported and enabled. */
 	if ((mtrrcap & MTRR_CAP_FIXED) && (mtrrdef & MTRR_DEF_FIXED_ENABLE)) {
 		sc->mr_cap = MR686_FIXMTRR;

==== //depot/projects/soc2005/libalias/sys/amd64/amd64/machdep.c#16 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.681 2008/03/12 10:11:54 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.682 2008/03/13 10:54:36 kib Exp $");
 
 #include "opt_atalk.h"
 #include "opt_atpic.h"
@@ -357,7 +357,7 @@
 
 	regs->tf_rsp = (long)sfp;
 	regs->tf_rip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
-	regs->tf_rflags &= ~PSL_T;
+	regs->tf_rflags &= ~(PSL_T | PSL_D);
 	regs->tf_cs = _ucodesel;
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);

==== //depot/projects/soc2005/libalias/sys/amd64/amd64/mem.c#2 (text+ko) ====

@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mem.c,v 1.121 2004/08/07 06:21:37 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mem.c,v 1.122 2008/03/12 21:43:50 jhb Exp $");
 
 /*
  * Memory special file
@@ -67,6 +67,11 @@
 
 #include <machine/memdev.h>
 
+/*
+ * Used in /dev/mem drivers and elsewhere
+ */
+MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
+
 /* ARGSUSED */
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)

==== //depot/projects/soc2005/libalias/sys/amd64/ia32/ia32_signal.c#3 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.15 2006/10/05 01:56:10 davidxu Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.16 2008/03/13 10:54:37 kib Exp $");
 
 #include "opt_compat.h"
 
@@ -391,7 +391,7 @@
 
 	regs->tf_rsp = (uintptr_t)sfp;
 	regs->tf_rip = FREEBSD32_PS_STRINGS - sz_freebsd4_ia32_sigcode;
-	regs->tf_rflags &= ~PSL_T;
+	regs->tf_rflags &= ~(PSL_T | PSL_D);
 	regs->tf_cs = _ucode32sel;
 	regs->tf_ss = _udatasel;
 	load_ds(_udatasel);
@@ -511,7 +511,7 @@
 
 	regs->tf_rsp = (uintptr_t)sfp;
 	regs->tf_rip = FREEBSD32_PS_STRINGS - *(p->p_sysent->sv_szsigcode);
-	regs->tf_rflags &= ~PSL_T;
+	regs->tf_rflags &= ~(PSL_T | PSL_D);
 	regs->tf_cs = _ucode32sel;
 	regs->tf_ss = _udatasel;
 	load_ds(_udatasel);

==== //depot/projects/soc2005/libalias/sys/amd64/include/specialreg.h#9 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)specialreg.h	7.1 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/amd64/include/specialreg.h,v 1.44 2008/03/11 20:10:37 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/specialreg.h,v 1.45 2008/03/12 22:09:19 jhb Exp $
  */
 
 #ifndef _MACHINE_SPECIALREG_H_
@@ -275,9 +275,9 @@
 #define	MTRR_DEF_ENABLE		0x0000000000000800UL
 #define	MTRR_DEF_FIXED_ENABLE	0x0000000000000400UL
 #define	MTRR_DEF_TYPE		0x00000000000000ffUL
-#define	MTRR_PHYSBASE_PHYSBASE	0x000000fffffff000UL
+#define	MTRR_PHYSBASE_PHYSBASE	0x000ffffffffff000UL
 #define	MTRR_PHYSBASE_TYPE	0x00000000000000ffUL
-#define	MTRR_PHYSMASK_PHYSMASK	0x000000fffffff000UL
+#define	MTRR_PHYSMASK_PHYSMASK	0x000ffffffffff000UL
 #define	MTRR_PHYSMASK_VALID	0x0000000000000800UL
 
 /* Performance Control Register (5x86 only). */

==== //depot/projects/soc2005/libalias/sys/amd64/linux32/linux32_sysvec.c#11 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.32 2008/03/12 10:11:55 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.33 2008/03/13 10:54:37 kib Exp $");
 #include "opt_compat.h"
 
 #ifndef COMPAT_IA32
@@ -401,7 +401,7 @@
 	regs->tf_rsp = PTROUT(fp);
 	regs->tf_rip = LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode) +
 	    linux_sznonrtsigcode;
-	regs->tf_rflags &= ~PSL_T;
+	regs->tf_rflags &= ~(PSL_T | PSL_D);
 	regs->tf_cs = _ucode32sel;
 	regs->tf_ss = _udatasel;
 	load_ds(_udatasel);
@@ -523,7 +523,7 @@
 	 */
 	regs->tf_rsp = PTROUT(fp);
 	regs->tf_rip = LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode);
-	regs->tf_rflags &= ~PSL_T;
+	regs->tf_rflags &= ~(PSL_T | PSL_D);
 	regs->tf_cs = _ucode32sel;
 	regs->tf_ss = _udatasel;
 	load_ds(_udatasel);

==== //depot/projects/soc2005/libalias/sys/arm/arm/busdma_machdep.c#7 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.37 2007/11/28 22:21:17 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.38 2008/03/12 15:31:37 raj Exp $");
 
 /*
  * ARM bus dma support routines
@@ -755,7 +755,9 @@
 		 * XXX in user address space.
 		 */
 		if (__predict_true(pmap == pmap_kernel())) {
-			(void) pmap_get_pde_pte(pmap, vaddr, &pde, &ptep);
+			if (pmap_get_pde_pte(pmap, vaddr, &pde, &ptep) == FALSE)
+				return (EFAULT);
+
 			if (__predict_false(pmap_pde_section(pde))) {
 				if (*pde & L1_S_SUPERSEC)
 					curaddr = (*pde & L1_SUP_FRAME) |
@@ -903,7 +905,7 @@
 	CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d",
 	    __func__, dmat, dmat->flags, nsegs + 1, error);
 
-	return (0);
+	return (error);
 }
 
 /*

==== //depot/projects/soc2005/libalias/sys/arm/arm/nexus.c#5 (text+ko) ====

@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/nexus.c,v 1.11 2007/02/23 12:18:27 piso Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/nexus.c,v 1.12 2008/03/12 15:46:25 raj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -129,6 +129,9 @@
 {
 	int i;
 
+	if ((rman_get_flags(res) & RF_SHAREABLE) == 0)
+		flags |= INTR_EXCL;
+
 	for (i = rman_get_start(res); i <= rman_get_end(res); i++)
 		arm_setup_irqhandler(device_get_nameunit(child), 
 		    filt, intr, arg, i, flags, cookiep);

==== //depot/projects/soc2005/libalias/sys/boot/common/dev_net.c#2 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/dev_net.c,v 1.15 2004/07/08 22:35:33 brian Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/dev_net.c,v 1.16 2008/03/12 16:01:33 raj Exp $");
 
 /*-
  * This module implements a "raw device" interface suitable for
@@ -144,7 +144,6 @@
 		return (error);
 	    }
 	}
-	netdev_opens++;
     }
     netdev_opens++;
     f->f_devdata = &netdev_sock;
@@ -245,7 +244,8 @@
 	printf("net_open: bootparam/whoami RPC failed\n");
 	return (EIO);
     }
-    printf("net_open: client name: %s\n", hostname);
+    if (debug)
+        printf("net_open: client name: %s\n", hostname);
 
     /*
      * Ignore the gateway from whoami (unreliable).
@@ -259,10 +259,11 @@
     }
     if (smask) {
 	netmask = smask;
-	printf("net_open: subnet mask: %s\n", intoa(netmask));
+        if (debug)
+            printf("net_open: subnet mask: %s\n", intoa(netmask));
     }
-    if (gateip.s_addr)
-	printf("net_open: net gateway: %s\n", inet_ntoa(gateip));
+    if (gateip.s_addr && debug)
+        printf("net_open: net gateway: %s\n", inet_ntoa(gateip));
 
     /* Get the root server and pathname. */
     if (bp_getfile(sock, "root", &rootip, rootpath)) {
@@ -270,7 +271,7 @@
 	return (EIO);
     }
  exit:
-    /*  
+    /*
      * If present, strip the server's address off of the rootpath
      * before passing it along.  This allows us to be compatible with
      * the kernel's diskless (BOOTP_NFSROOT) booting conventions
@@ -285,8 +286,10 @@
 	    bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1);
 	    bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1);	    
     }
-    printf("net_open: server addr: %s\n", inet_ntoa(rootip));
-    printf("net_open: server path: %s\n", rootpath);	    
+    if (debug) {
+        printf("net_open: server addr: %s\n", inet_ntoa(rootip));
+        printf("net_open: server path: %s\n", rootpath);
+    }
 
     d = socktodesc(sock);
     sprintf(temp, "%6D", d->myea, ":");

==== //depot/projects/soc2005/libalias/sys/boot/powerpc/uboot/metadata.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/powerpc/uboot/metadata.c,v 1.3 2008/02/23 19:43:29 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/powerpc/uboot/metadata.c,v 1.4 2008/03/12 16:12:48 raj Exp $");
 
 #include <stand.h>
 #include <sys/param.h>
@@ -267,7 +267,7 @@
 	const char		*env;
 	void			*ptr;
 	u_int8_t		tmp_addr[6];
-	int			i, mr_no, eth_no, size;
+	int			i, n, mr_no, eth_no, size;
 
 	if ((si = ub_get_sys_info()) == NULL)
 		panic("can't retrieve U-Boot sysinfo");
@@ -301,15 +301,32 @@
 		if (strncmp(env, "eth", 3) == 0 &&
 		    strncmp(env + (strlen(env) - 4), "addr", 4) == 0) {
 
+			/* Extract interface number */
+			i = strtol(env + 3, &end, 10);
+			if (end == (env + 3))
+				/* 'ethaddr' means interface 0 address */
+				n = 0;
+			else
+				n = i;
+
+			if (n >= TMP_MAX_MR) {
+				printf("Ethernet interface number too high: %d. "
+				    "Skipping...\n");
+				continue;
+			}
+
 			str = ub_env_get(env);
 			for (i = 0; i < 6; i++) {
 				tmp_addr[i] = str ? strtol(str, &end, 16) : 0;
 				if (str)
 					str = (*end) ? end + 1 : end;
 
-				tmp_eth[eth_no].mac_addr[i] = tmp_addr[i];
+				tmp_eth[n].mac_addr[i] = tmp_addr[i];
 			}
-			eth_no++;
+
+			/* eth_no is 1-based number of all interfaces defined */
+			if (n + 1 > eth_no)
+				eth_no = n + 1;
 		}
 	}
 

==== //depot/projects/soc2005/libalias/sys/boot/uboot/lib/console.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/uboot/lib/console.c,v 1.1 2008/02/16 22:13:11 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/uboot/lib/console.c,v 1.2 2008/03/12 16:01:34 raj Exp $");
 
 #include <stand.h>
 #include "bootstrap.h"
@@ -52,18 +52,21 @@
 static void
 uboot_cons_probe(struct console *cp)
 {
+
 	cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT);
 }
 
 static int
 uboot_cons_init(int arg)
 {
+
 	return 0;
 }
 
 static void
 uboot_cons_putchar(int c)
 {
+
 	if (c == '\n')
 		ub_putc('\r');
 
@@ -73,11 +76,13 @@
 static int
 uboot_cons_getchar()
 {
+
 	return (ub_getc());
 }
 
 static int
 uboot_cons_poll()
 {
+
 	return (ub_tstc());
 }

==== //depot/projects/soc2005/libalias/sys/boot/uboot/lib/copy.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/uboot/lib/copy.c,v 1.1 2008/02/16 22:13:11 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/uboot/lib/copy.c,v 1.2 2008/03/12 16:01:34 raj Exp $");
 
 #include <stand.h>
 
@@ -39,6 +39,7 @@
 ssize_t
 uboot_copyin(const void *src, vm_offset_t dest, const size_t len)
 {
+
         bcopy(src, (void *)dest, len);
         return (len);
 }
@@ -46,6 +47,7 @@
 ssize_t
 uboot_copyout(const vm_offset_t src, void *dest, const size_t len)
 {
+
 	bcopy((void *)src, dest, len);
 	return (len);
 }
@@ -53,5 +55,6 @@
 ssize_t
 uboot_readin(const int fd, vm_offset_t dest, const size_t len)
 {
+
 	return (read(fd, (void *) dest, len));
 }

==== //depot/projects/soc2005/libalias/sys/boot/uboot/lib/glue.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/uboot/lib/glue.c,v 1.2 2008/02/23 17:56:17 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/uboot/lib/glue.c,v 1.3 2008/03/12 16:01:34 raj Exp $");
 
 #include <stand.h>
 #include "api_public.h"
@@ -112,7 +112,7 @@
 	struct api_signature s;
 
 	if (sig == NULL)
-		return 0;
+		return (0);
 	/*
 	 * Clear the checksum field (in the local copy) so as to calculate the

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


More information about the p4-projects mailing list