svn commit: r205644 - in projects/ppc64: . contrib/netcat crypto/openssl/crypto/camellia/asm etc/defaults gnu/usr.bin/cpio include lib/libc/gen lib/libc/sys lib/libpmc libexec/rtld-elf sbin/ifconfi...

Nathan Whitehorn nwhitehorn at FreeBSD.org
Thu Mar 25 14:44:14 UTC 2010


Author: nwhitehorn
Date: Thu Mar 25 14:44:13 2010
New Revision: 205644
URL: http://svn.freebsd.org/changeset/base/205644

Log:
  All the MI bits of this branch have now been merged to HEAD. Merge them
  back.
  
  IFC @ 205643

Deleted:
  projects/ppc64/crypto/openssl/crypto/camellia/asm/
  projects/ppc64/tools/tools/nanobsd/pcengines/Pkg/
  projects/ppc64/usr.sbin/ntp/ntptrace/
Modified:
  projects/ppc64/Makefile.inc1
  projects/ppc64/contrib/netcat/FREEBSD-upgrade
  projects/ppc64/contrib/netcat/FREEBSD-vendor
  projects/ppc64/contrib/netcat/nc.1
  projects/ppc64/contrib/netcat/netcat.c
  projects/ppc64/etc/defaults/periodic.conf
  projects/ppc64/gnu/usr.bin/cpio/Makefile
  projects/ppc64/include/dlfcn.h
  projects/ppc64/lib/libc/gen/dlfcn.c
  projects/ppc64/lib/libc/gen/dlopen.3
  projects/ppc64/lib/libc/sys/mmap.2
  projects/ppc64/lib/libpmc/pmc.xscale.3
  projects/ppc64/libexec/rtld-elf/rtld.c
  projects/ppc64/sbin/ifconfig/ifieee80211.c
  projects/ppc64/sbin/ipfw/ipfw2.c
  projects/ppc64/share/man/man3/pthread_affinity_np.3
  projects/ppc64/share/misc/bsd-family-tree
  projects/ppc64/sys/compat/linprocfs/linprocfs.c
  projects/ppc64/sys/conf/kern.post.mk
  projects/ppc64/sys/conf/kmod.mk
  projects/ppc64/sys/conf/options
  projects/ppc64/sys/dev/fb/vesa.c
  projects/ppc64/sys/dev/fb/vga.c
  projects/ppc64/sys/dev/ppc/ppc_pci.c
  projects/ppc64/sys/dev/syscons/scvgarndr.c
  projects/ppc64/sys/fs/nfs/nfs_commonport.c
  projects/ppc64/sys/geom/geom_io.c
  projects/ppc64/sys/i386/i386/mca.c
  projects/ppc64/sys/i386/i386/pmap.c
  projects/ppc64/sys/i386/include/md_var.h
  projects/ppc64/sys/i386/include/specialreg.h
  projects/ppc64/sys/kern/imgact_elf.c
  projects/ppc64/sys/kern/kern_rwlock.c
  projects/ppc64/sys/mips/mips/tick.c
  projects/ppc64/sys/modules/dummynet/Makefile
  projects/ppc64/sys/net/if_media.h
  projects/ppc64/sys/net80211/ieee80211.c
  projects/ppc64/sys/net80211/ieee80211_hostap.c
  projects/ppc64/sys/net80211/ieee80211_ht.c
  projects/ppc64/sys/net80211/ieee80211_var.h
  projects/ppc64/sys/netgraph/netflow/ng_netflow.c
  projects/ppc64/sys/netinet/ipfw/ip_dn_io.c
  projects/ppc64/sys/netinet/sctp_indata.c
  projects/ppc64/sys/netinet/sctp_input.c
  projects/ppc64/sys/netinet/sctp_output.c
  projects/ppc64/sys/netinet/sctp_pcb.c
  projects/ppc64/sys/netinet/sctp_pcb.h
  projects/ppc64/sys/netinet/sctp_sysctl.c
  projects/ppc64/sys/netinet/sctp_uio.h
  projects/ppc64/sys/netinet/sctputil.c
  projects/ppc64/sys/netinet/sctputil.h
  projects/ppc64/sys/netinet6/nd6.c
  projects/ppc64/sys/powerpc/booke/interrupt.c
  projects/ppc64/sys/powerpc/booke/machdep.c
  projects/ppc64/sys/powerpc/mpc85xx/ocpbus.c
  projects/ppc64/sys/powerpc/mpc85xx/ocpbus.h
  projects/ppc64/sys/powerpc/mpc85xx/pci_ocp.c
  projects/ppc64/sys/powerpc/powerpc/cpu.c
  projects/ppc64/sys/rpc/svc.c
  projects/ppc64/sys/vm/vm_mmap.c
  projects/ppc64/tools/tools/nanobsd/Files/root/updatep1
  projects/ppc64/tools/tools/nanobsd/Files/root/updatep2
  projects/ppc64/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt
  projects/ppc64/usr.sbin/bsnmpd/modules/snmp_pf/Makefile
  projects/ppc64/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
  projects/ppc64/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def
Directory Properties:
  projects/ppc64/   (props changed)
  projects/ppc64/contrib/expat/   (props changed)
  projects/ppc64/contrib/groff/   (props changed)
  projects/ppc64/contrib/netcat/   (props changed)
  projects/ppc64/contrib/one-true-awk/   (props changed)
  projects/ppc64/contrib/tzcode/stdtime/   (props changed)
  projects/ppc64/contrib/tzcode/zic/   (props changed)
  projects/ppc64/contrib/tzdata/   (props changed)
  projects/ppc64/lib/libz/   (props changed)
  projects/ppc64/sys/   (props changed)
  projects/ppc64/sys/contrib/x86emu/   (props changed)
  projects/ppc64/sys/dev/xen/xenpci/   (props changed)

Modified: projects/ppc64/Makefile.inc1
==============================================================================
--- projects/ppc64/Makefile.inc1	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/Makefile.inc1	Thu Mar 25 14:44:13 2010	(r205644)
@@ -299,6 +299,7 @@ LIB32FLAGS=	-m32 ${LIB32CPUFLAGS} -DCOMP
 LIB32WMAKEENV+=	MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
 		_SHLIBDIRPREFIX=${LIB32TMP} \
 		VERSION="${VERSION}" \
