Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Feb 2015 00:06:26 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r279260 - in projects/sendfile: contrib/groff/tmac etc lib lib/libmt lib/msun/src release release/tools rescue/rescue share/man/man4 share/mk sys/amd64/vmm/intel sys/arm/arm sys/boot/i3...
Message-ID:  <201502250006.t1P06QA2023041@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Feb 25 00:06:25 2015
New Revision: 279260
URL: https://svnweb.freebsd.org/changeset/base/279260

Log:
  Merge head r261119 through r279258.

Added:
  projects/sendfile/lib/libmt/
     - copied from r279258, head/lib/libmt/
  projects/sendfile/release/tools/gce-package.sh
     - copied unchanged from r279258, head/release/tools/gce-package.sh
  projects/sendfile/sys/dev/netmap/if_ixl_netmap.h
     - copied unchanged from r279258, head/sys/dev/netmap/if_ixl_netmap.h
Modified:
  projects/sendfile/contrib/groff/tmac/doc-syms
  projects/sendfile/etc/Makefile
  projects/sendfile/lib/Makefile
  projects/sendfile/lib/msun/src/e_j0.c
  projects/sendfile/lib/msun/src/e_j0f.c
  projects/sendfile/lib/msun/src/e_j1.c
  projects/sendfile/lib/msun/src/e_j1f.c
  projects/sendfile/release/Makefile
  projects/sendfile/release/Makefile.vm
  projects/sendfile/rescue/rescue/Makefile
  projects/sendfile/share/man/man4/mtio.4
  projects/sendfile/share/man/man4/sa.4
  projects/sendfile/share/mk/bsd.libnames.mk
  projects/sendfile/share/mk/src.sys.mk
  projects/sendfile/sys/amd64/vmm/intel/vmcs.c
  projects/sendfile/sys/amd64/vmm/intel/vmx.c
  projects/sendfile/sys/amd64/vmm/intel/vmx.h
  projects/sendfile/sys/amd64/vmm/intel/vmx_msr.c
  projects/sendfile/sys/arm/arm/cpufunc_asm_armv7.S
  projects/sendfile/sys/arm/arm/gic.c
  projects/sendfile/sys/boot/i386/libi386/biosmem.c
  projects/sendfile/sys/cam/scsi/scsi_all.c
  projects/sendfile/sys/cam/scsi/scsi_all.h
  projects/sendfile/sys/cam/scsi/scsi_sa.c
  projects/sendfile/sys/cam/scsi/scsi_sa.h
  projects/sendfile/sys/dev/bce/if_bcereg.h
  projects/sendfile/sys/dev/cxgbe/adapter.h
  projects/sendfile/sys/dev/cxgbe/t4_netmap.c
  projects/sendfile/sys/dev/cxgbe/t4_sge.c
  projects/sendfile/sys/dev/e1000/if_igb.c
  projects/sendfile/sys/dev/ixgbe/ixgbe.c
  projects/sendfile/sys/dev/ixl/if_ixl.c
  projects/sendfile/sys/dev/ixl/if_ixlv.c
  projects/sendfile/sys/dev/ixl/ixl_txrx.c
  projects/sendfile/sys/dev/mps/mpi/mpi2.h
  projects/sendfile/sys/dev/mps/mpi/mpi2_cnfg.h
  projects/sendfile/sys/dev/mps/mpi/mpi2_hbd.h
  projects/sendfile/sys/dev/mps/mpi/mpi2_history.txt
  projects/sendfile/sys/dev/mps/mpi/mpi2_init.h
  projects/sendfile/sys/dev/mps/mpi/mpi2_ioc.h
  projects/sendfile/sys/dev/mps/mpi/mpi2_ra.h
  projects/sendfile/sys/dev/mps/mpi/mpi2_raid.h
  projects/sendfile/sys/dev/mps/mpi/mpi2_sas.h
  projects/sendfile/sys/dev/mps/mpi/mpi2_targ.h
  projects/sendfile/sys/dev/mps/mpi/mpi2_tool.h
  projects/sendfile/sys/dev/mps/mpi/mpi2_type.h
  projects/sendfile/sys/dev/mps/mps.c
  projects/sendfile/sys/dev/mps/mps_config.c
  projects/sendfile/sys/dev/mps/mps_ioctl.h
  projects/sendfile/sys/dev/mps/mps_mapping.c
  projects/sendfile/sys/dev/mps/mps_mapping.h
  projects/sendfile/sys/dev/mps/mps_pci.c
  projects/sendfile/sys/dev/mps/mps_sas.c
  projects/sendfile/sys/dev/mps/mps_sas.h
  projects/sendfile/sys/dev/mps/mps_sas_lsi.c
  projects/sendfile/sys/dev/mps/mps_user.c
  projects/sendfile/sys/dev/mps/mpsvar.h
  projects/sendfile/sys/dev/sfxge/sfxge_dma.c
  projects/sendfile/sys/dev/sfxge/sfxge_tx.c
  projects/sendfile/sys/dev/sfxge/sfxge_tx.h
  projects/sendfile/sys/dev/uart/uart_dev_pl011.c
  projects/sendfile/sys/dev/usb/controller/xhci.c
  projects/sendfile/sys/kern/kern_sig.c
  projects/sendfile/sys/netinet/ip.h
  projects/sendfile/sys/netipsec/ipsec.h
  projects/sendfile/sys/netipsec/key.c
  projects/sendfile/sys/powerpc/aim/mmu_oea64.c
  projects/sendfile/sys/powerpc/aim/mmu_oea64.h
  projects/sendfile/sys/powerpc/aim/moea64_if.m
  projects/sendfile/sys/powerpc/aim/moea64_native.c
  projects/sendfile/sys/powerpc/include/pmap.h
  projects/sendfile/sys/powerpc/ps3/mmu_ps3.c
  projects/sendfile/sys/powerpc/pseries/mmu_phyp.c
  projects/sendfile/sys/powerpc/pseries/phyp_vscsi.c
  projects/sendfile/sys/sys/mtio.h
  projects/sendfile/sys/sys/param.h
  projects/sendfile/sys/sys/queue.h
  projects/sendfile/usr.bin/mt/Makefile
  projects/sendfile/usr.bin/mt/mt.1
  projects/sendfile/usr.bin/mt/mt.c
  projects/sendfile/usr.sbin/bhyve/bhyve.8
  projects/sendfile/usr.sbin/bhyve/bhyverun.c
  projects/sendfile/usr.sbin/bhyve/pci_ahci.c
  projects/sendfile/usr.sbin/bhyve/rtc.c
  projects/sendfile/usr.sbin/bhyve/rtc.h
  projects/sendfile/usr.sbin/bhyve/xmsr.c
  projects/sendfile/usr.sbin/pw/tests/pw_useradd.sh
