Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jul 2011 11:13:01 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r223757 - in projects/largeSMP: bin/ps contrib/gcc contrib/lukemftpd/src contrib/sendmail/src contrib/top sbin/ifconfig sbin/natd share/man/man9 share/mk sys/amd64/amd64 sys/arm/arm sys...
Message-ID:  <201107041113.p64BD1kU016553@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Mon Jul  4 11:13:00 2011
New Revision: 223757
URL: http://svn.freebsd.org/changeset/base/223757

Log:
  MFC

Added:
  projects/largeSMP/sbin/ifconfig/iffib.c
     - copied unchanged from r223756, head/sbin/ifconfig/iffib.c
  projects/largeSMP/sys/boot/common/disk.c
     - copied unchanged from r223756, head/sys/boot/common/disk.c
  projects/largeSMP/sys/boot/common/disk.h
     - copied unchanged from r223756, head/sys/boot/common/disk.h
  projects/largeSMP/sys/boot/ficl/amd64/
     - copied from r223756, head/sys/boot/ficl/amd64/
  projects/largeSMP/sys/boot/userboot/
     - copied from r223756, head/sys/boot/userboot/
Modified:
  projects/largeSMP/bin/ps/ps.1
  projects/largeSMP/contrib/gcc/c-decl.c
  projects/largeSMP/contrib/gcc/c.opt
  projects/largeSMP/contrib/gcc/common.opt
  projects/largeSMP/contrib/gcc/tree-nested.c
  projects/largeSMP/contrib/lukemftpd/src/ftpd.c
  projects/largeSMP/contrib/sendmail/src/deliver.c
  projects/largeSMP/sbin/ifconfig/Makefile
  projects/largeSMP/sbin/ifconfig/ifconfig.8
  projects/largeSMP/sbin/natd/natd.8
  projects/largeSMP/share/man/man9/ifnet.9
  projects/largeSMP/sys/amd64/amd64/pmap.c
  projects/largeSMP/sys/amd64/amd64/sys_machdep.c
  projects/largeSMP/sys/arm/arm/sys_machdep.c
  projects/largeSMP/sys/boot/Makefile.amd64
  projects/largeSMP/sys/boot/common/Makefile.inc
  projects/largeSMP/sys/boot/common/load_elf.c
  projects/largeSMP/sys/boot/common/reloc_elf.c
  projects/largeSMP/sys/boot/i386/libi386/bioscd.c
  projects/largeSMP/sys/boot/sparc64/loader/main.c
  projects/largeSMP/sys/conf/NOTES
  projects/largeSMP/sys/conf/options
  projects/largeSMP/sys/dev/ahci/ahci.c
  projects/largeSMP/sys/dev/iicbus/if_ic.c
  projects/largeSMP/sys/dev/lmc/if_lmc.c
  projects/largeSMP/sys/dev/ppbus/if_plip.c
  projects/largeSMP/sys/dev/sound/usb/uaudio.c
  projects/largeSMP/sys/dev/usb/input/uhid.c
  projects/largeSMP/sys/dev/usb/input/ukbd.c
  projects/largeSMP/sys/dev/usb/net/uhso.c
  projects/largeSMP/sys/dev/usb/quirk/usb_quirk.c
  projects/largeSMP/sys/dev/usb/quirk/usb_quirk.h
  projects/largeSMP/sys/dev/usb/usb_hid.c
  projects/largeSMP/sys/dev/usb/usbdevs
  projects/largeSMP/sys/dev/usb/usbhid.h
  projects/largeSMP/sys/fs/nfs/nfs_var.h
  projects/largeSMP/sys/fs/nfsclient/nfs_clrpcops.c
  projects/largeSMP/sys/fs/nfsclient/nfs_clstate.c
  projects/largeSMP/sys/i386/i386/pmap.c
  projects/largeSMP/sys/i386/i386/sys_machdep.c
  projects/largeSMP/sys/i386/xen/pmap.c
  projects/largeSMP/sys/ia64/ia64/exception.S
  projects/largeSMP/sys/ia64/ia64/pmap.c
  projects/largeSMP/sys/kern/imgact_elf.c
  projects/largeSMP/sys/kern/kern_descrip.c
  projects/largeSMP/sys/kern/kern_exec.c
  projects/largeSMP/sys/kern/kern_jail.c
  projects/largeSMP/sys/kern/tty.c
  projects/largeSMP/sys/kern/uipc_shm.c
  projects/largeSMP/sys/kern/uipc_syscalls.c
  projects/largeSMP/sys/mips/mips/pmap.c
  projects/largeSMP/sys/net/if.c
  projects/largeSMP/sys/net/if.h
  projects/largeSMP/sys/net/if_arcsubr.c
  projects/largeSMP/sys/net/if_atmsubr.c
  projects/largeSMP/sys/net/if_debug.c
  projects/largeSMP/sys/net/if_ethersubr.c
  projects/largeSMP/sys/net/if_fddisubr.c
  projects/largeSMP/sys/net/if_fwsubr.c
  projects/largeSMP/sys/net/if_gif.c
  projects/largeSMP/sys/net/if_iso88025subr.c
  projects/largeSMP/sys/net/if_spppfr.c
  projects/largeSMP/sys/net/if_spppsubr.c
  projects/largeSMP/sys/net/if_stf.c
  projects/largeSMP/sys/net/if_tun.c
  projects/largeSMP/sys/net/if_var.h
  projects/largeSMP/sys/netgraph/netflow/netflow_v9.c
  projects/largeSMP/sys/netgraph/netgraph.h
  projects/largeSMP/sys/netgraph/ng_base.c
  projects/largeSMP/sys/netgraph/ng_iface.c
  projects/largeSMP/sys/netinet/if_ether.c
  projects/largeSMP/sys/netinet/sctp_uio.h
  projects/largeSMP/sys/netinet/sctp_usrreq.c
  projects/largeSMP/sys/sparc64/include/cache.h
  projects/largeSMP/sys/sparc64/include/cpu.h
  projects/largeSMP/sys/sparc64/include/tlb.h
  projects/largeSMP/sys/sparc64/sparc64/cache.c
  projects/largeSMP/sys/sparc64/sparc64/cheetah.c
  projects/largeSMP/sys/sparc64/sparc64/exception.S
  projects/largeSMP/sys/sparc64/sparc64/interrupt.S
  projects/largeSMP/sys/sparc64/sparc64/machdep.c
  projects/largeSMP/sys/sparc64/sparc64/mp_exception.S
  projects/largeSMP/sys/sparc64/sparc64/mp_machdep.c
  projects/largeSMP/sys/sparc64/sparc64/pmap.c
  projects/largeSMP/sys/sparc64/sparc64/spitfire.c
  projects/largeSMP/sys/sparc64/sparc64/sys_machdep.c
  projects/largeSMP/sys/sparc64/sparc64/zeus.c
  projects/largeSMP/sys/sys/_types.h
  projects/largeSMP/sys/sys/file.h
  projects/largeSMP/sys/sys/filedesc.h
  projects/largeSMP/sys/sys/priv.h
  projects/largeSMP/sys/sys/sockio.h
  projects/largeSMP/sys/sys/tty.h
  projects/largeSMP/sys/sys/ttydevsw.h
  projects/largeSMP/sys/sys/types.h
  projects/largeSMP/sys/vm/vm_pageout.c
  projects/largeSMP/usr.sbin/config/main.c
  projects/largeSMP/usr.sbin/rtadvd/if.c