+		MACHINE_CPU="i686 mmx sse sse2" \
 		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 		PATH=${TMPPATH} \
 		CC="${CC} ${LIB32FLAGS}" \

Modified: projects/ppc64/contrib/netcat/FREEBSD-upgrade
==============================================================================
--- projects/ppc64/contrib/netcat/FREEBSD-upgrade	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/contrib/netcat/FREEBSD-upgrade	Thu Mar 25 14:44:13 2010	(r205644)
@@ -1,19 +1,14 @@
 $FreeBSD$
 
-1. Export from OpenBSD's nc(1) into an empty directory (say "v-nc").
-2. while read pattern; do rm ${pattern} ; done < FREEBSD-Xlist
-3. Checkout our contrib/netcat to another directory (say "f-nc"),
-   with -rOPENBSD, and usr.bin/nc to its ../../
-4. copy the files from v-nc to f-nc
-5. do cvs up -A in f-nc
-6. If there is conflicits, try to resolve them.
-7. do build in f-nc/../../usr.bin/nc
-8. If everything seems ok, do the actual import in v-nc:
-	cvs -n import src/contrib/netcat OPENBSD OPENBSD_<release>
-   Everything appears be Ok? Do:
-	cvs import src/contrib/netcat OPENBSD OPENBSD_<release>
-   (note: recently we import from OpenBSD's release branches
-    rather than importing -HEAD snapshots)
-9. Resolve the conflicits with the patchset obtained in step 6.
+Most of the instructions is outlined on FreeBSD wiki at:
 
-delphij at FreeBSD.org - 21 Apr 2008
+	http://wiki.freebsd.org/SubversionPrimer/VendorImports
+
+nc(1) is very small and most of code are just copied as-is from OpenBSD.  With a
+few exceptions:
+
+ * --no-tcpopt: Local feature specific to FreeBSD.
+ * -V: We use FIB to map what OpenBSD do for "rdomain"
+ * -E, -e: These are mostly self contained IPsec extensions
+
+delphij at FreeBSD.org - Mar 23, 2010

Modified: projects/ppc64/contrib/netcat/FREEBSD-vendor
==============================================================================
--- projects/ppc64/contrib/netcat/FREEBSD-vendor	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/contrib/netcat/FREEBSD-vendor	Thu Mar 25 14:44:13 2010	(r205644)
@@ -1,5 +1,5 @@
 # $FreeBSD$
 Project:	netcat (aka src/usr.bin/nc in OpenBSD)
 ProjectURL:	http://www.openbsd.org/
-Version:	4.6
+Version:	4.7
 License:	BSD

Modified: projects/ppc64/contrib/netcat/nc.1
==============================================================================
--- projects/ppc64/contrib/netcat/nc.1	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/contrib/netcat/nc.1	Thu Mar 25 14:44:13 2010	(r205644)
@@ -1,4 +1,4 @@
-.\"     $OpenBSD: nc.1,v 1.50 2009/06/05 06:47:12 jmc Exp $
+.\"     $OpenBSD: nc.1,v 1.53 2010/02/23 23:00:52 schwarze Exp $
 .\"
 .\" Copyright (c) 1996 David Sacerdote
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 5 2009
+.Dd February 23, 2010
 .Dt NC 1
 .Os
 .Sh NAME
@@ -51,8 +51,8 @@
 .Op Fl X Ar proxy_protocol
 .Oo Xo
 .Fl x Ar proxy_address Ns Oo : Ns
-.Ar port Oc Oc
-.Xc
+.Ar port Oc
+.Xc Oc
 .Op Ar hostname
 .Op Ar port
 .Ek
@@ -206,7 +206,9 @@ This makes it possible to use
 .Nm
 to script telnet sessions.
 .It Fl U
-Specifies to use Unix Domain Sockets.
+Specifies to use
+.Ux Ns -domain
+sockets.
 .It Fl u
 Use UDP instead of the default option of TCP.
 .It Fl V Ar fib
@@ -428,7 +430,9 @@ outgoing traffic only.
 .Pp
 .Dl $ nc -e 'out ipsec esp/transport//require' host.example.com 42
 .Pp
-Create and listen on a Unix Domain Socket:
+Create and listen on a
+.Ux Ns -domain
+socket:
 .Pp
 .Dl $ nc -lU /var/tmp/dsocket
 .Pp