Directory Properties:
  projects/sendfile/   (props changed)
  projects/sendfile/contrib/groff/   (props changed)
  projects/sendfile/etc/   (props changed)
  projects/sendfile/share/   (props changed)
  projects/sendfile/share/man/man4/   (props changed)
  projects/sendfile/sys/   (props changed)
  projects/sendfile/sys/amd64/vmm/   (props changed)
  projects/sendfile/sys/boot/   (props changed)
  projects/sendfile/usr.sbin/bhyve/   (props changed)

Modified: projects/sendfile/contrib/groff/tmac/doc-syms
==============================================================================
--- projects/sendfile/contrib/groff/tmac/doc-syms	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/contrib/groff/tmac/doc-syms	Wed Feb 25 00:06:25 2015	(r279260)
@@ -796,6 +796,7 @@
 .ds doc-str-Lb-libmd       Message Digest (MD4, MD5, etc.) Support Library (libmd, \-lmd)
 .ds doc-str-Lb-libmemstat  Kernel Memory Allocator Statistics Library (libmemstat, \-lmemstat)
 .ds doc-str-Lb-libmenu     Curses Menu Library (libmenu, \-lmenu)
+.ds doc-str-Lb-libmt       Magnetic Tape Library (libmt, \-lmt)
 .ds doc-str-Lb-libnetgraph Netgraph User Library (libnetgraph, \-lnetgraph)
 .ds doc-str-Lb-libnetpgp   Netpgp signing, verification, encryption and decryption (libnetpgp, \-lnetpgp)
 .ds doc-str-Lb-libossaudio OSS Audio Emulation Library (libossaudio, \-lossaudio)

Modified: projects/sendfile/etc/Makefile
==============================================================================
--- projects/sendfile/etc/Makefile	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/etc/Makefile	Wed Feb 25 00:06:25 2015	(r279260)
@@ -158,16 +158,13 @@ BIN1+= regdomain.xml
 # -rwxr-xr-x root:wheel, for the new cron root:wheel
 BIN2=	netstart pccard_ether rc.suspend rc.resume
 
-MTREE=	BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
+MTREE=	BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
 .if ${MK_TESTS} != "no"
 MTREE+=	BSD.tests.dist
 .endif
 .if ${MK_SENDMAIL} != "no"
 MTREE+=	BSD.sendmail.dist
 .endif
-.if ${MK_DEBUG_FILES} != "no"
-MTREE+=	BSD.debug.dist
-.endif
 
 PPPCNF=	ppp.conf
 
@@ -346,10 +343,8 @@ MTREE_CMD?=	mtree
 MTREES=		mtree/BSD.root.dist		/		\
 		mtree/BSD.var.dist		/var		\
 		mtree/BSD.usr.dist		/usr		\
-		mtree/BSD.include.dist		/usr/include
-.if ${MK_DEBUG_FILES} != "no"
-MTREES+=	mtree/BSD.debug.dist		/usr/lib
-.endif
+		mtree/BSD.include.dist		/usr/include	\
+		mtree/BSD.debug.dist		/usr/lib
 .if ${MK_GROFF} != "no"
 MTREES+=	mtree/BSD.groff.dist		/usr
 .endif

Modified: projects/sendfile/lib/Makefile
==============================================================================
--- projects/sendfile/lib/Makefile	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/lib/Makefile	Wed Feb 25 00:06:25 2015	(r279260)
@@ -70,6 +70,7 @@ SUBDIR=	${SUBDIR_ORDERED} \
 	libmd \
 	${_libmilter} \
 	${_libmp} \
+	libmt \
 	${_libnandfs} \
 	libnetbsd \
 	${_libnetgraph} \

Modified: projects/sendfile/lib/msun/src/e_j0.c
==============================================================================
--- projects/sendfile/lib/msun/src/e_j0.c	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/lib/msun/src/e_j0.c	Wed Feb 25 00:06:25 2015	(r279260)
@@ -373,7 +373,7 @@ static const double qS2[6] = {
 	if(ix>=0x40200000)     {p = qR8; q= qS8;}
 	else if(ix>=0x40122E8B){p = qR5; q= qS5;}
 	else if(ix>=0x4006DB6D){p = qR3; q= qS3;}
-	else if(ix>=0x40000000){p = qR2; q= qS2;}
+	else                   {p = qR2; q= qS2;}	/* ix>=0x40000000 */
 	z = one/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
 	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));

Modified: projects/sendfile/lib/msun/src/e_j0f.c
==============================================================================
--- projects/sendfile/lib/msun/src/e_j0f.c	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/lib/msun/src/e_j0f.c	Wed Feb 25 00:06:25 2015	(r279260)
@@ -329,7 +329,7 @@ static const float qS2[6] = {
 	if(ix>=0x41000000)     {p = qR8; q= qS8;}
 	else if(ix>=0x40f71c58){p = qR5; q= qS5;}
 	else if(ix>=0x4036db68){p = qR3; q= qS3;}
-	else if(ix>=0x40000000){p = qR2; q= qS2;}
+	else                   {p = qR2; q= qS2;}	/* ix>=0x40000000 */
 	z = one/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
 	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));

Modified: projects/sendfile/lib/msun/src/e_j1.c
==============================================================================
--- projects/sendfile/lib/msun/src/e_j1.c	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/lib/msun/src/e_j1.c	Wed Feb 25 00:06:25 2015	(r279260)
@@ -368,7 +368,7 @@ static const double qs2[6] = {
 	if(ix>=0x40200000)     {p = qr8; q= qs8;}
 	else if(ix>=0x40122E8B){p = qr5; q= qs5;}
 	else if(ix>=0x4006DB6D){p = qr3; q= qs3;}
-	else if(ix>=0x40000000){p = qr2; q= qs2;}
+	else                   {p = qr2; q= qs2;}	/* ix>=0x40000000 */
 	z = one/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
 	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));

Modified: projects/sendfile/lib/msun/src/e_j1f.c
==============================================================================
--- projects/sendfile/lib/msun/src/e_j1f.c	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/lib/msun/src/e_j1f.c	Wed Feb 25 00:06:25 2015	(r279260)
@@ -325,7 +325,7 @@ static const float qs2[6] = {
 	if(ix>=0x40200000)     {p = qr8; q= qs8;}
 	else if(ix>=0x40f71c58){p = qr5; q= qs5;}
 	else if(ix>=0x4036db68){p = qr3; q= qs3;}
-	else if(ix>=0x40000000){p = qr2; q= qs2;}
+	else                   {p = qr2; q= qs2;}	/* ix>=0x40000000 */
 	z = one/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
 	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));