Directory Properties:
  projects/largeSMP/   (props changed)
  projects/largeSMP/cddl/contrib/opensolaris/   (props changed)
  projects/largeSMP/contrib/bind9/   (props changed)
  projects/largeSMP/contrib/binutils/   (props changed)
  projects/largeSMP/contrib/bzip2/   (props changed)
  projects/largeSMP/contrib/compiler-rt/   (props changed)
  projects/largeSMP/contrib/dialog/   (props changed)
  projects/largeSMP/contrib/ee/   (props changed)
  projects/largeSMP/contrib/expat/   (props changed)
  projects/largeSMP/contrib/file/   (props changed)
  projects/largeSMP/contrib/gcc/   (props changed)
  projects/largeSMP/contrib/gdb/   (props changed)
  projects/largeSMP/contrib/gdtoa/   (props changed)
  projects/largeSMP/contrib/gnu-sort/   (props changed)
  projects/largeSMP/contrib/groff/   (props changed)
  projects/largeSMP/contrib/less/   (props changed)
  projects/largeSMP/contrib/libpcap/   (props changed)
  projects/largeSMP/contrib/libstdc++/   (props changed)
  projects/largeSMP/contrib/llvm/   (props changed)
  projects/largeSMP/contrib/llvm/tools/clang/   (props changed)
  projects/largeSMP/contrib/ncurses/   (props changed)
  projects/largeSMP/contrib/netcat/   (props changed)
  projects/largeSMP/contrib/ntp/   (props changed)
  projects/largeSMP/contrib/one-true-awk/   (props changed)
  projects/largeSMP/contrib/openbsm/   (props changed)
  projects/largeSMP/contrib/openpam/   (props changed)
  projects/largeSMP/contrib/pf/   (props changed)
  projects/largeSMP/contrib/sendmail/   (props changed)
  projects/largeSMP/contrib/tcpdump/   (props changed)
  projects/largeSMP/contrib/tcsh/   (props changed)
  projects/largeSMP/contrib/tnftp/   (props changed)
  projects/largeSMP/contrib/top/   (props changed)
  projects/largeSMP/contrib/top/install-sh   (props changed)
  projects/largeSMP/contrib/tzcode/stdtime/   (props changed)
  projects/largeSMP/contrib/tzcode/zic/   (props changed)
  projects/largeSMP/contrib/tzdata/   (props changed)
  projects/largeSMP/contrib/wpa/   (props changed)
  projects/largeSMP/contrib/xz/   (props changed)
  projects/largeSMP/crypto/openssh/   (props changed)
  projects/largeSMP/crypto/openssl/   (props changed)
  projects/largeSMP/gnu/lib/   (props changed)
  projects/largeSMP/gnu/usr.bin/binutils/   (props changed)
  projects/largeSMP/gnu/usr.bin/cc/cc_tools/   (props changed)
  projects/largeSMP/gnu/usr.bin/gdb/   (props changed)
  projects/largeSMP/lib/libc/   (props changed)
  projects/largeSMP/lib/libc/stdtime/   (props changed)
  projects/largeSMP/lib/libutil/   (props changed)
  projects/largeSMP/lib/libz/   (props changed)
  projects/largeSMP/sbin/   (props changed)
  projects/largeSMP/sbin/ipfw/   (props changed)
  projects/largeSMP/share/mk/bsd.arch.inc.mk   (props changed)
  projects/largeSMP/share/zoneinfo/   (props changed)
  projects/largeSMP/sys/   (props changed)
  projects/largeSMP/sys/amd64/include/xen/   (props changed)
  projects/largeSMP/sys/boot/   (props changed)
  projects/largeSMP/sys/boot/i386/efi/   (props changed)
  projects/largeSMP/sys/boot/ia64/efi/   (props changed)
  projects/largeSMP/sys/boot/ia64/ski/   (props changed)
  projects/largeSMP/sys/boot/powerpc/boot1.chrp/   (props changed)
  projects/largeSMP/sys/boot/powerpc/ofw/   (props changed)
  projects/largeSMP/sys/cddl/contrib/opensolaris/   (props changed)
  projects/largeSMP/sys/conf/   (props changed)
  projects/largeSMP/sys/contrib/dev/acpica/   (props changed)
  projects/largeSMP/sys/contrib/octeon-sdk/   (props changed)
  projects/largeSMP/sys/contrib/pf/   (props changed)
  projects/largeSMP/sys/contrib/x86emu/   (props changed)
  projects/largeSMP/usr.bin/calendar/   (props changed)
  projects/largeSMP/usr.bin/csup/   (props changed)
  projects/largeSMP/usr.bin/procstat/   (props changed)
  projects/largeSMP/usr.sbin/ndiscvt/   (props changed)
  projects/largeSMP/usr.sbin/zic/   (props changed)