Modified: projects/ppc64/contrib/netcat/netcat.c
==============================================================================
--- projects/ppc64/contrib/netcat/netcat.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/contrib/netcat/netcat.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.93 2009/06/05 00:18:10 claudio Exp $ */
+/* $OpenBSD: netcat.c,v 1.95 2010/02/27 00:58:56 nicm Exp $ */
 /*
  * Copyright (c) 2001 Eric Jackson <ericj at monkey.org>
  *
@@ -455,8 +455,10 @@ main(int argc, char *argv[])
 					    uflag ? "udp" : "tcp");
 				}
 
-				printf("Connection to %s %s port [%s/%s] succeeded!\n",
-				    host, portlist[i], uflag ? "udp" : "tcp",
+				fprintf(stderr,
+				    "Connection to %s %s port [%s/%s] "
+				    "succeeded!\n", host, portlist[i],
+				    uflag ? "udp" : "tcp",
 				    sv ? sv->s_name : "*");
 			}
 			if (!zflag)
@@ -749,27 +751,27 @@ atelnet(int nfd, unsigned char *buf, uns
 	unsigned char *p, *end;
 	unsigned char obuf[4];
 
-	end = buf + size;
-	obuf[0] = '\0';
+	if (size < 3)
+		return;
+	end = buf + size - 2;
 
 	for (p = buf; p < end; p++) {
 		if (*p != IAC)
-			break;
+			continue;
 
 		obuf[0] = IAC;
 		p++;
 		if ((*p == WILL) || (*p == WONT))
 			obuf[1] = DONT;
-		if ((*p == DO) || (*p == DONT))
+		else if ((*p == DO) || (*p == DONT))
 			obuf[1] = WONT;
-		if (obuf) {
-			p++;
-			obuf[2] = *p;
-			obuf[3] = '\0';
-			if (atomicio(vwrite, nfd, obuf, 3) != 3)
-				warn("Write Error!");
-			obuf[0] = '\0';
-		}
+		else
+			continue;
+
+		p++;
+		obuf[2] = *p;
+		if (atomicio(vwrite, nfd, obuf, 3) != 3)
+			warn("Write Error!");
 	}
 }
 

Modified: projects/ppc64/etc/defaults/periodic.conf
==============================================================================
--- projects/ppc64/etc/defaults/periodic.conf	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/etc/defaults/periodic.conf	Thu Mar 25 14:44:13 2010	(r205644)
@@ -46,7 +46,7 @@ daily_clean_tmps_enable="NO"				# Delete
 daily_clean_tmps_dirs="/tmp"				# Delete under here
 daily_clean_tmps_days="3"				# If not accessed for
 daily_clean_tmps_ignore=".X*-lock .X11-unix .ICE-unix .font-unix .XIM-unix"
-daily_clean_tmps_ignore="$daily_clean_tmps_ignore quota.user quota.group"
+daily_clean_tmps_ignore="$daily_clean_tmps_ignore quota.user quota.group .snap"
 							# Don't delete these
 daily_clean_tmps_verbose="YES"				# Mention files deleted
 

Modified: projects/ppc64/gnu/usr.bin/cpio/Makefile
==============================================================================
--- projects/ppc64/gnu/usr.bin/cpio/Makefile	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/gnu/usr.bin/cpio/Makefile	Thu Mar 25 14:44:13 2010	(r205644)
@@ -58,6 +58,7 @@ SRCS=   copyin.c \
 	xstrndup.c \
 	alloca.h \
 	getopt.h
+CSTD=gnu89
 
 CLEANFILES+= alloca.h getopt.h
 

Modified: projects/ppc64/include/dlfcn.h
==============================================================================
--- projects/ppc64/include/dlfcn.h	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/include/dlfcn.h	Thu Mar 25 14:44:13 2010	(r205644)
@@ -113,8 +113,7 @@ typedef struct  dl_serinfo {
 __BEGIN_DECLS
 /* XSI functions first. */
 int	 dlclose(void *);
-const char *
-	 dlerror(void);
+char	*dlerror(void);
 void	*dlopen(const char *, int);
 void	*dlsym(void * __restrict, const char * __restrict);
 

Modified: projects/ppc64/lib/libc/gen/dlfcn.c
==============================================================================
--- projects/ppc64/lib/libc/gen/dlfcn.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/lib/libc/gen/dlfcn.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$");
 #include <link.h>
 #include <stddef.h>
 