Modified: projects/sendfile/release/Makefile
==============================================================================
--- projects/sendfile/release/Makefile	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/release/Makefile	Wed Feb 25 00:06:25 2015	(r279260)
@@ -286,7 +286,7 @@ real-release:
 	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj
 	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS}
 
-install:	release-install vm-install
+install:	release-install vm-install cloudware-install
 
 release-install:
 .if defined(DESTDIR) && !empty(DESTDIR)

Modified: projects/sendfile/release/Makefile.vm
==============================================================================
--- projects/sendfile/release/Makefile.vm	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/release/Makefile.vm	Wed Feb 25 00:06:25 2015	(r279260)
@@ -20,24 +20,30 @@ CLOUDWARE?=	AZURE \
 		OPENSTACK
 AZURE_FORMAT=	vhdf
 AZURE_DESC=	Microsoft Azure platform image
+AZURE_DISK=	${OSRELEASE}.${AZURE_FORMAT}
 GCE_FORMAT=	raw
 GCE_DESC=	Google Compute Engine image
+GCE_DISK=	disk.${GCE_FORMAT}
 OPENSTACK_FORMAT=qcow2
 OPENSTACK_DESC=	OpenStack platform image
+OPENSTACK_DISK=	${OSRELEASE}.${OPENSTACK_FORMAT}
 
 .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
 . for _CW in ${CLOUDWARE}
-CLOUDTARGETS+=	vm-${_CW:tl}
-CLEANDIRS+=	vm-${_CW:tl}
+CLOUDTARGETS+=	cw-${_CW:tl}
+CLEANDIRS+=	cw-${_CW:tl}
 CLEANFILES+=	${_CW:tl}.img \
 		${_CW:tl}.${${_CW:tu}_FORMAT} \
-		${_CW:tl}.${${_CW:tu}_FORMAT}.raw
+		${_CW:tl}.${${_CW:tu}_FORMAT}.raw \
+		cw${_CW:tl}-package
+CLOUDINSTALL+=	cw${_CW:tl}-install
+CLOUDPACKAGE+=	cw${_CW:tl}-package
 ${_CW:tu}IMAGE=	${_CW:tl}.${${_CW:tu}_FORMAT}
 .  if exists(${.CURDIR}/tools/${_CW:tl}.conf) && !defined(${_CW:tu}CONF)
 ${_CW:tu}CONF?=	${.CURDIR}/tools/${_CW:tl}.conf
 .  endif
 
-vm-${_CW:tl}:
+cw-${_CW:tl}:
 	mkdir -p ${.OBJDIR}/${.TARGET}
 	env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
 		${.CURDIR}/scripts/mk-vmimage.sh \
@@ -45,6 +51,26 @@ vm-${_CW:tl}:
 		-i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW}_FORMAT} \
 		-S ${WORLDDIR} -o ${.OBJDIR}/${${_CW}IMAGE} -c ${${_CW}CONF}
 	touch ${.TARGET}
+
+cw${_CW:tl}-install:
+	mkdir -p ${DESTDIR}/${_CW:tl}
+	cp -p ${${_CW}IMAGE} \
+		${DESTDIR}/${_CW:tl}/${${_CW}_DISK}
+	cd ${DESTDIR}/${_CW:tl} && sha256 ${${_CW}_DISK}* > \
+		${DESTDIR}/${_CW:tl}/CHECKSUM.SHA256
+	cd ${DESTDIR}/${_CW:tl} && md5 ${${_CW}_DISK}* > \
+		${DESTDIR}/${_CW:tl}/CHECKSUM.MD5
+
+cw${_CW:tl}-package:
+	@# Special target to handle packaging cloud images in the formats
+	@# specific to each hosting provider.
+.if exists(${.CURDIR}/tools/${_CW:tl}-package.sh)
+	env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
+		${.CURDIR}/tools/${_CW:tl}-package.sh \
+		-D ${DESTDIR} -I ${${_CW}_DISK} -S ${WORLDDIR}
+.endif
+	touch ${.TARGET}
+
 . endfor
 .endif
 
@@ -97,8 +123,6 @@ vm-install:
 		${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
 . endfor
 . if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES)
-# This is very time consuming, so defer it after the images are moved to
-# the DESTDIR.
 .  for FORMAT in ${VMFORMATS}
 	# Don't keep the originals.  There is a copy in ${.OBJDIR} if needed.
 	${XZ_CMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
@@ -119,3 +143,8 @@ cloudware-release:
 .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
 	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS}
 .endif
+
+cloudware-install:
+.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
+	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDINSTALL}
+.endif

Copied: projects/sendfile/release/tools/gce-package.sh (from r279258, head/release/tools/gce-package.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/sendfile/release/tools/gce-package.sh	Wed Feb 25 00:06:25 2015	(r279260, copy of r279258, head/release/tools/gce-package.sh)
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# Script to handle packaging cloud images for GCE.
+#
+# XXX:
+# This script only exists to help in automating image creation,
+# and reimplementing this is intended (in other words, this is
+# temporary).
+
+usage() {
+	echo "Usage:"
+	echo "$(basename ${0}) -D <destdir> -I <input_file> -S <src_tree>"
+	exit 1
+}
+
+main() {
+	while getopts "D:I:W:" opt; do
+		case ${opt} in
+			D)
+				DESTDIR="${OPTARG}"
+				;;
+			I)
+				INFILE="${OPTARG}"
+				;;
+			S)
+				WORLDDIR="${OPTARG}"
+				;;
+			*)
+				usage
+				;;
+		esac
+	done
+	shift $(( ${OPTIND} - 1 ))
+
+	if [ -z "${DESTDIR}" -o -z "${INFILE}" -o -z "${WORLDDIR}" ]; then
+		usage
+	fi
+
+	OUTFILE="$(make -C ${WORLDDIR}/release -V OSRELEASE).tar.gz"
+
+	cd ${DESTDIR} && tar --format=gnutar -zcf ${OUTFILE} ${INFILE}
+}
+
+main "$@"

Modified: projects/sendfile/rescue/rescue/Makefile
==============================================================================
--- projects/sendfile/rescue/rescue/Makefile	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/rescue/rescue/Makefile	Wed Feb 25 00:06:25 2015	(r279260)
@@ -131,7 +131,7 @@ CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv
 .if ${MK_OPENSSL} == "no"
 CRUNCH_LIBS+= -lmd
 .endif