Modified: projects/largeSMP/bin/ps/ps.1
==============================================================================
--- projects/largeSMP/bin/ps/ps.1	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/bin/ps/ps.1	Mon Jul  4 11:13:00 2011	(r223757)
@@ -29,7 +29,7 @@
 .\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd June 14, 2011
+.Dd July 1, 2011
 .Dt PS 1
 .Os
 .Sh NAME
@@ -492,6 +492,8 @@ command
 command and arguments
 .It Cm cpu
 short-term CPU usage factor (for scheduling)
+.It Cm emul
+system-call emulation environment
 .It Cm etime
 elapsed running time, format
 .Op days- Ns
@@ -527,6 +529,8 @@ lock currently blocked on (as a symbolic
 login name of user who started the session
 .It Cm lstart
 time started
+.It Cm lwp
+process thread-id
 .It Cm majflt
 total page faults
 .It Cm minflt
@@ -542,6 +546,8 @@ nice value (alias
 .Cm ni )
 .It Cm nivcsw
 total involuntary context switches
+.It Cm nlwp
+number of threads tied to a process
 .It Cm nsigs
 total signals taken (alias
 .Cm nsignals )
@@ -562,8 +568,6 @@ pageins (same as majflt)
 process group number
 .It Cm pid
 process ID
-.It Cm poip
-pageouts in progress
 .It Cm ppid
 parent process ID
 .It Cm pri
@@ -574,8 +578,6 @@ core residency time (in seconds; 127 = i
 real group ID
 .It Cm rgroup
 group name (from rgid)
-.It Cm rlink
-reverse link on run queue, or 0
 .It Cm rss
 resident set size
 .It Cm rtprio
@@ -630,8 +632,6 @@ text size (in Kbytes)
 control terminal name (two letter abbreviation)
 .It Cm tty
 full name of control terminal
-.It Cm uprocp
-process pointer
 .It Cm ucomm
 name to be used for accounting
 .It Cm uid
@@ -640,6 +640,8 @@ effective user ID (alias
 .It Cm upr
 scheduling priority on return from system call (alias
 .Cm usrpri )
+.It Cm uprocp
+process pointer
 .It Cm user
 user name (from UID)
 .It Cm usertime

Modified: projects/largeSMP/contrib/gcc/c-decl.c
==============================================================================
--- projects/largeSMP/contrib/gcc/c-decl.c	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/contrib/gcc/c-decl.c	Mon Jul  4 11:13:00 2011	(r223757)
@@ -4340,6 +4340,8 @@ grokdeclarator (const struct c_declarato
 			  pedwarn ("ISO C90 forbids variable-size array %qs",
 				   name);
 		      }
+		    if (warn_variable_decl)
+		      warning (0, "variable-sized array %qs", name);
 		  }
 
 		if (integer_zerop (size))

Modified: projects/largeSMP/contrib/gcc/c.opt
==============================================================================
--- projects/largeSMP/contrib/gcc/c.opt	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/contrib/gcc/c.opt	Mon Jul  4 11:13:00 2011	(r223757)
@@ -404,6 +404,10 @@ Wtraditional
 C ObjC Var(warn_traditional)
 Warn about features not present in traditional C
 
+Wtrampolines
+Common Var(warn_trampolines)
+Warn when trampolines are emitted
+
 Wtrigraphs
 C ObjC C++ ObjC++
 Warn if trigraphs are encountered that might affect the meaning of the program

Modified: projects/largeSMP/contrib/gcc/common.opt
==============================================================================
--- projects/largeSMP/contrib/gcc/common.opt	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/contrib/gcc/common.opt	Mon Jul  4 11:13:00 2011	(r223757)
@@ -189,6 +189,10 @@ Wunused-variable
 Common Var(warn_unused_variable)
 Warn when a variable is unused
 
+Wvariable-decl
+Common Var(warn_variable_decl)
+Warn about variable-sized declarations.
+
 Wvolatile-register-var
 Common Var(warn_register_var)
 Warn when a register variable is declared volatile

Modified: projects/largeSMP/contrib/gcc/tree-nested.c
==============================================================================
--- projects/largeSMP/contrib/gcc/tree-nested.c	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/contrib/gcc/tree-nested.c	Mon Jul  4 11:13:00 2011	(r223757)
@@ -750,7 +750,7 @@ check_for_nested_with_variably_modified 
   for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
     {
       for (arg = DECL_ARGUMENTS (cgn->decl); arg; arg = TREE_CHAIN (arg))
-	if (variably_modified_type_p (TREE_TYPE (arg), 0), orig_fndecl)
+	if (variably_modified_type_p (TREE_TYPE (arg), orig_fndecl))
 	  return true;
 
       if (check_for_nested_with_variably_modified (cgn->decl, orig_fndecl))
@@ -1621,6 +1621,10 @@ convert_tramp_reference (tree *tp, int *
 	 it doesn't need a trampoline.  */
       if (DECL_NO_STATIC_CHAIN (decl))
 	break;
+      if (warn_trampolines)
+	{
+	warning(0, "local function address taken needing trampoline generation");
+	}
 
       /* Lookup the immediate parent of the callee, as that's where
 	 we need to insert the trampoline.  */

Modified: projects/largeSMP/contrib/lukemftpd/src/ftpd.c
==============================================================================
--- projects/largeSMP/contrib/lukemftpd/src/ftpd.c	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/contrib/lukemftpd/src/ftpd.c	Mon Jul  4 11:13:00 2011	(r223757)
@@ -1263,8 +1263,9 @@ end_login(void)
 	curclass.type = CLASS_REAL;
 	(void) seteuid((uid_t)0);
 #ifdef	LOGIN_CAP
-	setusercontext(NULL, getpwuid(0), 0,
-		       LOGIN_SETPRIORITY|LOGIN_SETRESOURCES|LOGIN_SETUMASK|LOGIN_SETMAC);
+	setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN |
+		       LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH |
+		       LOGIN_SETENV));
 #endif
 #ifdef USE_PAM
 	if (pamh) {
@@ -1427,9 +1428,8 @@ pass(const char *passwd)
 #endif
 	}
 	setsid();
-	setusercontext(lc, pw, 0,
-		LOGIN_SETLOGIN|LOGIN_SETGROUP|LOGIN_SETPRIORITY|
-		LOGIN_SETRESOURCES|LOGIN_SETUMASK|LOGIN_SETMAC);
+	setusercontext(lc, pw, 0, LOGIN_SETALL &
+		       ~(LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV));
 #else
 	(void) initgroups(pw->pw_name, pw->pw_gid);
 			/* cache groups for cmds.c::matchgroup() */

Modified: projects/largeSMP/contrib/sendmail/src/deliver.c
==============================================================================
--- projects/largeSMP/contrib/sendmail/src/deliver.c	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/contrib/sendmail/src/deliver.c	Mon Jul  4 11:13:00 2011	(r223757)
@@ -2416,6 +2416,12 @@ tryhost:
 				else
 					pwd = sm_getpwnam(contextaddr->q_user);
 				sucflags = LOGIN_SETRESOURCES|LOGIN_SETPRIORITY;
+#ifdef LOGIN_SETCPUMASK
+				sucflags |= LOGIN_SETCPUMASK;
+#endif /* LOGIN_SETCPUMASK */
+#ifdef LOGIN_SETLOGINCLASS
+				sucflags |= LOGIN_SETLOGINCLASS;
+#endif /* LOGIN_SETLOGINCLASS */
 #ifdef LOGIN_SETMAC
 				sucflags |= LOGIN_SETMAC;
 #endif /* LOGIN_SETMAC */

Modified: projects/largeSMP/sbin/ifconfig/Makefile
==============================================================================
--- projects/largeSMP/sbin/ifconfig/Makefile	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/sbin/ifconfig/Makefile	Mon Jul  4 11:13:00 2011	(r223757)
@@ -29,6 +29,7 @@ SRCS+=	af_nd6.c		# ND6 support
 SRCS+=	ifclone.c		# clone device support
 SRCS+=	ifmac.c			# MAC support
 SRCS+=	ifmedia.c		# SIOC[GS]IFMEDIA support
+SRCS+=	iffib.c			# non-default FIB support
 SRCS+=	ifvlan.c		# SIOC[GS]ETVLAN support
 SRCS+=	ifgre.c			# GRE keys etc
 SRCS+=	ifgif.c			# GIF reversed header workaround

Modified: projects/largeSMP/sbin/ifconfig/ifconfig.8
==============================================================================
--- projects/largeSMP/sbin/ifconfig/ifconfig.8	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/sbin/ifconfig/ifconfig.8	Mon Jul  4 11:13:00 2011	(r223757)
@@ -28,7 +28,7 @@
 .\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd May 31, 2011
+.Dd July 3, 2011
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -296,6 +296,19 @@ Remove the interface from the given
 Fill interface index
 (lowermost 64bit of an IPv6 address)
 automatically.
+.It Cm fib Ar fib_number
+Specify interface FIB.
+A FIB
+.Ar fib_number
+is assigned to all frames or packets received on that interface.
+The FIB is not inherited, e.g. vlans or other sub-interfaces will use
+the default FIB (0) irrespective of the parent interface's FIB.
+The kernel needs to be tuned to support more than the default FIB
+using the
+.Va ROUTETABLES
+kernel configuration option, or the
+.Va net.fibs
+tunable.
 .It Cm ipdst
 This is used to specify an Internet host who is willing to receive
 IP packets encapsulating IPX packets bound for a remote network.

Copied: projects/largeSMP/sbin/ifconfig/iffib.c (from r223756, head/sbin/ifconfig/iffib.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/largeSMP/sbin/ifconfig/iffib.c	Mon Jul  4 11:13:00 2011	(r223757, copy of r223756, head/sbin/ifconfig/iffib.c)
@@ -0,0 +1,103 @@
+/*-
+ * Copyright (c) 2011 Alexander V. Chernikov
+ * Copyright (c) 2011 Christian S.J. Peron
+ * Copyright (c) 2011 Bjoern A. Zeeb
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    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 THE AUTHOR AND CONTRIBUTORS ``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 THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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$
+ */
+
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+
+#include <net/if.h>
+#include <net/route.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <err.h>
+
+#include "ifconfig.h"
+
+static void
+fib_status(int s)
+{
+	struct ifreq ifr;
+
+	memset(&ifr, 0, sizeof(ifr));
+	strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+
+	if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) < 0)
+		return;
+
+	/* Ignore if it is the default. */
+	if (ifr.ifr_fib == 0)
+		return;
+
+	printf("\tfib: %u\n", ifr.ifr_fib);
+}
+
+static void
+setiffib(const char *val, int dummy __unused, int s,
+    const struct afswtch *afp)
+{
+	unsigned long fib;
+	char *ep;
+
+	fib = strtoul(val, &ep, 0);
+	if (*ep != '\0' || fib > UINT_MAX) {
+		warn("fib %s not valid", val);
+		return;
+	}
+
+	strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
+	ifr.ifr_fib = fib;
+	if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0)
+		warn("ioctl (SIOCSIFFIB)");
+}
+
+static struct cmd fib_cmds[] = {
+	DEF_CMD_ARG("fib", setiffib),
+};
+
+static struct afswtch af_fib = {
+	.af_name	= "af_fib",
+	.af_af		= AF_UNSPEC,
+	.af_other_status = fib_status,
+};
+
+static __constructor void
+fib_ctor(void)
+{
+#define	N(a)	(sizeof(a) / sizeof(a[0]))
+	size_t i;
+
+	for (i = 0; i < N(fib_cmds);  i++)
+		cmd_register(&fib_cmds[i]);
+	af_register(&af_fib);
+#undef N
+}