-static const char sorry[] = "Service unavailable";
+static char sorry[] = "Service unavailable";
 
 /*
  * For ELF, the dynamic linker directly resolves references to its
@@ -69,7 +69,7 @@ dlclose(void *handle)
 }
 
 #pragma weak dlerror
-const char *
+char *
 dlerror(void)
 {
 	return sorry;

Modified: projects/ppc64/lib/libc/gen/dlopen.3
==============================================================================
--- projects/ppc64/lib/libc/gen/dlopen.3	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/lib/libc/gen/dlopen.3	Thu Mar 25 14:44:13 2010	(r205644)
@@ -52,7 +52,7 @@
 .Fn dlsym "void * restrict handle" "const char * restrict symbol"
 .Ft dlfunc_t
 .Fn dlfunc "void * restrict handle" "const char * restrict symbol"
-.Ft const char *
+.Ft char *
 .Fn dlerror "void"
 .Ft int
 .Fn dlclose "void *handle"

Modified: projects/ppc64/lib/libc/sys/mmap.2
==============================================================================
--- projects/ppc64/lib/libc/sys/mmap.2	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/lib/libc/sys/mmap.2	Thu Mar 25 14:44:13 2010	(r205644)
@@ -105,7 +105,7 @@ The file descriptor used for creating
 must be \-1.
 The
 .Fa offset
-argument is ignored.
+argument must be 0.
 .\".It Dv MAP_FILE
 .\"Mapped from a regular file or character-special device memory.
 .It Dv MAP_ANONYMOUS
@@ -316,6 +316,11 @@ was equal to zero.
 was specified and the
 .Fa fd
 argument was not -1.
+.It Bq Er EINVAL
+.Dv MAP_ANON
+was specified and the
+.Fa offset
+argument was not 0.
 .It Bq Er ENODEV
 .Dv MAP_ANON
 has not been specified and

Modified: projects/ppc64/lib/libpmc/pmc.xscale.3
==============================================================================
--- projects/ppc64/lib/libpmc/pmc.xscale.3	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/lib/libpmc/pmc.xscale.3	Thu Mar 25 14:44:13 2010	(r205644)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2009 Rui Paulo.  All rights reserved.
+.\" Copyright (c) 2009, 2010 Rui Paulo.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -9,7 +9,7 @@
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
 .\"
-.\" This software is provided by Joseph Koshy ``as is'' and
+.\" This software is provided by Rui Paulo ``as is'' and
 .\" any express or implied warranties, including, but not limited to, the
 .\" implied warranties of merchantability and fitness for a particular purpose
 .\" are disclaimed.  in no event shall Joseph Koshy be liable
@@ -37,3 +37,120 @@ family CPUs
 .Sh SYNOPSIS
 .In pmc.h
 .Sh DESCRIPTION
+.Tn Intel XScale
+CPUs are ARM CPUs based on the ARMv5e core.
+.Pp
+Second generation cores have 2 counters, while third generation cores
+have 4 counters.
+Third generation cores also have an increased number of PMC events.
+.Pp
+.Tn Intel XScale
+PMCs are documented in 
+.Rs
+.%B "3rd Generation Intel XScale Microarchitecture Developer's Manual"
+.%D May 2007
+.Re
+.Ss Event Specifiers (Programmable PMCs)
+.Tn Intel XScale
+programmable PMCs support the following events:
+.Bl -tag -width indent
+.It Li IC_FETCH
+External memory fetch due to L1 instruction cache miss.
+.It Li IC_MISS
+Instruction cache or TLB miss.
+.It Li DATA_DEPENDENCY_STALLED
+A data dependency stalled
+.It Li ITLB_MISS
+Instruction TLB miss.
+.It Li DTLB_MISS
+Data TLB miss.
+.It Li BRANCH_RETIRED
+Branch instruction retired (executed).
+.It Li BRANCH_MISPRED
+Branch mispredicted.
+.It Li INSTR_RETIRED
+Instructions retired (executed).
+.It Li DC_FULL_CYCLE
+L1 data cache buffer full stall.
+Event occurs on every cycle the
+condition is present.
+.It Li DC_FULL_CONTIG
+L1 data cache buffer full stall.
+Event occurs once for each contiguous sequence of this type of stall.
+.It Li DC_ACCESS
+L1 data cache access, not including cache operations.
+.It Li DC_MISS
+L1 data cache miss, not including cache operations.
+.It Li DC_WRITEBACK
+L1 data cache write-back.
+Occurs for each cache line that's written back from the cache.
+.It Li PC_CHANGE
+Software changed the program counter.
+.It Li BRANCH_RETIRED_ALL
+Branch instruction retired (executed).
+This event counts all branch instructions, indirect or direct.
+.It Li INSTR_CYCLE
+Count the number of microarchitecture cycles each instruction requires
+to issue.
+.It Li CP_STALL
+Coprocessor stalled the instruction pipeline.
+.It Li PC_CHANGE_ALL
+Software changed the program counter (includes exceptions).
+.It Li PIPELINE_FLUSH
+Pipeline flushes due to mispredictions or exceptions.
+.It Li BACKEND_STALL
+Backend stalled the instruction pipeline.
+.It Li MULTIPLIER_USE
+Multiplier used.
+.It Li MULTIPLIER_STALLED
+Multiplier stalled the instruction pipeline.
+.It Li DATA_CACHE_STALLED
+Data cache stalled the instruction pipeline.
+.It Li L2_CACHE_REQ
+L2 cache request, not inclusing cache operations.
+.It Li L2_CACHE_MISS
+L2 cache miss, not including cache operations.
+.It Li ADDRESS_BUS_TRANS
+Address bus transaction.
+.It Li SELF_ADDRESS_BUS_TRANS
+Self initiated address bus transaction.
+.It Li DATA_BUS_TRANS
+Data bus transaction.
+.El
+.Ss Event Name Aliases  
+The following table shows the mapping between the PMC-independent
+aliases supported by
+.Lb libpmc
+and the underlying hardware events used.
+.Bl -column "branch-mispredicts" "BRANCH_MISPRED"
+.It Em Alias Ta Em Event Ta
+.It Li branches Ta Li BRANCH_RETIRED Ta
+.It Li branch-mispredicts Ta Li BRANCH_MISPRED Ta
+.It Li dc-misses Ta Li DC_MISS Ta
+.It Li ic-misses Ta Li IC_MISS Ta
+.It Li instructions Ta Li INSTR_RETIRED Ta
+.El
+.Sh SEE ALSO
+.Xr pmc 3 ,
+.Xr pmc_cpuinfo 3 ,
+.Xr pmclog 3 ,
+.Xr hwpmc 4
+.Sh CAVEATS
+The Intel XScale code does not yet support sampling.
+.Sh HISTORY
+The
+.Nm pmc
+library first appeared in
+.Fx 6.0 .
+Intel XScale support first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+The
+.Lb libpmc
+library was written by
+.An "Joseph Koshy"
+.Aq jkoshy at FreeBSD.org .
+.Pp
+Intel XScale support was added by
+.An "Rui Paulo"
+.Aq rpaulo at FreeBSD.org .

Modified: projects/ppc64/libexec/rtld-elf/rtld.c
==============================================================================
--- projects/ppc64/libexec/rtld-elf/rtld.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/libexec/rtld-elf/rtld.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -1961,7 +1961,7 @@ dlclose(void *handle)
     return 0;
 }
 
-const char *
+char *
 dlerror(void)
 {
     char *msg = error_message;

Modified: projects/ppc64/sbin/ifconfig/ifieee80211.c
==============================================================================
--- projects/ppc64/sbin/ifconfig/ifieee80211.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sbin/ifconfig/ifieee80211.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -4509,6 +4509,7 @@ end:
 		} else {
 			LINE_BREAK();
 			list_roam(s);
+			LINE_BREAK();
 		}
 	}
 

Modified: projects/ppc64/sbin/ipfw/ipfw2.c
==============================================================================
--- projects/ppc64/sbin/ipfw/ipfw2.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sbin/ipfw/ipfw2.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -2656,7 +2656,7 @@ ipfw_add(char *av[])
 	}
 
 	/* [set N]	-- set number (0..RESVD_SET), optional */