-CRUNCH_LIBS+= -lsbuf -lufs -lz
+CRUNCH_LIBS+= -lmt -lsbuf -lufs -lz
 
 .if ${MACHINE_CPUARCH} == "i386"
 CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk

Modified: projects/sendfile/share/man/man4/mtio.4
==============================================================================
--- projects/sendfile/share/man/man4/mtio.4	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/share/man/man4/mtio.4	Wed Feb 25 00:06:25 2015	(r279260)
@@ -31,7 +31,7 @@
 .\"     @(#)mtio.4	8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd November 11, 2011
+.Dd February 12, 2015
 .Dt MTIO 4
 .Os
 .Sh NAME
@@ -40,10 +40,10 @@
 .Sh DESCRIPTION
 The special files
 named
-.Pa /dev/[n]sa*
+.Pa /dev/[en]sa*
 refer to SCSI tape drives,
 which may be attached to the system.
-.Pa /dev/[n]sa*.ctl
+.Pa /dev/sa*.ctl
 are control devices that can be used to issue ioctls to the SCSI
 tape driver to set parameters that are required to last beyond the
 unmounting of a tape.
@@ -53,16 +53,19 @@ when the last requested read, write or s
 has been reached.
 The letter
 .Ql n
-is usually prepended to
+is prepended to
 the name of the no-rewind devices.
+The letter
+.Ql e
+is prepended to the name of the eject devices.
 .Pp
 Tapes can be written with either fixed length records or variable length
 records.
 See
 .Xr sa 4
 for more information.
-Two end-of-file markers mark the end of a tape, and
-one end-of-file marker marks the end of a tape file.
+Two filemarks mark the end of a tape, and
+one filemark marks the end of a tape file.
 If the tape is not to be rewound it is positioned with the
 head in between the two tape marks, where the next write
 will over write the second end-of-file marker.