Modified: projects/largeSMP/sbin/natd/natd.8
==============================================================================
--- projects/largeSMP/sbin/natd/natd.8	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/sbin/natd/natd.8	Mon Jul  4 11:13:00 2011	(r223757)
@@ -473,7 +473,7 @@ This option is intended to be used with 
 packets received on this port are checked against
 internal translation tables of every configured instance.
 If an entry is found, packet is aliased according to that entry.
-In no entry was found in any of the instances, packet is passed
+If no entry was found in any of the instances, packet is passed
 unchanged, and no new entry will be created.
 See the section
 .Sx MULTIPLE INSTANCES

Modified: projects/largeSMP/share/man/man9/ifnet.9
==============================================================================
--- projects/largeSMP/share/man/man9/ifnet.9	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/share/man/man9/ifnet.9	Mon Jul  4 11:13:00 2011	(r223757)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 1, 2009
+.Dd July 3, 2011
 .Dt IFNET 9
 .Os
 .Sh NAME
@@ -1169,11 +1169,12 @@ list.
 Caller must have appropriate privilege.
 (No call-down to driver.)
 .It Dv SIOCGIFCAP
+.It Dv SIOCGIFFIB
 .It Dv SIOCGIFFLAGS
 .It Dv SIOCGIFMETRIC
 .It Dv SIOCGIFMTU
 .It Dv SIOCGIFPHYS