-	if (av[0] && !av[1] && _substrcmp(*av, "set") == 0) {
+	if (av[0] && av[1] && _substrcmp(*av, "set") == 0) {
 		int set = strtoul(av[1], NULL, 10);
 		if (set < 0 || set > RESVD_SET)
 			errx(EX_DATAERR, "illegal set %s", av[1]);

Modified: projects/ppc64/share/man/man3/pthread_affinity_np.3
==============================================================================
--- projects/ppc64/share/man/man3/pthread_affinity_np.3	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/share/man/man3/pthread_affinity_np.3	Thu Mar 25 14:44:13 2010	(r205644)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 12, 2010
+.Dd March 23, 2010
 .Dt PTHREAD_AFFINITY_NP 3
 .Os
 .Sh NAME
@@ -125,8 +125,8 @@ operation.
 .Xr cpuset_setid 2 ,
 .Xr CPU_SET 3 ,
 .Xr pthread 3 ,
-.Xr pthread_attr_get_affinity_np 3 ,
-.Xr pthread_attr_set_affinity_np 3
+.Xr pthread_attr_getaffinity_np 3 ,
+.Xr pthread_attr_setaffinity_np 3
 .Sh STANDARDS
 The
 .Nm pthread_getaffinity_np

Modified: projects/ppc64/share/misc/bsd-family-tree
==============================================================================
--- projects/ppc64/share/misc/bsd-family-tree	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/share/misc/bsd-family-tree	Thu Mar 25 14:44:13 2010	(r205644)
@@ -228,14 +228,14 @@ FreeBSD 5.2           |      |          
  |  FreeBSD 7.1       |      |                 |                       |
  |     |              |      |                 |                DragonFly 2.2.0
  |  FreeBSD 7.2       |   NetBSD 5.0       OpenBSD 4.5                 |
- |     |              |      |                 |                       |
- |     |              |      |                 |                DragonFly 2.4.0
- |     V              |      |             OpenBSD 4.6                 |
- |                    |      |                 |                       |
- *--FreeBSD           |      |                 |                       |
- |    8.0             |      |                 |                       |
- |     |              |      |                 |                       |
- |     V              |      |                 |                       |
+ |             \      |      |                 |                       |
+ |              |     |      |                 |                DragonFly 2.4.0
+ |              |     |      |             OpenBSD 4.6                 |
+ |              |     |      |                 |                       |
+ *--FreeBSD     |     |      |                 |                       |
+ |    8.0       |     |      |                 |                       |
+ |     |    FreeBSD   |      |                 |                       |
+ |     V      7.3     |      |                 |                       |
  |                    |      |                 |                       |
 FreeBSD 9 -current    |  NetBSD -current  OpenBSD -current             |
  |                    |      |                 |                       |
@@ -511,6 +511,7 @@ FreeBSD 7.2		2009-05-04 [FBD]
 DragonFly 2.4.0		2009-09-16 [DFB]
 OpenBSD 4.6		2009-10-18 [OBD]
 FreeBSD 8.0		2009-11-26 [FBD]
+FreeBSD 7.3		2010-03-23 [FBD]
 
 Bibliography
 ------------------------

Modified: projects/ppc64/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- projects/ppc64/sys/compat/linprocfs/linprocfs.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/compat/linprocfs/linprocfs.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -1227,6 +1227,24 @@ linprocfs_docmdline(PFS_FILL_ARGS)
 	return (0);
 }
 
+/*
+ * Filler function for proc/filesystems
+ */
+static int
+linprocfs_dofilesystems(PFS_FILL_ARGS)
+{
+	struct vfsconf *vfsp;
+
+	mtx_lock(&Giant);
+	TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) {
+		if (vfsp->vfc_flags & VFCF_SYNTHETIC)
+			sbuf_printf(sb, "nodev");
+		sbuf_printf(sb, "\t%s\n", vfsp->vfc_name);
+	}
+	mtx_unlock(&Giant);
+	return(0);
+}
+
 #if 0
 /*
  * Filler function for proc/modules
@@ -1276,6 +1294,8 @@ linprocfs_init(PFS_INIT_ARGS)
 	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "devices", &linprocfs_dodevices,
 	    NULL, NULL, NULL, PFS_RD);
+	pfs_create_file(root, "filesystems", &linprocfs_dofilesystems,
+	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "loadavg", &linprocfs_doloadavg,
 	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "meminfo", &linprocfs_domeminfo,

Modified: projects/ppc64/sys/conf/kern.post.mk
==============================================================================
--- projects/ppc64/sys/conf/kern.post.mk	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/conf/kern.post.mk	Thu Mar 25 14:44:13 2010	(r205644)
@@ -15,6 +15,10 @@ MKMODULESENV+=	DESTDIR="${DESTDIR}"
 SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;}
 MKMODULESENV+=	KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}"
 
+.if defined(CONF_CFLAGS)
+MKMODULESENV+=	CONF_CFLAGS="${CONF_CFLAGS}"
+.endif
+
 .MAIN: all
 
 .for target in all clean cleandepend cleandir clobber depend install \

Modified: projects/ppc64/sys/conf/kmod.mk
==============================================================================
--- projects/ppc64/sys/conf/kmod.mk	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/conf/kmod.mk	Thu Mar 25 14:44:13 2010	(r205644)
@@ -325,6 +325,9 @@ ${_src}:
 .endfor
 .endif
 
+# Repsect configuration-specific C flags.
+CFLAGS+=	${CONF_CFLAGS}
+
 MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \
 	dev/agp/agp_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \
 	dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \

Modified: projects/ppc64/sys/conf/options
==============================================================================
--- projects/ppc64/sys/conf/options	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/conf/options	Thu Mar 25 14:44:13 2010	(r205644)
@@ -437,6 +437,7 @@ SCTP_MBCNT_LOGGING	opt_sctp.h # Log to K
 SCTP_PACKET_LOGGING	opt_sctp.h # Log to a packet buffer last N packets
 SCTP_LTRACE_CHUNKS	opt_sctp.h # Log to KTR chunks processed
 SCTP_LTRACE_ERRORS	opt_sctp.h # Log to KTR error returns.
+SCTP_USE_PERCPU_STAT    opt_sctp.h # Use per cpu stats.
 #
 #
 #

Modified: projects/ppc64/sys/dev/fb/vesa.c
==============================================================================
--- projects/ppc64/sys/dev/fb/vesa.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/dev/fb/vesa.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 1998 Kazutaka YOKOTA and Michael Smith
+ * Copyright (c) 2009-2010 Jung-uk Kim <jkim at FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -188,9 +189,7 @@ static int vesa_bios_load_palette2(int s
 #define STATE_ALL	(STATE_HW | STATE_DATA | STATE_DAC | STATE_REG)
 static ssize_t vesa_bios_state_buf_size(void);
 static int vesa_bios_save_restore(int code, void *p, size_t size);
-#if 0
 static int vesa_bios_get_line_length(void);
-#endif
 static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines);
 #if 0
 static int vesa_bios_get_start(int *x, int *y);
@@ -199,6 +198,7 @@ static int vesa_bios_set_start(int x, in
 static int vesa_map_gen_mode_num(int type, int color, int mode);
 static int vesa_translate_flags(u_int16_t vflags);
 static int vesa_translate_mmodel(u_int8_t vmodel);
+static int vesa_get_bpscanline(struct vesa_mode *vmode);
 static int vesa_bios_init(void);
 static void vesa_clear_modes(video_info_t *info, int color);
 
@@ -558,7 +558,6 @@ vesa_bios_save_restore(int code, void *p
 	return (regs.R_AX != 0x004f);
 }
 
-#if 0
 static int
 vesa_bios_get_line_length(void)
 {
@@ -575,7 +574,6 @@ vesa_bios_get_line_length(void)
 
 	return (regs.R_BX);
 }
-#endif
 
 static int
 vesa_bios_set_line_length(int pixel, int *bytes, int *lines)
@@ -709,6 +707,43 @@ vesa_translate_mmodel(u_int8_t vmodel)
 	return (V_INFO_MM_OTHER);
 }
 
+static int
+vesa_get_bpscanline(struct vesa_mode *vmode)
+{
+	int bpsl;
+
+	if ((vmode->v_modeattr & V_MODEGRAPHICS) != 0) {
+		/* Find the minimum length. */
+		switch (vmode->v_bpp / vmode->v_planes) {
+		case 1:
+			bpsl = vmode->v_width / 8;
+			break;
+		case 2:
+			bpsl = vmode->v_width / 4;
+			break;
+		case 4:
+			bpsl = vmode->v_width / 2;
+			break;
+		default:
+			bpsl = vmode->v_width * ((vmode->v_bpp + 7) / 8);
+			bpsl /= vmode->v_planes;
+			break;
+		}
+
+		/* Use VBE 3.0 information if it looks sane. */
+		if ((vmode->v_modeattr & V_MODELFB) != 0 &&
+		    vesa_adp_info->v_version >= 0x0300 &&
+		    vmode->v_linbpscanline > bpsl)
+			return (vmode->v_linbpscanline);
+
+		/* Return the minimum if the mode table looks absurd. */
+		if (vmode->v_bpscanline < bpsl)
+			return (bpsl);
+	}
+
+	return (vmode->v_bpscanline);
+}
+
 #define	VESA_MAXSTR		256
 
 #define	VESA_STRCPY(dst, src)	do {				\