@@ -128,6 +131,8 @@ struct mtop {
 #define MTWSS		16	/* write setmark(s) */
 #define MTFSS		17	/* forward space setmark */
 #define MTBSS		18	/* backward space setmark */
+#define MTLOAD		19	/* load tape in drive */
+#define MTWEOFI		20	/* write an end-of-file record without waiting*/
 
 #define MT_COMP_ENABLE		0xffffffff
 #define MT_COMP_DISABLED	0xfffffffe
@@ -224,6 +229,112 @@ union mterrstat {
 	char _reserved_padding[256];
 };
 
+struct mtrblim {
+	uint32_t granularity;
+	uint32_t min_block_length;
+	uint32_t max_block_length;
+};
+
+typedef enum {
+	MT_LOCATE_DEST_OBJECT	= 0x00,
+	MT_LOCATE_DEST_FILE	= 0x01,
+	MT_LOCATE_DEST_SET	= 0x02,
+	MT_LOCATE_DEST_EOD	= 0x03
+} mt_locate_dest_type;
+
+typedef enum {
+	MT_LOCATE_BAM_IMPLICIT	= 0x00,
+	MT_LOCATE_BAM_EXPLICIT	= 0x01
+} mt_locate_bam;
+
+typedef enum {
+	MT_LOCATE_FLAG_IMMED		= 0x01,
+	MT_LOCATE_FLAG_CHANGE_PART	= 0x02
+} mt_locate_flags;
+
+struct mtlocate {
+	mt_locate_flags		flags;
+	mt_locate_dest_type 	dest_type;
+	mt_locate_bam		block_address_mode;
+	int64_t			partition;
+	uint64_t		logical_id;
+	uint8_t			reserved[64];
+};
+
+typedef enum {
+	MT_EXT_GET_NONE,
+	MT_EXT_GET_OK,
+	MT_EXT_GET_NEED_MORE_SPACE,
+	MT_EXT_GET_ERROR
+} mt_ext_get_status;
+
+struct mtextget {
+	uint32_t		alloc_len;
+	char			*status_xml;
+	uint32_t		fill_len;
+	mt_ext_get_status	status;
+	char			error_str[128];
+	uint8_t			reserved[64];
+};
+
+#define	MT_EXT_GET_ROOT_NAME		"mtextget"
+#define	MT_DENSITY_ROOT_NAME		"mtdensity"
+#define	MT_MEDIA_DENSITY_NAME		"media_density"
+#define	MT_DENSITY_REPORT_NAME		"density_report"
+#define	MT_MEDIUM_TYPE_REPORT_NAME	"medium_type_report"
+#define	MT_MEDIA_REPORT_NAME		"media_report"
+#define	MT_DENSITY_ENTRY_NAME		"density_entry"
+
+#define	MT_DENS_WRITE_OK		0x80
+#define	MT_DENS_DUP			0x40
+#define	MT_DENS_DEFLT			0x20
+
+
+#define	MT_PARAM_FIXED_STR_LEN	32
+union mt_param_value {
+	int64_t		value_signed;
+	uint64_t	value_unsigned;
+	char		*value_var_str;
+	char		value_fixed_str[MT_PARAM_FIXED_STR_LEN];
+	uint8_t		reserved[64];
+};
+
+typedef enum {
+	MT_PARAM_SET_NONE,
+	MT_PARAM_SET_SIGNED,
+	MT_PARAM_SET_UNSIGNED,
+	MT_PARAM_SET_VAR_STR,
+	MT_PARAM_SET_FIXED_STR
+} mt_param_set_type;
+
+typedef enum {
+	MT_PARAM_STATUS_NONE,
+	MT_PARAM_STATUS_OK,
+	MT_PARAM_STATUS_ERROR
+} mt_param_set_status;
+
+#define	MT_PARAM_VALUE_NAME_LEN	64
+struct mtparamset {
+	char			value_name[MT_PARAM_VALUE_NAME_LEN];
+	mt_param_set_type	value_type;
+	int			value_len;
+	union mt_param_value	value;
+	mt_param_set_status	status;
+	char			error_str[128];
+};
+
+#define	MT_PARAM_ROOT_NAME	"mtparamget"
+#define	MT_PROTECTION_NAME	"protection"
+
+/*
+ * Set a list of parameters.
+ */
+struct mtsetlist {
+	int num_params;
+	int param_len;
+	struct mtparamset *params;
+};
+
 /*
  * Constants for mt_type byte.  These are the same
  * for controllers compatible with the types listed.
@@ -273,6 +384,12 @@ union mterrstat {
 #define	MTIOCSETEOTMODEL	_IOW('m', 8, uint32_t)
 /* Get current EOT model */
 #define	MTIOCGETEOTMODEL	_IOR('m', 8, uint32_t)
+#define	MTIOCRBLIM	_IOR('m', 9, struct mtrblim)    /* get block limits */
+#define	MTIOCEXTLOCATE	_IOW('m', 10, struct mtlocate)  /* seek to position */
+#define	MTIOCEXTGET	_IOWR('m', 11, struct mtextget) /* get tape status */
+#define	MTIOCPARAMGET	_IOWR('m', 12, struct mtextget) /* get tape params */
+#define	MTIOCPARAMSET	_IOWR('m', 13, struct mtparamset) /* set tape params */
+#define	MTIOCSETLIST	_IOWR('m', 14, struct mtsetlist) /* set N params */
 
 #ifndef _KERNEL
 #define	DEFTAPE	"/dev/nsa0"
@@ -281,13 +398,12 @@ union mterrstat {
 #endif /* !_SYS_MTIO_H_ */
 .Ed
 .Sh FILES
-.Bl -tag -width /dev/[n]sa* -compact
-.It Pa /dev/[n]sa*
+.Bl -tag -width /dev/[en]sa* -compact
+.It Pa /dev/[en]sa*
 .El
 .Sh SEE ALSO
 .Xr mt 1 ,
 .Xr tar 1 ,
-.Xr ast 4 ,
 .Xr sa 4
 .Sh HISTORY
 The
@@ -296,8 +412,3 @@ manual appeared in
 .Bx 4.2 .
 An i386 version first appeared in
 .Fx 2.2 .
-.Sh BUGS
-The status should be returned in a device independent format.
-.Pp
-The special file naming should be redone in a more consistent and
-understandable manner.

Modified: projects/sendfile/share/man/man4/sa.4
==============================================================================
--- projects/sendfile/share/man/man4/sa.4	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/share/man/man4/sa.4	Wed Feb 25 00:06:25 2015	(r279260)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 23, 2013
+.Dd February 12, 2015
 .Dt SA 4
 .Os
 .Sh NAME
@@ -285,10 +285,10 @@ device driver written and ported from
 by
 .An Julian Elischer .
 .Pp
-The current owner of record is
-.An Matthew Jacob
-who has suffered too many
-years of breaking tape drivers.
+The owner of record for many years was
+.An Matthew Jacob .
+The current maintainer is
+.An Kenneth Merry
 .Sh BUGS
 This driver lacks many of the hacks required to deal with older devices.
 Many older
@@ -305,7 +305,5 @@ for your device in order to read tapes w
 .Fx
 2.X.
 .Pp
-Fine grained density and compression mode support that is bound to specific
-device names needs to be added.
-.Pp
-Support for fast indexing by use of partitions is missing.
+Partitions are only supported for status information and location.
+It would be nice to add support for creating and editing tape partitions.

Modified: projects/sendfile/share/mk/bsd.libnames.mk
==============================================================================
--- projects/sendfile/share/mk/bsd.libnames.mk	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/share/mk/bsd.libnames.mk	Wed Feb 25 00:06:25 2015	(r279260)
@@ -85,6 +85,7 @@ LIBMEMSTAT?=	${DESTDIR}${LIBDIR}/libmems
 LIBMENU?=	${DESTDIR}${LIBDIR}/libmenu.a
 LIBMILTER?=	${DESTDIR}${LIBDIR}/libmilter.a
 LIBMP?=		${DESTDIR}${LIBDIR}/libmp.a
+LIBMT?=		${DESTDIR}${LIBDIR}/libmt.a
 LIBNCURSES?=	${DESTDIR}${LIBDIR}/libncurses.a
 LIBNCURSESW?=	${DESTDIR}${LIBDIR}/libncursesw.a
 LIBNETGRAPH?=	${DESTDIR}${LIBDIR}/libnetgraph.a

Modified: projects/sendfile/share/mk/src.sys.mk
==============================================================================
--- projects/sendfile/share/mk/src.sys.mk	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/share/mk/src.sys.mk	Wed Feb 25 00:06:25 2015	(r279260)
@@ -11,3 +11,13 @@ SRCCONF?=	/etc/src.conf
 .include "${SRCCONF}"
 _srcconf_included_:	.NOTMAIN
 .endif
+# If we were found via .../share/mk we need to replace that in
+# with ${.PARSEDIR:tA} so that we can be found by
+# sub-makes launched from objdir.
+.if ${.MAKEFLAGS:M.../share/mk} != ""
+.MAKEFLAGS:= ${.MAKEFLAGS:S,.../share/mk,${.PARSEDIR:tA},}
+.endif
+.if ${MAKESYSPATH:Uno:M*.../*} != ""
+MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},}
+.export MAKESYSPATH
+.endif

Modified: projects/sendfile/sys/amd64/vmm/intel/vmcs.c
==============================================================================
--- projects/sendfile/sys/amd64/vmm/intel/vmcs.c	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/sys/amd64/vmm/intel/vmcs.c	Wed Feb 25 00:06:25 2015	(r279260)
@@ -342,18 +342,6 @@ vmcs_init(struct vmcs *vmcs)
 	 */
 	VMPTRLD(vmcs);
 
-	/* Initialize guest IA32_PAT MSR with the default value */
-	pat = PAT_VALUE(0, PAT_WRITE_BACK)	|
-	      PAT_VALUE(1, PAT_WRITE_THROUGH)	|
-	      PAT_VALUE(2, PAT_UNCACHED)	|
-	      PAT_VALUE(3, PAT_UNCACHEABLE)	|
-	      PAT_VALUE(4, PAT_WRITE_BACK)	|
-	      PAT_VALUE(5, PAT_WRITE_THROUGH)	|
-	      PAT_VALUE(6, PAT_UNCACHED)	|
-	      PAT_VALUE(7, PAT_UNCACHEABLE);
-	if ((error = vmwrite(VMCS_GUEST_IA32_PAT, pat)) != 0)
-		goto done;
-
 	/* Host state */
 
 	/* Initialize host IA32_PAT MSR */

Modified: projects/sendfile/sys/amd64/vmm/intel/vmx.c
==============================================================================
--- projects/sendfile/sys/amd64/vmm/intel/vmx.c	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/sys/amd64/vmm/intel/vmx.c	Wed Feb 25 00:06:25 2015	(r279260)
@@ -100,13 +100,11 @@ __FBSDID("$FreeBSD$");
 	(VM_EXIT_HOST_LMA			|			\
 	VM_EXIT_SAVE_EFER			|			\
 	VM_EXIT_LOAD_EFER			|			\
-	VM_EXIT_ACKNOWLEDGE_INTERRUPT		|			\
-	VM_EXIT_SAVE_PAT			|			\
-	VM_EXIT_LOAD_PAT)
+	VM_EXIT_ACKNOWLEDGE_INTERRUPT)
 
 #define	VM_EXIT_CTLS_ZERO_SETTING	VM_EXIT_SAVE_DEBUG_CONTROLS
 
-#define	VM_ENTRY_CTLS_ONE_SETTING	(VM_ENTRY_LOAD_EFER | VM_ENTRY_LOAD_PAT)
+#define	VM_ENTRY_CTLS_ONE_SETTING	(VM_ENTRY_LOAD_EFER)
 
 #define	VM_ENTRY_CTLS_ZERO_SETTING					\
 	(VM_ENTRY_LOAD_DEBUG_CONTROLS		|			\
@@ -859,10 +857,6 @@ vmx_vminit(struct vm *vm, pmap_t pmap)
 	 * VM exit and entry respectively. It is also restored from the
 	 * host VMCS area on a VM exit.
 	 *
-	 * MSR_PAT is saved and restored in the guest VMCS are on a VM exit
-	 * and entry respectively. It is also restored from the host VMCS
-	 * area on a VM exit.
-	 *
 	 * The TSC MSR is exposed read-only. Writes are disallowed as that
 	 * will impact the host TSC.
 	 * XXX Writes would be implemented with a wrmsr trap, and
@@ -874,7 +868,6 @@ vmx_vminit(struct vm *vm, pmap_t pmap)
 	    guest_msr_rw(vmx, MSR_SYSENTER_ESP_MSR) ||
 	    guest_msr_rw(vmx, MSR_SYSENTER_EIP_MSR) ||
 	    guest_msr_rw(vmx, MSR_EFER) ||
-	    guest_msr_rw(vmx, MSR_PAT) ||
 	    guest_msr_ro(vmx, MSR_TSC))
 		panic("vmx_vminit: error setting guest msr access");
 

Modified: projects/sendfile/sys/amd64/vmm/intel/vmx.h
==============================================================================
--- projects/sendfile/sys/amd64/vmm/intel/vmx.h	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/sys/amd64/vmm/intel/vmx.h	Wed Feb 25 00:06:25 2015	(r279260)
@@ -103,6 +103,7 @@ enum {
 	IDX_MSR_STAR,
 	IDX_MSR_SF_MASK,
 	IDX_MSR_KGSBASE,
+	IDX_MSR_PAT,
 	GUEST_MSR_NUM		/* must be the last enumeration */
 };
 

Modified: projects/sendfile/sys/amd64/vmm/intel/vmx_msr.c
==============================================================================
--- projects/sendfile/sys/amd64/vmm/intel/vmx_msr.c	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/sys/amd64/vmm/intel/vmx_msr.c	Wed Feb 25 00:06:25 2015	(r279260)
@@ -230,6 +230,25 @@ westmere_cpu(void)
 	return (false);
 }
 
+static bool
+pat_valid(uint64_t val)
+{
+	int i, pa;
+
+	/*
+	 * From Intel SDM: Table "Memory Types That Can Be Encoded With PAT"
+	 *
+	 * Extract PA0 through PA7 and validate that each one encodes a
+	 * valid memory type.
+	 */
+	for (i = 0; i < 8; i++) {
+		pa = (val >> (i * 8)) & 0xff;
+		if (pa == 2 || pa == 3 || pa >= 8)
+			return (false);
+	}
+	return (true);
+}
+
 void
 vmx_msr_init(void)
 {
@@ -302,6 +321,10 @@ vmx_msr_init(void)
 void
 vmx_msr_guest_init(struct vmx *vmx, int vcpuid)
 {
+	uint64_t *guest_msrs;
+
+	guest_msrs = vmx->guest_msrs[vcpuid];
+
 	/*
 	 * The permissions bitmap is shared between all vcpus so initialize it
 	 * once when initializing the vBSP.
@@ -313,6 +336,19 @@ vmx_msr_guest_init(struct vmx *vmx, int 
 		guest_msr_rw(vmx, MSR_SF_MASK);
 		guest_msr_rw(vmx, MSR_KGSBASE);
 	}
+
+	/*
+	 * Initialize guest IA32_PAT MSR with default value after reset.
+	 */
+	guest_msrs[IDX_MSR_PAT] = PAT_VALUE(0, PAT_WRITE_BACK) |
+	    PAT_VALUE(1, PAT_WRITE_THROUGH)	|
+	    PAT_VALUE(2, PAT_UNCACHED)		|
+	    PAT_VALUE(3, PAT_UNCACHEABLE)	|
+	    PAT_VALUE(4, PAT_WRITE_BACK)	|
+	    PAT_VALUE(5, PAT_WRITE_THROUGH)	|
+	    PAT_VALUE(6, PAT_UNCACHED)		|
+	    PAT_VALUE(7, PAT_UNCACHEABLE);
+
 	return;
 }
 
@@ -353,7 +389,11 @@ vmx_msr_guest_exit(struct vmx *vmx, int 
 int
 vmx_rdmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t *val, bool *retu)
 {
-	int error = 0;
+	const uint64_t *guest_msrs;
+	int error;
+
+	guest_msrs = vmx->guest_msrs[vcpuid];
+	error = 0;
 
 	switch (num) {
 	case MSR_IA32_MISC_ENABLE:
@@ -366,6 +406,9 @@ vmx_rdmsr(struct vmx *vmx, int vcpuid, u
 	case MSR_TURBO_RATIO_LIMIT1:
 		*val = turbo_ratio_limit;
 		break;
+	case MSR_PAT:
+		*val = guest_msrs[IDX_MSR_PAT];
+		break;
 	default:
 		error = EINVAL;
 		break;
@@ -376,10 +419,13 @@ vmx_rdmsr(struct vmx *vmx, int vcpuid, u
 int
 vmx_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t val, bool *retu)
 {
+	uint64_t *guest_msrs;
 	uint64_t changed;
 	int error;
 	
+	guest_msrs = vmx->guest_msrs[vcpuid];
 	error = 0;
+
 	switch (num) {
 	case MSR_IA32_MISC_ENABLE:
 		changed = val ^ misc_enable;
@@ -401,6 +447,12 @@ vmx_wrmsr(struct vmx *vmx, int vcpuid, u
 			error = EINVAL;
 
 		break;
+	case MSR_PAT:
+		if (pat_valid(val))
+			guest_msrs[IDX_MSR_PAT] = val;
+		else
+			vm_inject_gp(vmx->vm, vcpuid);
+		break;
 	default:
 		error = EINVAL;
 		break;

Modified: projects/sendfile/sys/arm/arm/cpufunc_asm_armv7.S
==============================================================================
--- projects/sendfile/sys/arm/arm/cpufunc_asm_armv7.S	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/sys/arm/arm/cpufunc_asm_armv7.S	Wed Feb 25 00:06:25 2015	(r279260)
@@ -72,11 +72,7 @@ __FBSDID("$FreeBSD$");
 #endif
 
 ENTRY(armv7_setttb)
-	stmdb   sp!, {r0, lr}
- 	bl      _C_LABEL(armv7_idcache_wbinv_all) /* clean the D cache */
- 	ldmia   sp!, {r0, lr}
  	dsb
-				
 	orr 	r0, r0, #PT_ATTR
  	mcr	CP15_TTBR0(r0)
 	isb

Modified: projects/sendfile/sys/arm/arm/gic.c
==============================================================================
--- projects/sendfile/sys/arm/arm/gic.c	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/sys/arm/arm/gic.c	Wed Feb 25 00:06:25 2015	(r279260)
@@ -205,7 +205,7 @@ gic_decode_fdt(uint32_t iparent, uint32_
 		*trig = INTR_TRIGGER_CONFORM;
 		*pol = INTR_POLARITY_CONFORM;
 	} else {
-		if (intr[0] == 0)
+		if (fdt32_to_cpu(intr[0]) == 0)
 			*interrupt = fdt32_to_cpu(intr[1]) + GIC_FIRST_SPI;
 		else
 			*interrupt = fdt32_to_cpu(intr[1]) + GIC_FIRST_PPI;
@@ -217,13 +217,13 @@ gic_decode_fdt(uint32_t iparent, uint32_
 		 *   8 = active low level-sensitive
 		 * The hardware only supports active-high-level or rising-edge.
 		 */
-		if (intr[2] & 0x0a) {
+		if (fdt32_to_cpu(intr[2]) & 0x0a) {
 			printf("unsupported trigger/polarity configuration "
-			    "0x%2x\n", intr[2] & 0x0f);
+			    "0x%2x\n", fdt32_to_cpu(intr[2]) & 0x0f);
 			return (ENOTSUP);
 		}
 		*pol  = INTR_POLARITY_CONFORM;
-		if (intr[2] & 0x01)
+		if (fdt32_to_cpu(intr[2]) & 0x01)
 			*trig = INTR_TRIGGER_EDGE;
 		else
 			*trig = INTR_TRIGGER_LEVEL;

Modified: projects/sendfile/sys/boot/i386/libi386/biosmem.c
==============================================================================
--- projects/sendfile/sys/boot/i386/libi386/biosmem.c	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/sys/boot/i386/libi386/biosmem.c	Wed Feb 25 00:06:25 2015	(r279260)
@@ -32,19 +32,63 @@ __FBSDID("$FreeBSD$");
  */
 #include <stand.h>
 #include <machine/pc/bios.h>
+#include "bootstrap.h"
 #include "libi386.h"
 #include "btxv86.h"
 
 vm_offset_t	memtop, memtop_copyin, high_heap_base;
 uint32_t	bios_basemem, bios_extmem, high_heap_size;
 
-static struct bios_smap smap;
+static struct bios_smap_xattr smap;
+
+/*
+ * Used to track which method was used to set BIOS memory
+ * regions.
+ */
+static uint8_t b_bios_probed;
+#define	B_BASEMEM_E820	0x1
+#define	B_BASEMEM_12	0x2
+#define	B_EXTMEM_E820	0x4
+#define	B_EXTMEM_E801	0x8
+#define	B_EXTMEM_8800	0x10
 
 /*
  * The minimum amount of memory to reserve in bios_extmem for the heap.
  */
 #define	HEAP_MIN	(3 * 1024 * 1024)
 
+/*
+ * Products in this list need quirks to detect
+ * memory correctly. You need both maker and product as
+ * reported by smbios.
+ */
+#define BQ_DISTRUST_E820_EXTMEM	0x1	/* e820 might not return useful
+					   extended memory */
+struct bios_getmem_quirks {
+    const char* bios_vendor;
+    const char*	maker;
+    const char*	product;
+    int		quirk;
+};
+
+static struct bios_getmem_quirks quirks[] = {
+    {"coreboot", "Acer", "Peppy", BQ_DISTRUST_E820_EXTMEM},
+    {NULL, NULL, NULL, 0}
+};
+
+static int
+bios_getquirks(void)
+{
+    int i;
+
+    for (i=0; quirks[i].quirk != 0; ++i)
+	if (smbios_match(quirks[i].bios_vendor, quirks[i].maker,
+	    quirks[i].product))
+	    return (quirks[i].quirk);
+
+    return (0);
+}
+
 void
 bios_getmem(void)
 {
@@ -56,7 +100,7 @@ bios_getmem(void)
 	v86.ctl = V86_FLAGS;
 	v86.addr = 0x15;		/* int 0x15 function 0xe820*/
 	v86.eax = 0xe820;
-	v86.ecx = sizeof(struct bios_smap);
+	v86.ecx = sizeof(struct bios_smap_xattr);
 	v86.edx = SMAP_SIG;
 	v86.es = VTOPSEG(&smap);
 	v86.edi = VTOPOFF(&smap);
@@ -65,11 +109,16 @@ bios_getmem(void)
 	    break;
 	/* look for a low-memory segment that's large enough */
 	if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) &&
-	    (smap.length >= (512 * 1024)))
+	    (smap.length >= (512 * 1024))) {
 	    bios_basemem = smap.length;
+	    b_bios_probed |= B_BASEMEM_E820;
+	}
+
 	/* look for the first segment in 'extended' memory */
-	if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) {
+	if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000) &&
+	    !(bios_getquirks() & BQ_DISTRUST_E820_EXTMEM)) {
 	    bios_extmem = smap.length;
+	    b_bios_probed |= B_EXTMEM_E820;
 	}
 
 	/*
@@ -100,6 +149,7 @@ bios_getmem(void)
 	v86int();
 	
 	bios_basemem = (v86.eax & 0xffff) * 1024;
+	b_bios_probed |= B_BASEMEM_12;
     }
 
     /* Fall back through several compatibility functions for extended memory */
@@ -109,7 +159,30 @@ bios_getmem(void)
 	v86.eax = 0xe801;
 	v86int();
 	if (!(V86_CY(v86.efl))) {
-	    bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024;
+	    /*
+	     * Clear high_heap; it may end up overlapping
+	     * with the segment we're determining here.
+	     * Let the default "steal stuff from top of
+	     * bios_extmem" code below pick up on it.
+	     */
+	    high_heap_size = 0;
+	    high_heap_base = 0;
+
+	    /*
+	     * %cx is the number of 1KiB blocks between 1..16MiB.
+	     * It can only be up to 0x3c00; if it's smaller then
+	     * there's a PC AT memory hole so we can't treat
+	     * it as contiguous.
+	     */
+	    bios_extmem = (v86.ecx & 0xffff) * 1024;
+	    if (bios_extmem == (1024 * 0x3c00))
+		bios_extmem += (v86.edx & 0xffff) * 64 * 1024;
+
+	    /* truncate bios_extmem */
+	    if (bios_extmem > 0x3ff00000)
+		bios_extmem = 0x3ff00000;
+
+	    b_bios_probed |= B_EXTMEM_E801;
 	}
     }
     if (bios_extmem == 0) {
@@ -118,6 +191,7 @@ bios_getmem(void)
 	v86.eax = 0x8800;
 	v86int();
 	bios_extmem = (v86.eax & 0xffff) * 1024;
+	b_bios_probed |= B_EXTMEM_8800;
     }
 
     /* Set memtop to actual top of memory */
@@ -132,4 +206,36 @@ bios_getmem(void)
 	high_heap_size = HEAP_MIN;
 	high_heap_base = memtop - HEAP_MIN;
     }
-}    
+}
+
+static int
+command_biosmem(int argc, char *argv[])
+{
+	int bq = bios_getquirks();
+
+	printf("bios_basemem: 0x%llx\n", (unsigned long long) bios_basemem);
+	printf("bios_extmem: 0x%llx\n", (unsigned long long) bios_extmem);
+	printf("memtop: 0x%llx\n", (unsigned long long) memtop);
+	printf("high_heap_base: 0x%llx\n", (unsigned long long) high_heap_base);
+	printf("high_heap_size: 0x%llx\n", (unsigned long long) high_heap_size);
+	printf("bios_quirks: 0x%02x", bq);
+	if (bq & BQ_DISTRUST_E820_EXTMEM)
+		printf(" BQ_DISTRUST_E820_EXTMEM");
+	printf("\n");
+	printf("b_bios_probed: 0x%02x", (int) b_bios_probed);
+	if (b_bios_probed & B_BASEMEM_E820)
+		printf(" B_BASEMEM_E820");
+	if (b_bios_probed & B_BASEMEM_12)
+		printf(" B_BASEMEM_12");
+	if (b_bios_probed & B_EXTMEM_E820)
+		printf(" B_EXTMEM_E820");
+	if (b_bios_probed & B_EXTMEM_E801)
+		printf(" B_EXTMEM_E801");
+	if (b_bios_probed & B_EXTMEM_8800)
+		printf(" B_EXTMEM_8800");
+	printf("\n");
+
+	return (CMD_OK);
+}
+
+COMMAND_SET(biosmem, "biosmem", "show BIOS memory setup", command_biosmem);

Modified: projects/sendfile/sys/cam/scsi/scsi_all.c
==============================================================================
--- projects/sendfile/sys/cam/scsi/scsi_all.c	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/sys/cam/scsi/scsi_all.c	Wed Feb 25 00:06:25 2015	(r279260)
@@ -7442,6 +7442,71 @@ scsi_persistent_reserve_out(struct ccb_s
 	scsi_cmd->opcode = PERSISTENT_RES_OUT;
 	scsi_cmd->action = service_action;
 	scsi_cmd->scope_type = scope | res_type;
+
+	cam_fill_csio(csio,
+		      retries,
+		      cbfcnp,
+		      /*flags*/CAM_DIR_OUT,
+		      tag_action,
+		      /*data_ptr*/data_ptr,
+		      /*dxfer_len*/dxfer_len,
+		      sense_len,
+		      sizeof(*scsi_cmd),
+		      timeout);
+}
+
+void
+scsi_security_protocol_in(struct ccb_scsiio *csio, uint32_t retries, 
+			  void (*cbfcnp)(struct cam_periph *, union ccb *),
+			  uint8_t tag_action, uint32_t security_protocol,
+			  uint32_t security_protocol_specific, int byte4,
+			  uint8_t *data_ptr, uint32_t dxfer_len, int sense_len,
+			  int timeout)
+{
+	struct scsi_security_protocol_in *scsi_cmd;
+
+	scsi_cmd = (struct scsi_security_protocol_in *)&csio->cdb_io.cdb_bytes;
+	bzero(scsi_cmd, sizeof(*scsi_cmd));
+
+	scsi_cmd->opcode = SECURITY_PROTOCOL_IN;
+
+	scsi_cmd->security_protocol = security_protocol;
+	scsi_ulto2b(security_protocol_specific,
+		    scsi_cmd->security_protocol_specific); 
+	scsi_cmd->byte4 = byte4;
+	scsi_ulto4b(dxfer_len, scsi_cmd->length);
+
+	cam_fill_csio(csio,
+		      retries,
+		      cbfcnp,
+		      /*flags*/CAM_DIR_IN,
+		      tag_action,
+		      data_ptr,
+		      dxfer_len,
+		      sense_len,
+		      sizeof(*scsi_cmd),
+		      timeout);
+}
+
+void
+scsi_security_protocol_out(struct ccb_scsiio *csio, uint32_t retries, 
+			   void (*cbfcnp)(struct cam_periph *, union ccb *),
+			   uint8_t tag_action, uint32_t security_protocol,
+			   uint32_t security_protocol_specific, int byte4,
+			   uint8_t *data_ptr, uint32_t dxfer_len, int sense_len,
+			   int timeout)
+{
+	struct scsi_security_protocol_out *scsi_cmd;
+
+	scsi_cmd = (struct scsi_security_protocol_out *)&csio->cdb_io.cdb_bytes;
+	bzero(scsi_cmd, sizeof(*scsi_cmd));
+
+	scsi_cmd->opcode = SECURITY_PROTOCOL_OUT;
+
+	scsi_cmd->security_protocol = security_protocol;
+	scsi_ulto2b(security_protocol_specific,
+		    scsi_cmd->security_protocol_specific); 
+	scsi_cmd->byte4 = byte4;
 	scsi_ulto4b(dxfer_len, scsi_cmd->length);
 
 	cam_fill_csio(csio,

Modified: projects/sendfile/sys/cam/scsi/scsi_all.h
==============================================================================
--- projects/sendfile/sys/cam/scsi/scsi_all.h	Tue Feb 24 23:50:10 2015	(r279259)
+++ projects/sendfile/sys/cam/scsi/scsi_all.h	Wed Feb 25 00:06:25 2015	(r279260)
@@ -1758,6 +1758,7 @@ struct ata_pass_16 {
 #define	SERVICE_ACTION_IN	0x9E
 #define	REPORT_LUNS		0xA0
 #define	ATA_PASS_12		0xA1

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



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