-Get interface capabilities, flags, metric, MTU, medium selection.
+Get interface capabilities, FIB, flags, metric, MTU, medium selection.
 (No call-down to driver.)
 .Pp
 .It Dv SIOCSIFCAP
@@ -1192,6 +1193,12 @@ and
 .Va if_data.ifi_hwassist
 appropriately.
 .Pp
+.It Dv SIOCSIFFIB
+Sets interface FIB.
+Caller must have appropriate privilege.
+FIB values start at 0 and values greater or equals than
+.Va net.fibs
+are considered invalid.
 .It Dv SIOCSIFFLAGS
 Change interface flags.
 Caller must have appropriate privilege.

Modified: projects/largeSMP/sys/amd64/amd64/pmap.c
==============================================================================
--- projects/largeSMP/sys/amd64/amd64/pmap.c	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/sys/amd64/amd64/pmap.c	Mon Jul  4 11:13:00 2011	(r223757)
@@ -2104,7 +2104,7 @@ pmap_collect(pmap_t locked_pmap, struct 
 	vm_page_t m, free;
 
 	TAILQ_FOREACH(m, &vpq->pl, pageq) {
-		if (m->hold_count || m->busy)
+		if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy)
 			continue;
 		TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) {
 			va = pv->pv_va;

Modified: projects/largeSMP/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- projects/largeSMP/sys/amd64/amd64/sys_machdep.c	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/sys/amd64/amd64/sys_machdep.c	Mon Jul  4 11:13:00 2011	(r223757)
@@ -182,26 +182,28 @@ sysarch(td, uap)
 
 #ifdef CAPABILITY_MODE
 	/*
-	 * Whitelist of operations which are safe enough for capability mode.
+	 * When adding new operations, add a new case statement here to
+	 * explicitly indicate whether or not the operation is safe to
+	 * perform in capability mode.
 	 */
 	if (IN_CAPABILITY_MODE(td)) {
 		switch (uap->op) {
-			case I386_GET_LDT:
-			case I386_SET_LDT:
-			case I386_GET_IOPERM:
-			case I386_GET_FSBASE:
-			case I386_SET_FSBASE:
-			case I386_GET_GSBASE:
-			case I386_SET_GSBASE:
-			case AMD64_GET_FSBASE:
-			case AMD64_SET_FSBASE:
-			case AMD64_GET_GSBASE:
-			case AMD64_SET_GSBASE:
-				break;
+		case I386_GET_LDT:
+		case I386_SET_LDT:
+		case I386_GET_IOPERM:
+		case I386_GET_FSBASE:
+		case I386_SET_FSBASE:
+		case I386_GET_GSBASE:
+		case I386_SET_GSBASE:
+		case AMD64_GET_FSBASE:
+		case AMD64_SET_FSBASE:
+		case AMD64_GET_GSBASE:
+		case AMD64_SET_GSBASE:
+			break;
 
-			case I386_SET_IOPERM:
-			default:
-				return (ECAPMODE);
+		case I386_SET_IOPERM:
+		default:
+			return (ECAPMODE);
 		}
 	}
 #endif

Modified: projects/largeSMP/sys/arm/arm/sys_machdep.c
==============================================================================
--- projects/largeSMP/sys/arm/arm/sys_machdep.c	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/sys/arm/arm/sys_machdep.c	Mon Jul  4 11:13:00 2011	(r223757)
@@ -109,18 +109,20 @@ sysarch(td, uap)
 
 #ifdef CAPABILITY_MODE
 	/*
-	 * Whitelist of operations which are safe enough for capability mode.
+	 * When adding new operations, add a new case statement here to
+	 * explicitly indicate whether or not the operation is safe to
+	 * perform in capability mode.
 	 */
 	if (IN_CAPABILITY_MODE(td)) {
 		switch (uap->op) {
-			case ARM_SYNC_ICACHE:
-			case ARM_DRAIN_WRITEBUF:
-			case ARM_SET_TP:
-			case ARM_GET_TP:
-				break;
+		case ARM_SYNC_ICACHE:
+		case ARM_DRAIN_WRITEBUF:
+		case ARM_SET_TP:
+		case ARM_GET_TP:
+			break;
 
-			default:
-				return (ECAPMODE);
+		default:
+			return (ECAPMODE);
 		}
 	}
 #endif

Modified: projects/largeSMP/sys/boot/Makefile.amd64
==============================================================================
--- projects/largeSMP/sys/boot/Makefile.amd64	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/sys/boot/Makefile.amd64	Mon Jul  4 11:13:00 2011	(r223757)
@@ -2,3 +2,4 @@
 
 SUBDIR+=		efi
 SUBDIR+=		zfs
+SUBDIR+=		userboot

Modified: projects/largeSMP/sys/boot/common/Makefile.inc
==============================================================================
--- projects/largeSMP/sys/boot/common/Makefile.inc	Mon Jul  4 10:45:54 2011	(r223756)
+++ projects/largeSMP/sys/boot/common/Makefile.inc	Mon Jul  4 11:13:00 2011	(r223757)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-SRCS+=	boot.c commands.c console.c devopen.c interp.c 
+SRCS+=	boot.c commands.c console.c devopen.c disk.c interp.c 
 SRCS+=	interp_backslash.c interp_parse.c ls.c misc.c 
 SRCS+=	module.c panic.c
 

Copied: projects/largeSMP/sys/boot/common/disk.c (from r223756, head/sys/boot/common/disk.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/largeSMP/sys/boot/common/disk.c	Mon Jul  4 11:13:00 2011	(r223757, copy of r223756, head/sys/boot/common/disk.c)
@@ -0,0 +1,799 @@
+/*-
+ * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    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 THE AUTHOR AND CONTRIBUTORS ``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 THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * MBR/GPT partitioned disk device handling.
+ *
+ * Ideas and algorithms from:
+ *
+ * - NetBSD libi386/biosdisk.c
+ * - FreeBSD biosboot/disk.c
+ *
+ */
+
+#include <stand.h>
+
+#include <sys/diskmbr.h>
+#include <sys/disklabel.h>
+#include <sys/gpt.h>
+
+#include <stdarg.h>
+#include <uuid.h>
+
+#include <bootstrap.h>
+
+#include "disk.h"
+
+#ifdef DISK_DEBUG
+# define DEBUG(fmt, args...)	printf("%s: " fmt "\n" , __func__ , ## args)
+#else
+# define DEBUG(fmt, args...)
+#endif
+
+/*
+ * Search for a slice with the following preferences:
+ *
+ * 1: Active FreeBSD slice
+ * 2: Non-active FreeBSD slice
+ * 3: Active Linux slice
+ * 4: non-active Linux slice
+ * 5: Active FAT/FAT32 slice
+ * 6: non-active FAT/FAT32 slice
+ */
+#define PREF_RAWDISK	0
+#define PREF_FBSD_ACT	1
+#define PREF_FBSD	2
+#define PREF_LINUX_ACT	3
+#define PREF_LINUX	4
+#define PREF_DOS_ACT	5
+#define PREF_DOS	6
+#define PREF_NONE	7
+
+#ifdef LOADER_GPT_SUPPORT
+
+struct gpt_part {
+	int		gp_index;
+	uuid_t		gp_type;
+	uint64_t	gp_start;
+	uint64_t	gp_end;
+};
+
+static uuid_t efi = GPT_ENT_TYPE_EFI;
+static uuid_t freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT;
+static uuid_t freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
+static uuid_t freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP;
+static uuid_t freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
+static uuid_t ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA;
+
+#endif
+
+#if defined(LOADER_GPT_SUPPORT) || defined(LOADER_MBR_SUPPORT)
+
+/* Given a size in 512 byte sectors, convert it to a human-readable number. */
+static char *
+display_size(uint64_t size)
+{
+	static char buf[80];
+	char unit;
+
+	size /= 2;
+	unit = 'K';
+	if (size >= 10485760000LL) {
+		size /= 1073741824;
+		unit = 'T';
+	} else if (size >= 10240000) {
+		size /= 1048576;
+		unit = 'G';
+	} else if (size >= 10000) {
+		size /= 1024;
+		unit = 'M';
+	}
+	sprintf(buf, "%.6ld%cB", (long)size, unit);
+	return (buf);
+}
+
+#endif
+
+#ifdef LOADER_MBR_SUPPORT
+
+static void
+disk_checkextended(struct disk_devdesc *dev,
+    struct dos_partition *slicetab, int slicenum, int *nslicesp)
+{
+	uint8_t			buf[DISK_SECSIZE];
+	struct dos_partition	*dp;
+	uint32_t		base;
+	int			rc, i, start, end;
+
+	dp = &slicetab[slicenum];
+	start = *nslicesp;
+
+	if (dp->dp_size == 0)
+		goto done;
+	if (dp->dp_typ != DOSPTYP_EXT)
+		goto done;
+	rc = dev->d_dev->dv_strategy(dev, F_READ, dp->dp_start, DISK_SECSIZE,
+		(char *) buf, NULL);
+	if (rc)
+		goto done;
+	if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) {
+		DEBUG("no magic in extended table");
+		goto done;
+	}
+	base = dp->dp_start;
+	dp = (struct dos_partition *) &buf[DOSPARTOFF];
+	for (i = 0; i < NDOSPART; i++, dp++) {
+		if (dp->dp_size == 0)
+			continue;
+		if (*nslicesp == NEXTDOSPART)
+			goto done;
+		dp->dp_start += base;
+		bcopy(dp, &slicetab[*nslicesp], sizeof(*dp));
+		(*nslicesp)++;
+	}
+	end = *nslicesp;
+
+	/*
+	 * now, recursively check the slices we just added
+	 */
+	for (i = start; i < end; i++)
+		disk_checkextended(dev, slicetab, i, nslicesp);
+done:
+	return;
+}
+
+static int
+disk_readslicetab(struct disk_devdesc *dev,
+    struct dos_partition **slicetabp, int *nslicesp)
+{
+	struct dos_partition	*slicetab = NULL;
+	int			nslices, i;
+	int			rc;
+	uint8_t			buf[DISK_SECSIZE];
+
+	/*
+	 * Find the slice in the DOS slice table.
+	 */
+	rc = dev->d_dev->dv_strategy(dev, F_READ, 0, DISK_SECSIZE,
+		(char *) buf, NULL);
+	if (rc) {
+		DEBUG("error reading MBR");
+		return (rc);
+	}
+
+	/*
+	 * Check the slice table magic.
+	 */
+	if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) {
+		DEBUG("no slice table/MBR (no magic)");
+		return (rc);
+	}
+
+	/*
+	 * copy the partition table, then pick up any extended partitions.
+	 */
+	slicetab = malloc(NEXTDOSPART * sizeof(struct dos_partition));
+	bcopy(buf + DOSPARTOFF, slicetab,
+		sizeof(struct dos_partition) * NDOSPART);
+	nslices = NDOSPART;		/* extended slices start here */
+	for (i = 0; i < NDOSPART; i++)
+		disk_checkextended(dev, slicetab, i, &nslices);
+
+	*slicetabp = slicetab;
+	*nslicesp = nslices;
+	return (0);
+}
+
+/*
+ * Search for the best MBR slice (typically the first FreeBSD slice).
+ */
+static int
+disk_bestslice(struct dos_partition *slicetab, int nslices)
+{
+	struct dos_partition *dp;
+	int pref, preflevel;
+	int i, prefslice;
+
+	prefslice = 0;
+	preflevel = PREF_NONE;
+
+	dp = &slicetab[0];
+	for (i = 0; i < nslices; i++, dp++) {
+		switch (dp->dp_typ) {
+		case DOSPTYP_386BSD:		/* FreeBSD */
+			pref = dp->dp_flag & 0x80 ? PREF_FBSD_ACT : PREF_FBSD;
+			break;
+
+		case DOSPTYP_LINUX:
+			pref = dp->dp_flag & 0x80 ? PREF_LINUX_ACT : PREF_LINUX;
+			break;
+
+		case 0x01:		/* DOS/Windows */
+		case 0x04:
+		case 0x06:
+		case 0x0b:
+		case 0x0c:
+		case 0x0e:
+			pref = dp->dp_flag & 0x80 ? PREF_DOS_ACT : PREF_DOS;
+			break;
+
+		default:
+		        pref = PREF_NONE;
+		}
+		if (pref < preflevel) {
+			preflevel = pref;
+			prefslice = i + 1;
+		}
+	}
+	return (prefslice);
+}
+
+static int
+disk_openmbr(struct disk_devdesc *dev)
+{
+	struct dos_partition	*slicetab = NULL, *dptr;
+	int			nslices, sector, slice;
+	int			rc;
+	uint8_t			buf[DISK_SECSIZE];
+	struct disklabel	*lp;
+
+	/*
+	 * Following calculations attempt to determine the correct value
+	 * for dev->d_offset by looking for the slice and partition specified,
+	 * or searching for reasonable defaults.
+	 */
+	rc = disk_readslicetab(dev, &slicetab, &nslices);
+	if (rc)
+		return (rc);
+
+	/*
+	 * if a slice number was supplied but not found, this is an error.
+	 */
+	if (dev->d_slice > 0) {
+		slice = dev->d_slice - 1;
+		if (slice >= nslices) {
+			DEBUG("slice %d not found", slice);
+			rc = EPART;
+			goto out;
+		}
+	}
+
+	/*
+	 * Check for the historically bogus MBR found on true dedicated disks
+	 */
+	if (slicetab[3].dp_typ == DOSPTYP_386BSD &&
+	    slicetab[3].dp_start == 0 && slicetab[3].dp_size == 50000) {
+		sector = 0;
+		goto unsliced;
+	}
+
+	/*
+	 * Try to auto-detect the best slice; this should always give
+	 * a slice number
+	 */
+	if (dev->d_slice == 0) {
+		slice = disk_bestslice(slicetab, nslices);
+		if (slice == -1) {
+			rc = ENOENT;
+			goto out;
+		}
+		dev->d_slice = slice;
+	}
+
+	/*
+	 * Accept the supplied slice number unequivocally (we may be looking
+	 * at a DOS partition).
+	 * Note: we number 1-4, offsets are 0-3
+	 */
+	dptr = &slicetab[dev->d_slice - 1];
+	sector = dptr->dp_start;
+	DEBUG("slice entry %d at %d, %d sectors",
+		dev->d_slice - 1, sector, dptr->dp_size);
+
+unsliced:
+	/*
+	 * Now we have the slice offset, look for the partition in the
+	 * disklabel if we have a partition to start with.
+	 *
+	 * XXX we might want to check the label checksum.
+	 */
+	if (dev->d_partition < 0) {
+		/* no partition, must be after the slice */
+		DEBUG("opening raw slice");
+		dev->d_offset = sector;
+		rc = 0;
+		goto out;
+	}
+
+	rc = dev->d_dev->dv_strategy(dev, F_READ, sector + LABELSECTOR,
+            DISK_SECSIZE, (char *) buf, NULL);
+	if (rc) {
+		DEBUG("error reading disklabel");
+		goto out;
+	}
+
+	lp = (struct disklabel *) buf;
+
+	if (lp->d_magic != DISKMAGIC) {
+		DEBUG("no disklabel");
+		rc = ENOENT;
+		goto out;
+	}
+	if (dev->d_partition >= lp->d_npartitions) {
+		DEBUG("partition '%c' exceeds partitions in table (a-'%c')",
+		  'a' + dev->d_partition,
+		  'a' + lp->d_npartitions);
+		rc = EPART;
+		goto out;
+	}
+
+	dev->d_offset =
+		lp->d_partitions[dev->d_partition].p_offset -
+		lp->d_partitions[RAW_PART].p_offset +
+		sector;
+	rc = 0;
+
+out:
+	if (slicetab)
+		free(slicetab);
+	return (rc);
+}
+
+/*
+ * Print out each valid partition in the disklabel of a FreeBSD slice.
+ * For size calculations, we assume a 512 byte sector size.
+ */
+static void
+disk_printbsdslice(struct disk_devdesc *dev, daddr_t offset,
+    char *prefix, int verbose)
+{
+	char			line[80];
+	char			buf[DISK_SECSIZE];
+	struct disklabel	*lp;
+	int			i, rc, fstype;
+
+	/* read disklabel */
+	rc = dev->d_dev->dv_strategy(dev, F_READ, offset + LABELSECTOR,
+		DISK_SECSIZE, (char *) buf, NULL);
+	if (rc)
+		return;
+	lp =(struct disklabel *)(&buf[0]);
+	if (lp->d_magic != DISKMAGIC) {
+		sprintf(line, "%s: FFS  bad disklabel\n", prefix);
+		pager_output(line);
+		return;
+	}
+
+	/* Print partitions */
+	for (i = 0; i < lp->d_npartitions; i++) {
+		/*
+		 * For each partition, make sure we know what type of fs it
+		 * is.  If not, then skip it.
+		 */
+		fstype = lp->d_partitions[i].p_fstype;
+		if (fstype != FS_BSDFFS &&
+		    fstype != FS_SWAP &&
+		    fstype != FS_VINUM)
+			continue;
+
+		/* Only print out statistics in verbose mode */
+		if (verbose)
+			sprintf(line, "  %s%c: %s %s (%d - %d)\n",
+				prefix, 'a' + i,
+			    (fstype == FS_SWAP) ? "swap " :
+			    (fstype == FS_VINUM) ? "vinum" :
+			    "FFS  ",
+			    display_size(lp->d_partitions[i].p_size),
+			    lp->d_partitions[i].p_offset,
+			    (lp->d_partitions[i].p_offset
+			     + lp->d_partitions[i].p_size));
+		else
+			sprintf(line, "  %s%c: %s\n", prefix, 'a' + i,
+			    (fstype == FS_SWAP) ? "swap" :
+			    (fstype == FS_VINUM) ? "vinum" :
+			    "FFS");
+		pager_output(line);
+	}
+}
+
+static void
+disk_printslice(struct disk_devdesc *dev, int slice,
+    struct dos_partition *dp, char *prefix, int verbose)
+{
+	char stats[80];
+	char line[80];
+
+	if (verbose)
+		sprintf(stats, " %s (%d - %d)", display_size(dp->dp_size),
+		    dp->dp_start, dp->dp_start + dp->dp_size);
+	else
+		stats[0] = '\0';
+
+	switch (dp->dp_typ) {
+	case DOSPTYP_386BSD:
+		disk_printbsdslice(dev, (daddr_t)dp->dp_start,
+		     prefix, verbose);
+		return;
+	case DOSPTYP_LINSWP:
+		sprintf(line, "%s: Linux swap%s\n", prefix, stats);
+		break;
+	case DOSPTYP_LINUX:
+		/*
+		 * XXX
+		 * read the superblock to confirm this is an ext2fs partition?
+		 */
+		sprintf(line, "%s: ext2fs%s\n", prefix, stats);
+		break;
+	case 0x00:				/* unused partition */
+	case DOSPTYP_EXT:
+		return;
+	case 0x01:
+		sprintf(line, "%s: FAT-12%s\n", prefix, stats);
+		break;
+	case 0x04:
+	case 0x06:
+	case 0x0e:
+		sprintf(line, "%s: FAT-16%s\n", prefix, stats);
+		break;
+	case 0x07:
+		sprintf(line, "%s: NTFS/HPFS%s\n", prefix, stats);
+		break;
+	case 0x0b:
+	case 0x0c:
+		sprintf(line, "%s: FAT-32%s\n", prefix, stats);
+		break;
+	default:
+		sprintf(line, "%s: Unknown fs: 0x%x %s\n", prefix, dp->dp_typ,
+		    stats);
+	}
+	pager_output(line);
+}
+
+static int
+disk_printmbr(struct disk_devdesc *dev, char *prefix, int verbose)
+{
+	struct dos_partition	*slicetab;
+	int			nslices, i;
+	int			rc;
+	char			line[80];
+
+	rc = disk_readslicetab(dev, &slicetab, &nslices);
+	if (rc)
+		return (rc);
+	for (i = 0; i < nslices; i++) {
+		sprintf(line, "%ss%d", prefix, i + 1);
+		disk_printslice(dev, i, &slicetab[i], line, verbose);
+	}
+	free(slicetab);
+	return (0);
+}
+
+#endif
+
+#ifdef LOADER_GPT_SUPPORT
+
+static int
+disk_readgpt(struct disk_devdesc *dev, struct gpt_part **gptp, int *ngptp)
+{
+	struct dos_partition	*dp;
+	struct gpt_hdr		*hdr;
+	struct gpt_ent		*ent;
+	struct gpt_part		*gptab = NULL;
+	int			entries_per_sec, rc, i, part;
+	daddr_t			lba, elba;
+	uint8_t			gpt[DISK_SECSIZE], tbl[DISK_SECSIZE];
+
+	/*
+	 * Following calculations attempt to determine the correct value
+	 * for dev->d_offset by looking for the slice and partition specified,
+	 * or searching for reasonable defaults.
+	 */
+	rc = 0;
+
+	/* First, read the MBR and see if we have a PMBR. */
+	rc = dev->d_dev->dv_strategy(dev, F_READ, 0, DISK_SECSIZE,
+		(char *) tbl, NULL);

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



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