@@ -733,7 +768,6 @@ vesa_bios_init(void)
 	void *vmbuf;
 	uint32_t offs;
 	uint16_t vers;
-	int bpsl;
 	int is_via_cle266;
 	int modes;
 	int i;
@@ -858,9 +892,7 @@ vesa_bios_init(void)
 		}
 #endif
 
-		bpsl = (vmode.v_modeattr & V_MODELFB) != 0 && vers >= 0x0300 ?
-		    vmode.v_linbpscanline : vmode.v_bpscanline;
-		bsize = bpsl * vmode.v_height;
+		bsize = vesa_get_bpscanline(&vmode) * vmode.v_height;
 		if ((vmode.v_modeattr & V_MODEGRAPHICS) != 0)
 			bsize *= vmode.v_planes;
 
@@ -1181,6 +1213,7 @@ static int
 vesa_set_mode(video_adapter_t *adp, int mode)
 {
 	video_info_t info;
+	int bpsl;
 
 	if (adp != vesa_adp)
 		return ((*prevvidsw->set_mode)(adp, mode));
@@ -1209,7 +1242,7 @@ vesa_set_mode(video_adapter_t *adp, int 
 			int10_set_mode(adp->va_initial_bios_mode);
 			if (adp->va_info.vi_flags & V_INFO_LINEAR)
 				pmap_unmapdev(adp->va_buffer,
-				    adp->va_buffer_size);
+				    vesa_adp_info->v_memsize * 64 * 1024);
 			/* 
 			 * Once (*prevvidsw->get_info)() succeeded, 
 			 * (*prevvidsw->set_mode)() below won't fail...
@@ -1241,12 +1274,12 @@ vesa_set_mode(video_adapter_t *adp, int 
 
 	if ((vesa_adp_info->v_flags & V_DAC8) != 0 &&
 	    (info.vi_flags & V_INFO_GRAPHICS) != 0 &&
-	    (info.vi_flags & V_INFO_NONVGA) != 0 &&
 	    vesa_bios_set_dac(8) > 6)
 		adp->va_flags |= V_ADP_DAC8;
 
 	if (adp->va_info.vi_flags & V_INFO_LINEAR)
-		pmap_unmapdev(adp->va_buffer, adp->va_buffer_size);
+		pmap_unmapdev(adp->va_buffer,
+		    vesa_adp_info->v_memsize * 64 * 1024);
 
 #if VESA_DEBUG > 0
 	printf("VESA: mode set!\n");
@@ -1257,13 +1290,27 @@ vesa_set_mode(video_adapter_t *adp, int 
 		(info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
 	vesa_adp->va_crtc_addr =
 		(vesa_adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC;
+
+	vesa_adp->va_line_width = info.vi_buffer_size / info.vi_height;
+	if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
+		vesa_adp->va_line_width /= info.vi_planes;
+
+	/* If VBE function returns bigger bytes per scan line, use it. */
+	bpsl = vesa_bios_get_line_length();
+	if (bpsl > vesa_adp->va_line_width) {
+		vesa_adp->va_line_width = bpsl;
+		info.vi_buffer_size = bpsl * info.vi_height;
+		if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
+			info.vi_buffer_size *= info.vi_planes;
+	}
+
 	if (info.vi_flags & V_INFO_LINEAR) {
 #if VESA_DEBUG > 1
 		printf("VESA: setting up LFB\n");
 #endif
 		vesa_adp->va_buffer =
 		    (vm_offset_t)pmap_mapdev_attr(info.vi_buffer,
-		    info.vi_buffer_size, PAT_WRITE_COMBINING);
+		    vesa_adp_info->v_memsize * 64 * 1024, PAT_WRITE_COMBINING);
 		vesa_adp->va_window = vesa_adp->va_buffer;
 		vesa_adp->va_window_size = info.vi_buffer_size / info.vi_planes;
 		vesa_adp->va_window_gran = info.vi_buffer_size / info.vi_planes;
@@ -1275,9 +1322,6 @@ vesa_set_mode(video_adapter_t *adp, int 
 	}
 	vesa_adp->va_buffer_size = info.vi_buffer_size;
 	vesa_adp->va_window_orig = 0;
-	vesa_adp->va_line_width = info.vi_buffer_size / info.vi_height;
-	if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
-		vesa_adp->va_line_width /= info.vi_planes;
 	vesa_adp->va_disp_start.x = 0;
 	vesa_adp->va_disp_start.y = 0;
 #if VESA_DEBUG > 0
@@ -1322,10 +1366,10 @@ vesa_save_palette(video_adapter_t *adp, 
 {
 	int bits;
 
-	if (adp == vesa_adp && VESA_MODE(adp->va_mode) &&
-	    (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) {
+	if (adp == vesa_adp && VESA_MODE(adp->va_mode)) {
 		bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
-		return (vesa_bios_save_palette(0, 256, palette, bits));
+		if (vesa_bios_save_palette(0, 256, palette, bits) == 0)
+			return (0);
 	}
 
 	return ((*prevvidsw->save_palette)(adp, palette));
@@ -1336,10 +1380,10 @@ vesa_load_palette(video_adapter_t *adp, 
 {
 	int bits;
 
-	if (adp == vesa_adp && VESA_MODE(adp->va_mode) &&
-	    (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) {
+	if (adp == vesa_adp && VESA_MODE(adp->va_mode)) {
 		bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
-		return (vesa_bios_load_palette(0, 256, palette, bits));
+		if (vesa_bios_load_palette(0, 256, palette, bits) == 0)
+			return (0);
 	}
 
 	return ((*prevvidsw->load_palette)(adp, palette));
@@ -1544,8 +1588,6 @@ get_palette(video_adapter_t *adp, int ba
 		return (1);
 	if (!VESA_MODE(adp->va_mode))
 		return (1);
-	if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0)
-		return (1);
 
 	bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
 	r = malloc(count * 3, M_DEVBUF, M_WAITOK);
@@ -1582,8 +1624,6 @@ set_palette(video_adapter_t *adp, int ba
 		return (1);
 	if (!VESA_MODE(adp->va_mode))
 		return (1);
-	if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0)
-		return (1);
 
 	bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
 	r = malloc(count * 3, M_DEVBUF, M_WAITOK);

Modified: projects/ppc64/sys/dev/fb/vga.c
==============================================================================
--- projects/ppc64/sys/dev/fb/vga.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/dev/fb/vga.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -1979,6 +1979,7 @@ vga_show_font(video_adapter_t *adp, int 
 static int
 vga_save_palette(video_adapter_t *adp, u_char *palette)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
@@ -1988,8 +1989,9 @@ vga_save_palette(video_adapter_t *adp, u
      * VGA has 6 bit DAC .
      */
     outb(PALRADR, 0x00);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < 256*3; ++i)
-	palette[i] = inb(PALDATA) << 2; 
+	palette[i] = inb(PALDATA) << bits; 
     inb(adp->va_crtc_addr + 6);	/* reset flip/flop */
     return 0;
 }
@@ -1998,15 +2000,17 @@ static int
 vga_save_palette2(video_adapter_t *adp, int base, int count,
 		  u_char *r, u_char *g, u_char *b)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
 
     outb(PALRADR, base);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < count; ++i) {
-	r[i] = inb(PALDATA) << 2; 
-	g[i] = inb(PALDATA) << 2; 
-	b[i] = inb(PALDATA) << 2; 
+	r[i] = inb(PALDATA) << bits; 
+	g[i] = inb(PALDATA) << bits; 
+	b[i] = inb(PALDATA) << bits;
     }
     inb(adp->va_crtc_addr + 6);		/* reset flip/flop */
     return 0;
@@ -2021,14 +2025,16 @@ vga_save_palette2(video_adapter_t *adp, 
 static int
 vga_load_palette(video_adapter_t *adp, u_char *palette)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
 
     outb(PIXMASK, 0xff);		/* no pixelmask */
     outb(PALWADR, 0x00);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < 256*3; ++i)
-	outb(PALDATA, palette[i] >> 2);
+	outb(PALDATA, palette[i] >> bits);
     inb(adp->va_crtc_addr + 6);	/* reset flip/flop */
     outb(ATC, 0x20);			/* enable palette */
     return 0;
@@ -2038,16 +2044,18 @@ static int
 vga_load_palette2(video_adapter_t *adp, int base, int count,
 		  u_char *r, u_char *g, u_char *b)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
 
     outb(PIXMASK, 0xff);		/* no pixelmask */
     outb(PALWADR, base);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < count; ++i) {
-	outb(PALDATA, r[i] >> 2);
-	outb(PALDATA, g[i] >> 2);
-	outb(PALDATA, b[i] >> 2);
+	outb(PALDATA, r[i] >> bits);
+	outb(PALDATA, g[i] >> bits);
+	outb(PALDATA, b[i] >> bits);
     }
     inb(adp->va_crtc_addr + 6);		/* reset flip/flop */
     outb(ATC, 0x20);			/* enable palette */

Modified: projects/ppc64/sys/dev/ppc/ppc_pci.c
==============================================================================
--- projects/ppc64/sys/dev/ppc/ppc_pci.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/dev/ppc/ppc_pci.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -89,6 +89,7 @@ static struct pci_id pci_ids[] = {
 	{ 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 },
 	{ 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 },
 	{ 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 },
+	{ 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 },
 	{ 0xffff }
 };
 

Modified: projects/ppc64/sys/dev/syscons/scvgarndr.c
==============================================================================
--- projects/ppc64/sys/dev/syscons/scvgarndr.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/dev/syscons/scvgarndr.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -181,9 +181,17 @@ static u_short mouse_or_mask[16] = {
 #define	vga_drawpxl(pos, color)						\
 	switch (scp->sc->adp->va_info.vi_depth) {			\
 		case 32:						\
-		case 24:						\
 			writel(pos, vga_palette32[color]);		\
 			break;						\
+		case 24:						\
+			if (((pos) & 1) == 0) {				\
+				writew(pos, vga_palette32[color]);	\
+				writeb(pos + 2, vga_palette32[color] >> 16);\
+			} else {					\
+				writeb(pos, vga_palette32[color]);	\
+				writew(pos + 1, vga_palette32[color] >> 8);\
+			}						\
+			break;						\
 		case 16:						\
 			if (scp->sc->adp->va_info.vi_pixel_fsizes[1] == 5)\
 				writew(pos, vga_palette15[color]);	\

Modified: projects/ppc64/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- projects/ppc64/sys/fs/nfs/nfs_commonport.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/fs/nfs/nfs_commonport.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -117,7 +117,7 @@ struct mtx nfs_slock_mutex;
 /* local functions */
 static int nfssvc_call(struct thread *, struct nfssvc_args *, struct ucred *);
 
-#if defined(__i386__)
+#ifdef __NO_STRICT_ALIGNMENT
 /*
  * These architectures don't need re-alignment, so just return.
  */
@@ -127,7 +127,7 @@ newnfs_realign(struct mbuf **pm)
 
 	return;
 }
-#else
+#else	/* !__NO_STRICT_ALIGNMENT */
 /*
  *	newnfs_realign:
  *
@@ -185,7 +185,7 @@ newnfs_realign(struct mbuf **pm)
 		pm = &m->m_next;
 	}
 }
-#endif	/* !__i386__ */
+#endif	/* __NO_STRICT_ALIGNMENT */
 
 #ifdef notdef
 static void

Modified: projects/ppc64/sys/geom/geom_io.c
==============================================================================
--- projects/ppc64/sys/geom/geom_io.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/geom/geom_io.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -443,7 +443,10 @@ g_io_request(struct bio *bp, struct g_co
 	    ("Bio already on queue bp=%p", bp));
 	bp->bio_flags |= BIO_ONQUEUE;
 
-	binuptime(&bp->bio_t0);
+	if (g_collectstats)
+		binuptime(&bp->bio_t0);
+	else
+		getbinuptime(&bp->bio_t0);
 
 	/*
 	 * The statistics collection is lockless, as such, but we

Modified: projects/ppc64/sys/i386/i386/mca.c
==============================================================================
--- projects/ppc64/sys/i386/i386/mca.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/i386/i386/mca.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -60,11 +60,20 @@ static int mca_count;		/* Number of reco
 
 SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD, NULL, "Machine Check Architecture");
 
-static int mca_enabled = 0;
+static int mca_enabled = 1;
 TUNABLE_INT("hw.mca.enabled", &mca_enabled);
 SYSCTL_INT(_hw_mca, OID_AUTO, enabled, CTLFLAG_RDTUN, &mca_enabled, 0,
     "Administrative toggle for machine check support");
 
+static int amd10h_L1TP = 1;
+TUNABLE_INT("hw.mca.amd10h_L1TP", &amd10h_L1TP);
+SYSCTL_INT(_hw_mca, OID_AUTO, amd10h_L1TP, CTLFLAG_RDTUN, &amd10h_L1TP, 0,
+    "Administrative toggle for logging of level one TLB parity (L1TP) errors");
+
+int workaround_erratum383;
+SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD, &workaround_erratum383, 0,
+    "Is the workaround for Erratum 383 on AMD Family 10h processors enabled?");
+
 static STAILQ_HEAD(, mca_internal) mca_records;
 static struct callout mca_timer;
 static int mca_ticks = 3600;	/* Check hourly by default. */
@@ -527,7 +536,7 @@ void
 mca_init(void)
 {
 	uint64_t mcg_cap;
-	uint64_t ctl;
+	uint64_t ctl, mask;
 	int skip;
 	int i;
 
@@ -535,6 +544,15 @@ mca_init(void)
 	if (!mca_enabled || !(cpu_feature & CPUID_MCE))
 		return;
 
+	/*
+	 * On AMD Family 10h processors, unless logging of level one TLB
+	 * parity (L1TP) errors is disabled, enable the recommended workaround
+	 * for Erratum 383.
+	 */
+	if (cpu_vendor_id == CPU_VENDOR_AMD &&
+	    CPUID_TO_FAMILY(cpu_id) == 0x10 && amd10h_L1TP)
+		workaround_erratum383 = 1;
+
 	if (cpu_feature & CPUID_MCA) {
 		if (PCPU_GET(cpuid) == 0)
 			mca_setup();
@@ -545,6 +563,19 @@ mca_init(void)
 			/* Enable MCA features. */
 			wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE);
 
+		/*
+		 * Disable logging of level one TLB parity (L1TP) errors by
+		 * the data cache as an alternative workaround for AMD Family
+		 * 10h Erratum 383.  Unlike the recommended workaround, there
+		 * is no performance penalty to this workaround.  However,
+		 * L1TP errors will go unreported.
+		 */
+		if (cpu_vendor_id == CPU_VENDOR_AMD &&
+		    CPUID_TO_FAMILY(cpu_id) == 0x10 && !amd10h_L1TP) {
+			mask = rdmsr(MSR_MC0_CTL_MASK);
+			if ((mask & (1UL << 5)) == 0)
+				wrmsr(MSR_MC0_CTL_MASK, mask | (1UL << 5));
+		}
 		for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) {
 			/* By default enable logging of all errors. */
 			ctl = 0xffffffffffffffffUL;

Modified: projects/ppc64/sys/i386/i386/pmap.c
==============================================================================
--- projects/ppc64/sys/i386/i386/pmap.c	Thu Mar 25 14:31:26 2010	(r205643)
+++ projects/ppc64/sys/i386/i386/pmap.c	Thu Mar 25 14:44:13 2010	(r205644)
@@ -5,7 +5,7 @@
  * All rights reserved.
  * Copyright (c) 1994 David Greenman
  * All rights reserved.

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-projects mailing list