PERFORCE change 132914 for review
John Birrell
jb at FreeBSD.org
Wed Jan 9 13:05:08 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=132914
Change 132914 by jb at jb_freebsd1 on 2008/01/09 21:04:37
IFC
Affected files ...
.. //depot/projects/dtrace/doc/en_US.ISO8859-1/books/handbook/x11/chapter.sgml#9 integrate
.. //depot/projects/dtrace/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml#53 integrate
.. //depot/projects/dtrace/ports/LEGAL#32 integrate
.. //depot/projects/dtrace/ports/MOVED#61 integrate
.. //depot/projects/dtrace/src/contrib/libiberty/cp-demangle.c#1 branch
.. //depot/projects/dtrace/src/contrib/top/top.c#6 integrate
.. //depot/projects/dtrace/src/share/man/man9/lock.9#7 integrate
.. //depot/projects/dtrace/src/sys/amd64/include/ieeefp.h#4 integrate
.. //depot/projects/dtrace/src/sys/dev/cxgb/cxgb_adapter.h#4 integrate
.. //depot/projects/dtrace/src/sys/dev/cxgb/sys/mvec.h#4 integrate
.. //depot/projects/dtrace/src/sys/dev/cxgb/sys/uipc_mvec.c#4 integrate
.. //depot/projects/dtrace/src/sys/dev/iir/iir.c#8 integrate
.. //depot/projects/dtrace/src/sys/dev/usb/ehci.c#10 integrate
.. //depot/projects/dtrace/src/sys/dev/usb/if_udav.c#7 integrate
.. //depot/projects/dtrace/src/sys/fs/hpfs/hpfs_subr.h#4 integrate
.. //depot/projects/dtrace/src/sys/fs/ntfs/ntfs_subr.c#5 integrate
.. //depot/projects/dtrace/src/sys/kern/kern_lock.c#14 integrate
.. //depot/projects/dtrace/src/sys/sys/buf.h#6 integrate
.. //depot/projects/dtrace/src/sys/sys/lockmgr.h#10 integrate
.. //depot/projects/dtrace/src/sys/sys/mbuf.h#12 integrate
.. //depot/projects/dtrace/src/sys/sys/param.h#30 integrate
.. //depot/projects/dtrace/src/usr.bin/top/machine.c#8 integrate
.. //depot/projects/dtrace/src/usr.sbin/pkg_install/add/pkg_add.1#6 integrate
.. //depot/projects/dtrace/www/en/gnome/images/ahze.jpg#3 integrate
.. //depot/projects/dtrace/www/share/sgml/events.xml#17 integrate
Differences ...
==== //depot/projects/dtrace/doc/en_US.ISO8859-1/books/handbook/x11/chapter.sgml#9 (text+ko) ====
@@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
- $FreeBSD: doc/en_US.ISO8859-1/books/handbook/x11/chapter.sgml,v 1.184 2007/07/10 07:06:24 blackend Exp $
+ $FreeBSD: doc/en_US.ISO8859-1/books/handbook/x11/chapter.sgml,v 1.185 2008/01/09 19:43:05 blackend Exp $
-->
<chapter id="x11">
@@ -402,7 +402,15 @@
<sect2>
<title>Configuring X11</title>
- <para>Configuration of X11 is
+ <para>As of version 7.3, <application>&xorg;</application> can
+ often work without any configuration file by simply typing at
+ prompt:</para>
+
+ <screen>&prompt.user; <userinput>startx</userinput></screen>
+
+ <para>If this does not work, or if the default configuration is
+ not acceptable, then X11 must be configured manually.
+ Configuration of X11 is
a multi-step process. The first step is to build an initial
configuration file.
As the super user, simply
==== //depot/projects/dtrace/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml#53 (text+ko) ====
@@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
- $FreeBSD: doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v 1.894 2008/01/06 11:00:31 hrs Exp $
+ $FreeBSD: doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v 1.895 2008/01/09 17:36:05 gabor Exp $
-->
<!DOCTYPE BOOK PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
@@ -11668,6 +11668,16 @@
argument.</entry>
<entry>800007</entry>
</row>
+ <row>
+ <entry>8.0-CURRENT after LK_EXCLUPGRADE option
+ removal.</entry>
+ <entry>800008</entry>
+ </row>
+ <row>
+ <entry>8.0-CURRENT after introduction of the
+ <function>lockmgr_disown()</function> function.</entry>
+ <entry>800009</entry>
+ </row>
</tbody>
</tgroup>
</table>
==== //depot/projects/dtrace/ports/LEGAL#32 (text+ko) ====
@@ -1,5 +1,5 @@
# Creator: Jordan Hubbard
-# $FreeBSD: ports/LEGAL,v 1.563 2008/01/01 15:35:04 lme Exp $
+# $FreeBSD: ports/LEGAL,v 1.564 2008/01/09 20:12:41 thierry Exp $
**********************************************************************
*** NOTE TO COMMITTERS ***
@@ -624,6 +624,9 @@
VTK-* math/vtk Portions contain patented algorithms
and may require a license for
commercial use
+vtkmpeg2encode.tar.gz multimedia/vtkmpeg2encode The MPEG2 format and all
+ software that uses it is subject to patent
+ restrictions
vrml2pov-src* graphics/vrml2pov Redistribution is not allowed
waeijiro-fpw-* japanese/waeijiro-fpw The original dictionary is not free
warsow/* games/linux-warsow Redistribution is limited, art
==== //depot/projects/dtrace/ports/MOVED#61 (text+ko) ====
@@ -1,7 +1,7 @@
#
# MOVED - a list of (recently) moved or removed ports
#
-# $FreeBSD: ports/MOVED,v 1.1527 2008/01/04 18:34:11 alepulver Exp $
+# $FreeBSD: ports/MOVED,v 1.1528 2008/01/09 15:19:45 tabthorpe Exp $
#
# Each entry consists of a single line containing the following four
# fields in the order named, separated with the pipe (`|') character:
@@ -3353,3 +3353,4 @@
audio/polypaudio|audio/pulseaudio|2008-01-01|Project renamed
audio/paman|audio/pavucontrol|2008-01-01|New tool to work with pulseaudio
audio/akode-plugins-polypaudio||2008-01-01|Polypaudio is obsolete in favor of pulseaudio
+audio/teknap|net-p2p/teknap|2008-01-09|moved to net-p2p category
==== //depot/projects/dtrace/src/contrib/top/top.c#6 (text+ko) ====
@@ -13,7 +13,7 @@
* Copyright (c) 1994, 1995, William LeFebvre, Argonne National Laboratory
* Copyright (c) 1996, William LeFebvre, Group sys Consulting
*
- * $FreeBSD: src/contrib/top/top.c,v 1.23 2007/05/04 15:42:58 rafan Exp $
+ * $FreeBSD: src/contrib/top/top.c,v 1.24 2008/01/09 18:06:24 obrien Exp $
*/
/*
@@ -450,7 +450,7 @@
}
/* initialize the kernel memory interface */
- if (machine_init(&statics) == -1)
+ if (machine_init(&statics, do_unames) == -1)
{
exit(1);
}
==== //depot/projects/dtrace/src/share/man/man9/lock.9#7 (text+ko) ====
@@ -24,9 +24,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
.\" DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man9/lock.9,v 1.18 2007/12/28 00:38:12 attilio Exp $
+.\" $FreeBSD: src/share/man/man9/lock.9,v 1.20 2008/01/09 08:08:56 brueffer Exp $
.\"
-.Dd December 27, 2007
+.Dd January 9, 2008
.Dt LOCK 9
.Os
.Sh NAME
@@ -35,6 +35,7 @@
.Nm lockcount ,
.Nm lockmgr ,
.Nm lockstatus ,
+.Nm lockmgr_disown ,
.Nm lockmgr_printinfo
.Nd "lockmgr family of functions"
.Sh SYNOPSIS
@@ -51,6 +52,8 @@
.Ft int
.Fn lockstatus "struct lock *lkp" "struct thread *td"
.Ft void
+.Fn lockmgr_disown "struct lock *lkp"
+.Ft void
.Fn lockmgr_printinfo "struct lock *lkp"
.Sh DESCRIPTION
The
@@ -187,6 +190,12 @@
will be returned.
.Pp
The
+.Fn lockmgr_disown
+function switches the owner from curthread to be
+.Dv LK_KERNPROC,
+if the lock is already held.
+.Pp
+The
.Fn lockmgr_printinfo
function prints debugging information about the lock.
It is used primarily by
==== //depot/projects/dtrace/src/sys/amd64/include/ieeefp.h#4 (text+ko) ====
@@ -32,16 +32,16 @@
* SUCH DAMAGE.
*
* from: @(#) ieeefp.h 1.0 (Berkeley) 9/23/93
- * $FreeBSD: src/sys/amd64/include/ieeefp.h,v 1.14 2005/04/12 23:12:00 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/ieeefp.h,v 1.17 2008/01/09 15:03:03 bde Exp $
*/
+#ifndef _MACHINE_IEEEFP_H_
+#define _MACHINE_IEEEFP_H_
+
/*
- * IEEE floating point type and constant definitions.
+ * IEEE floating point type, constant and function definitions.
*/
-#ifndef _MACHINE_IEEEFP_H_
-#define _MACHINE_IEEEFP_H_
-
#ifndef _SYS_CDEFS_H_
#error this file needs sys/cdefs.h as a prerequisite
#endif
@@ -121,11 +121,8 @@
#define SSE_RND_OFF 13 /* rounding control offset */
#define SSE_FZ_OFF 15 /* flush to zero offset */
-#if defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE__) \
- && !defined(__cplusplus)
+#ifdef __GNUCLIKE_ASM
-#define __fldenv(addr) __asm __volatile("fldenv %0" : : "m" (*(addr)))
-#define __fnstenv(addr) __asm __volatile("fnstenv %0" : "=m" (*(addr)))
#define __fldcw(addr) __asm __volatile("fldcw %0" : : "m" (*(addr)))
#define __fnstcw(addr) __asm __volatile("fnstcw %0" : "=m" (*(addr)))
#define __fnstsw(addr) __asm __volatile("fnstsw %0" : "=m" (*(addr)))
@@ -143,25 +140,24 @@
* merge the two together. I think.
*/
-/* Set rounding control */
-static __inline__ fp_rnd_t
+static __inline fp_rnd_t
__fpgetround(void)
{
unsigned short _cw;
__fnstcw(&_cw);
- return ((_cw & FP_RND_FLD) >> FP_RND_OFF);
+ return ((fp_rnd_t)((_cw & FP_RND_FLD) >> FP_RND_OFF));
}
-static __inline__ fp_rnd_t
+static __inline fp_rnd_t
__fpsetround(fp_rnd_t _m)
{
+ fp_rnd_t _p;
+ unsigned _mxcsr;
unsigned short _cw;
- unsigned int _mxcsr;
- fp_rnd_t _p;
__fnstcw(&_cw);
- _p = (_cw & FP_RND_FLD) >> FP_RND_OFF;
+ _p = (fp_rnd_t)((_cw & FP_RND_FLD) >> FP_RND_OFF);
_cw &= ~FP_RND_FLD;
_cw |= (_m << FP_RND_OFF) & FP_RND_FLD;
__fldcw(&_cw);
@@ -173,26 +169,27 @@
}
/*
- * Set precision for fadd/fsub/fsqrt etc x87 instructions
+ * Get or set the rounding precision for x87 arithmetic operations.
* There is no equivalent SSE mode or control.
*/
-static __inline__ fp_prec_t
+
+static __inline fp_prec_t
__fpgetprec(void)
{
unsigned short _cw;
__fnstcw(&_cw);
- return ((_cw & FP_PRC_FLD) >> FP_PRC_OFF);
+ return ((fp_prec_t)((_cw & FP_PRC_FLD) >> FP_PRC_OFF));
}
-static __inline__ fp_prec_t
-__fpsetprec(fp_rnd_t _m)
+static __inline fp_prec_t
+__fpsetprec(fp_prec_t _m)
{
+ fp_prec_t _p;
unsigned short _cw;
- fp_prec_t _p;
__fnstcw(&_cw);
- _p = (_cw & FP_PRC_FLD) >> FP_PRC_OFF;
+ _p = (fp_prec_t)((_cw & FP_PRC_FLD) >> FP_PRC_OFF);
_cw &= ~FP_PRC_FLD;
_cw |= (_m << FP_PRC_OFF) & FP_PRC_FLD;
__fldcw(&_cw);
@@ -200,59 +197,56 @@
}
/*
- * Look at the exception masks
- * Note that x87 masks are inverse of the fp*() functions
- * API. ie: mask = 1 means disable for x87 and SSE, but
- * for the fp*() api, mask = 1 means enabled.
+ * Get or set the exception mask.
+ * Note that the x87 mask bits are inverted by the API -- a mask bit of 1
+ * means disable for x87 and SSE, but for fp*mask() it means enable.
*/
-static __inline__ fp_except_t
+
+static __inline fp_except_t
__fpgetmask(void)
{
unsigned short _cw;
__fnstcw(&_cw);
- return ((~_cw) & FP_MSKS_FLD);
+ return ((~_cw & FP_MSKS_FLD) >> FP_MSKS_OFF);
}
-static __inline__ fp_except_t
+static __inline fp_except_t
__fpsetmask(fp_except_t _m)
{
+ fp_except_t _p;
+ unsigned _mxcsr;
unsigned short _cw;
- unsigned int _mxcsr;
- fp_except_t _p;
__fnstcw(&_cw);
- _p = (~_cw) & FP_MSKS_FLD;
+ _p = (~_cw & FP_MSKS_FLD) >> FP_MSKS_OFF;
_cw &= ~FP_MSKS_FLD;
- _cw |= (~_m) & FP_MSKS_FLD;
+ _cw |= (~_m >> FP_MSKS_OFF) & FP_MSKS_FLD;
__fldcw(&_cw);
__stmxcsr(&_mxcsr);
/* XXX should we clear non-ieee SSE_DAZ_FLD and SSE_FZ_FLD ? */
_mxcsr &= ~SSE_MSKS_FLD;
- _mxcsr |= ((~_m) << SSE_MSKS_OFF) & SSE_MSKS_FLD;
+ _mxcsr |= (~_m << SSE_MSKS_OFF) & SSE_MSKS_FLD;
__ldmxcsr(&_mxcsr);
return (_p);
}
-/* See which sticky exceptions are pending, and reset them */
-static __inline__ fp_except_t
+static __inline fp_except_t
__fpgetsticky(void)
{
+ unsigned _ex, _mxcsr;
unsigned short _sw;
- unsigned int _mxcsr;
- fp_except_t _ex;
__fnstsw(&_sw);
- _ex = _sw & FP_STKY_FLD;
+ _ex = (_sw & FP_STKY_FLD) >> FP_STKY_OFF;
__stmxcsr(&_mxcsr);
- _ex |= _mxcsr & SSE_STKY_FLD;
- return (_ex);
+ _ex |= (_mxcsr & SSE_STKY_FLD) >> SSE_STKY_OFF;
+ return ((fp_except_t)_ex);
}
-#endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE__ && !__cplusplus */
+#endif /* __GNUCLIKE_ASM */
-#if !defined(__IEEEFP_NOINLINES__) && !defined(__cplusplus) \
- && defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE__)
+#if !defined(__IEEEFP_NOINLINES__) && defined(__GNUCLIKE_ASM)
#define fpgetround() __fpgetround()
#define fpsetround(_m) __fpsetround(_m)
@@ -265,16 +259,14 @@
/* Suppress prototypes in the MI header. */
#define _IEEEFP_INLINED_ 1
-#else /* !__IEEEFP_NOINLINES__ && !__cplusplus && __GNUCLIKE_ASM
- && __CC_SUPPORTS___INLINE__ */
+#else /* !(!__IEEEFP_NOINLINES__ && __GNUCLIKE_ASM) */
-/* Augment the userland declarations */
+/* Augment the userland declarations. */
__BEGIN_DECLS
-extern fp_prec_t fpgetprec(void);
-extern fp_prec_t fpsetprec(fp_prec_t);
+fp_prec_t fpgetprec(void);
+fp_prec_t fpsetprec(fp_prec_t);
__END_DECLS
-#endif /* !__IEEEFP_NOINLINES__ && !__cplusplus && __GNUCLIKE_ASM
- && __CC_SUPPORTS___INLINE__ */
+#endif /* !__IEEEFP_NOINLINES__ && __GNUCLIKE_ASM */
#endif /* !_MACHINE_IEEEFP_H_ */
==== //depot/projects/dtrace/src/sys/dev/cxgb/cxgb_adapter.h#4 (text+ko) ====
@@ -26,7 +26,7 @@
POSSIBILITY OF SUCH DAMAGE.
-$FreeBSD: src/sys/dev/cxgb/cxgb_adapter.h,v 1.22 2007/12/17 08:17:49 kmacy Exp $
+$FreeBSD: src/sys/dev/cxgb/cxgb_adapter.h,v 1.23 2008/01/09 08:12:24 kmacy Exp $
***************************************************************************/
@@ -120,8 +120,8 @@
uint8_t port_id;
uint8_t tx_chan;
uint8_t txpkt_intf;
- uint8_t nqsets;
uint8_t first_qset;
+ uint32_t nqsets;
uint8_t hw_addr[ETHER_ADDR_LEN];
struct taskqueue *tq;
@@ -284,6 +284,8 @@
uint32_t txq_skipped;
uint32_t txq_coalesced;
uint32_t txq_enqueued;
+ uint32_t txq_dump_start;
+ uint32_t txq_dump_count;
unsigned long txq_frees;
struct mtx lock;
struct sg_ent txq_sgl[TX_MAX_SEGS / 2 + 1];
==== //depot/projects/dtrace/src/sys/dev/cxgb/sys/mvec.h#4 (text+ko) ====
@@ -25,7 +25,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/cxgb/sys/mvec.h,v 1.9 2008/01/07 01:18:16 kmacy Exp $
+ * $FreeBSD: src/sys/dev/cxgb/sys/mvec.h,v 1.10 2008/01/09 08:01:08 kmacy Exp $
*
***************************************************************************/
@@ -247,6 +247,7 @@
case EXT_NET_DRV:
case EXT_MOD_TYPE:
case EXT_DISPOSABLE:
+ case EXT_PACKET:
case EXT_EXTREF:
mb_free_ext_fast(mi, mi->mi_type, -1);
break;
==== //depot/projects/dtrace/src/sys/dev/cxgb/sys/uipc_mvec.c#4 (text+ko) ====
@@ -29,7 +29,7 @@
***************************************************************************/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cxgb/sys/uipc_mvec.c,v 1.16 2008/01/07 01:18:16 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cxgb/sys/uipc_mvec.c,v 1.17 2008/01/09 08:01:42 kmacy Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -384,7 +384,7 @@
*/
while (dofree == 0) {
cnt = *(mi->mi_refcnt);
- if (mi->mi_type == EXT_PACKET) {
+ if (mi->mi_type == EXT_PACKET && cnt == 1) {
dofree = 1;
break;
}
==== //depot/projects/dtrace/src/sys/dev/iir/iir.c#8 (text+ko) ====
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/iir/iir.c,v 1.19 2007/06/17 05:55:50 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/iir/iir.c,v 1.20 2008/01/09 20:02:56 scottl Exp $");
#define _IIR_C_
@@ -1160,20 +1160,25 @@
break;
case INQUIRY:
{
- struct scsi_inquiry_data *inq;
+ struct scsi_inquiry_data inq;
+ size_t copylen = MIN(sizeof(inq), ccb->csio.dxfer_len);
- inq = (struct scsi_inquiry_data *)ccb->csio.data_ptr;
- bzero(inq, sizeof(struct scsi_inquiry_data));
- inq->device = (gdt->sc_hdr[t].hd_devtype & 4) ?
+ bzero(&inq, sizeof(inq));
+ inq.device = (gdt->sc_hdr[t].hd_devtype & 4) ?
T_CDROM : T_DIRECT;
- inq->dev_qual2 = (gdt->sc_hdr[t].hd_devtype & 1) ? 0x80 : 0;
- inq->version = SCSI_REV_2;
- inq->response_format = 2;
- inq->additional_length = 32;
- inq->flags = SID_CmdQue | SID_Sync;
- strcpy(inq->vendor, gdt->oem_name);
- sprintf(inq->product, "Host Drive #%02d", t);
- strcpy(inq->revision, " ");
+ inq.dev_qual2 = (gdt->sc_hdr[t].hd_devtype & 1) ? 0x80 : 0;
+ inq.version = SCSI_REV_2;
+ inq.response_format = 2;
+ inq.additional_length = 32;
+ inq.flags = SID_CmdQue | SID_Sync;
+ strncpy(inq.vendor, gdt->oem_name, sizeof(inq.vendor));
+ snprintf(inq.product, sizeof(inq.product),
+ "Host Drive #%02d", t);
+ strncpy(inq.revision, " ", sizeof(inq.revision));
+ bcopy(&inq, ccb->csio.data_ptr, copylen );
+ if( ccb->csio.dxfer_len > copylen )
+ bzero( ccb->csio.data_ptr+copylen,
+ ccb->csio.dxfer_len - copylen );
break;
}
case MODE_SENSE_6:
@@ -1182,18 +1187,24 @@
struct scsi_mode_hdr_6 hd;
struct scsi_mode_block_descr bd;
struct scsi_control_page cp;
- } *mpd;
+ } mpd;
+ size_t copylen = MIN(sizeof(mpd), ccb->csio.dxfer_len);
u_int8_t page;
- mpd = (struct mpd_data *)ccb->csio.data_ptr;
- bzero(mpd, sizeof(struct mpd_data));
- mpd->hd.datalen = sizeof(struct scsi_mode_hdr_6) +
+ /*mpd = (struct mpd_data *)ccb->csio.data_ptr;*/
+ bzero(&mpd, sizeof(mpd));
+ mpd.hd.datalen = sizeof(struct scsi_mode_hdr_6) +
sizeof(struct scsi_mode_block_descr);
- mpd->hd.dev_specific = (gdt->sc_hdr[t].hd_devtype & 2) ? 0x80 : 0;
- mpd->hd.block_descr_len = sizeof(struct scsi_mode_block_descr);
- mpd->bd.block_len[0] = (GDT_SECTOR_SIZE & 0x00ff0000) >> 16;
- mpd->bd.block_len[1] = (GDT_SECTOR_SIZE & 0x0000ff00) >> 8;
- mpd->bd.block_len[2] = (GDT_SECTOR_SIZE & 0x000000ff);
+ mpd.hd.dev_specific = (gdt->sc_hdr[t].hd_devtype & 2) ? 0x80 : 0;
+ mpd.hd.block_descr_len = sizeof(struct scsi_mode_block_descr);
+ mpd.bd.block_len[0] = (GDT_SECTOR_SIZE & 0x00ff0000) >> 16;
+ mpd.bd.block_len[1] = (GDT_SECTOR_SIZE & 0x0000ff00) >> 8;
+ mpd.bd.block_len[2] = (GDT_SECTOR_SIZE & 0x000000ff);
+
+ bcopy(&mpd, ccb->csio.data_ptr, copylen );
+ if( ccb->csio.dxfer_len > copylen )
+ bzero( ccb->csio.data_ptr+copylen,
+ ccb->csio.dxfer_len - copylen );
page=((struct scsi_mode_sense_6 *)ccb->csio.cdb_io.cdb_bytes)->page;
switch (page) {
default:
@@ -1204,12 +1215,17 @@
}
case READ_CAPACITY:
{
- struct scsi_read_capacity_data *rcd;
+ struct scsi_read_capacity_data rcd;
+ size_t copylen = MIN(sizeof(rcd), ccb->csio.dxfer_len);
- rcd = (struct scsi_read_capacity_data *)ccb->csio.data_ptr;
- bzero(rcd, sizeof(struct scsi_read_capacity_data));
- scsi_ulto4b(gdt->sc_hdr[t].hd_size - 1, rcd->addr);
- scsi_ulto4b(GDT_SECTOR_SIZE, rcd->length);
+ /*rcd = (struct scsi_read_capacity_data *)ccb->csio.data_ptr;*/
+ bzero(&rcd, sizeof(rcd));
+ scsi_ulto4b(gdt->sc_hdr[t].hd_size - 1, rcd.addr);
+ scsi_ulto4b(GDT_SECTOR_SIZE, rcd.length);
+ bcopy(&rcd, ccb->csio.data_ptr, copylen );
+ if( ccb->csio.dxfer_len > copylen )
+ bzero( ccb->csio.data_ptr+copylen,
+ ccb->csio.dxfer_len - copylen );
break;
}
default:
==== //depot/projects/dtrace/src/sys/dev/usb/ehci.c#10 (text+ko) ====
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/ehci.c,v 1.56 2007/08/12 18:45:24 truckman Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/ehci.c,v 1.57 2008/01/08 23:48:30 attilio Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1560,7 +1560,7 @@
}
DPRINTFN(2,("ehci_sync_hc: enter\n"));
/* get doorbell */
- lockmgr(&sc->sc_doorbell_lock, LK_EXCLUSIVE, NULL, NULL);
+ lockmgr(&sc->sc_doorbell_lock, LK_EXCLUSIVE, NULL, curthread);
s = splhardusb();
/* ask for doorbell */
EOWRITE4(sc, EHCI_USBCMD, EOREAD4(sc, EHCI_USBCMD) | EHCI_CMD_IAAD);
@@ -1571,7 +1571,7 @@
EOREAD4(sc, EHCI_USBCMD), EOREAD4(sc, EHCI_USBSTS)));
splx(s);
/* release doorbell */
- lockmgr(&sc->sc_doorbell_lock, LK_RELEASE, NULL, NULL);
+ lockmgr(&sc->sc_doorbell_lock, LK_RELEASE, NULL, curthread);
#ifdef DIAGNOSTIC
if (error)
printf("ehci_sync_hc: tsleep() = %d\n", error);
==== //depot/projects/dtrace/src/sys/dev/usb/if_udav.c#7 (text+ko) ====
@@ -1,6 +1,6 @@
/* $NetBSD: if_udav.c,v 1.2 2003/09/04 15:17:38 tsutsui Exp $ */
/* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */
-/* $FreeBSD: src/sys/dev/usb/if_udav.c,v 1.33 2007/07/24 14:44:23 imp Exp $ */
+/* $FreeBSD: src/sys/dev/usb/if_udav.c,v 1.34 2008/01/08 23:48:30 attilio Exp $ */
/*-
* Copyright (c) 2003
* Shingo WATANABE <nabe at nabechan.org>. All rights reserved.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/if_udav.c,v 1.33 2007/07/24 14:44:23 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/if_udav.c,v 1.34 2008/01/08 23:48:30 attilio Exp $");
#include "opt_inet.h"
#if defined(__NetBSD__)
@@ -1780,7 +1780,7 @@
#if defined(__NetBSD__)
lockmgr(&sc->sc_mii_lock, LK_EXCLUSIVE, NULL);
#elif defined(__FreeBSD__)
- lockmgr(&sc->sc_mii_lock, LK_EXCLUSIVE, NULL, NULL);
+ lockmgr(&sc->sc_mii_lock, LK_EXCLUSIVE, NULL, curthread);
#endif
}
@@ -1793,7 +1793,7 @@
#if defined(__NetBSD__)
lockmgr(&sc->sc_mii_lock, LK_RELEASE, NULL);
#elif defined(__FreeBSD__)
- lockmgr(&sc->sc_mii_lock, LK_RELEASE, NULL, NULL);
+ lockmgr(&sc->sc_mii_lock, LK_RELEASE, NULL, curthread);
#endif
if (--sc->sc_refcnt < 0)
usb_detach_wakeup(sc->sc_dev);
==== //depot/projects/dtrace/src/sys/fs/hpfs/hpfs_subr.h#4 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/fs/hpfs/hpfs_subr.h,v 1.3 2004/12/06 20:14:20 phk Exp $
+ * $FreeBSD: src/sys/fs/hpfs/hpfs_subr.h,v 1.4 2008/01/08 23:48:31 attilio Exp $
*/
#define hpfs_bmmarkfree(hpmp, bn,bl) hpfs_bmmark(hpmp, bn, bl, 1)
@@ -78,8 +78,10 @@
hpfs_breadstruct(hpmp, lsn, D_BSIZE, D_MAGIC, bpp)
#if 0
-#define hpfs_hplock(hp, p) lockmgr(&(hp)->h_intlock, LK_EXCLUSIVE, (p), NULL)
-#define hpfs_hpunlock(hp, p) lockmgr(&(hp)->h_intlock, LK_RELEASE, (p), NULL)
+#define hpfs_hplock(hp, p) \
+ lockmgr(&(hp)->h_intlock, LK_EXCLUSIVE, (p), curthread)
+#define hpfs_hpunlock(hp, p) \
+ lockmgr(&(hp)->h_intlock, LK_RELEASE, (p), curthread)
#endif
int hpfs_hpbmap (struct hpfsnode *, daddr_t, daddr_t *, int *);
==== //depot/projects/dtrace/src/sys/fs/ntfs/ntfs_subr.c#5 (text+ko) ====
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/fs/ntfs/ntfs_subr.c,v 1.42 2006/11/20 19:28:36 le Exp $
+ * $FreeBSD: src/sys/fs/ntfs/ntfs_subr.c,v 1.43 2008/01/08 23:48:31 attilio Exp $
*/
#include <sys/param.h>
@@ -359,7 +359,7 @@
mtx_lock(&ip->i_interlock);
ip->i_usecount++;
lockmgr(&ip->i_lock, LK_EXCLUSIVE | LK_INTERLOCK, &ip->i_interlock,
- NULL);
+ curthread);
return 0;
}
@@ -391,7 +391,7 @@
return (0);
}
} while (lockmgr(&ntfs_hashlock, LK_EXCLUSIVE | LK_SLEEPFAIL, NULL,
- NULL));
+ curthread));
MALLOC(ip, struct ntnode *, sizeof(struct ntnode), M_NTFSNTNODE,
M_WAITOK | M_ZERO);
@@ -413,7 +413,7 @@
ntfs_nthashins(ip);
- lockmgr(&ntfs_hashlock, LK_RELEASE, NULL, NULL);
+ lockmgr(&ntfs_hashlock, LK_RELEASE, NULL, curthread);
*ipp = ip;
@@ -450,7 +450,7 @@
if (ip->i_usecount > 0) {
lockmgr(&ip->i_lock, LK_RELEASE|LK_INTERLOCK, &ip->i_interlock,
- NULL);
+ curthread);
return;
}
@@ -1982,7 +1982,7 @@
struct vnode *vp;
/* get exclusive access */
- lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, NULL);
+ lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, curthread);
/* only read the translation data from a file if it hasn't been
* read already */
@@ -2005,7 +2005,7 @@
out:
ntfs_toupper_usecount++;
- lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, NULL);
+ lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, curthread);
return (error);
}
@@ -2017,7 +2017,7 @@
ntfs_toupper_unuse()
{
/* get exclusive access */
- lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, NULL);
+ lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, curthread);
ntfs_toupper_usecount--;
if (ntfs_toupper_usecount == 0) {
@@ -2032,7 +2032,7 @@
#endif
/* release the lock */
- lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, NULL);
+ lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, curthread);
}
int
==== //depot/projects/dtrace/src/sys/kern/kern_lock.c#14 (text+ko) ====
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_lock.c,v 1.116 2007/12/28 00:38:13 attilio Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_lock.c,v 1.118 2008/01/09 00:02:43 attilio Exp $");
#include "opt_ddb.h"
#include "opt_global.h"
@@ -105,7 +105,7 @@
panic("lockmgr locks do not support sleep interlocking");
}
-#define COUNT(td, x) if ((td)) (td)->td_locks += (x)
+#define COUNT(td, x) ((td)->td_locks += (x))
#define LK_ALL (LK_HAVE_EXCL | LK_WANT_EXCL | LK_WANT_UPGRADE | \
LK_SHARE_NONZERO | LK_WAIT_NONZERO)
@@ -194,24 +194,18 @@
{
int error;
- struct thread *thr;
int extflags, lockflags;
int contested = 0;
uint64_t waitstart = 0;
/*
- * Lock owner can only be curthread or, at least, NULL in order to
- * have a deadlock free implementation of the primitive.
+ * Lock owner can only be curthread in order to have a deadlock
+ * free implementation of the primitive.
*/
- KASSERT(td == NULL || td == curthread,
- ("lockmgr: owner thread (%p) cannot differ from curthread or NULL",
- td));
+ KASSERT(td == curthread,
+ ("lockmgr: owner thread (%p) cannot differ from curthread", td));
error = 0;
- if (td == NULL)
- thr = LK_KERNPROC;
- else
- thr = td;
if ((flags & LK_INTERNAL) == 0)
mtx_lock(lkp->lk_interlock);
@@ -260,7 +254,7 @@
* lock requests or upgrade requests ( but not the exclusive
* lock itself ).
*/
- if (lkp->lk_lockholder != thr) {
+ if (lkp->lk_lockholder != td) {
lockflags = LK_HAVE_EXCL;
if (td != NULL && !(td->td_pflags & TDP_DEADLKTREAT))
lockflags |= LK_WANT_EXCL | LK_WANT_UPGRADE;
@@ -286,10 +280,10 @@
/* FALLTHROUGH downgrade */
case LK_DOWNGRADE:
- KASSERT(lkp->lk_lockholder == thr && lkp->lk_exclusivecount != 0,
+ KASSERT(lkp->lk_lockholder == td && lkp->lk_exclusivecount != 0,
("lockmgr: not holding exclusive lock "
"(owner thread (%p) != thread (%p), exlcnt (%d) != 0",
- lkp->lk_lockholder, thr, lkp->lk_exclusivecount));
+ lkp->lk_lockholder, td, lkp->lk_exclusivecount));
sharelock(td, lkp, lkp->lk_exclusivecount);
COUNT(td, -lkp->lk_exclusivecount);
lkp->lk_exclusivecount = 0;
@@ -308,7 +302,7 @@
* after the upgrade). If we return an error, the file
* will always be unlocked.
*/
- if (lkp->lk_lockholder == thr)
+ if (lkp->lk_lockholder == td)
panic("lockmgr: upgrade exclusive lock");
if (lkp->lk_sharecount <= 0)
panic("lockmgr: upgrade without shared");
@@ -342,7 +336,7 @@
if (lkp->lk_exclusivecount != 0)
panic("lockmgr: non-zero exclusive count");
lkp->lk_flags |= LK_HAVE_EXCL;
- lkp->lk_lockholder = thr;
+ lkp->lk_lockholder = td;
lkp->lk_exclusivecount = 1;
COUNT(td, 1);
lock_profile_obtain_lock_success(&lkp->lk_object, contested, waitstart, file, line);
@@ -362,7 +356,7 @@
/* FALLTHROUGH exclusive request */
case LK_EXCLUSIVE:
- if (lkp->lk_lockholder == thr && thr != LK_KERNPROC) {
+ if (lkp->lk_lockholder == td) {
/*
* Recursive lock.
*/
@@ -400,7 +394,7 @@
break;
}
lkp->lk_flags |= LK_HAVE_EXCL;
- lkp->lk_lockholder = thr;
+ lkp->lk_lockholder = td;
if (lkp->lk_exclusivecount != 0)
panic("lockmgr: non-zero exclusive count");
lkp->lk_exclusivecount = 1;
@@ -413,10 +407,10 @@
case LK_RELEASE:
if (lkp->lk_exclusivecount != 0) {
- if (lkp->lk_lockholder != thr &&
+ if (lkp->lk_lockholder != td &&
lkp->lk_lockholder != LK_KERNPROC) {
panic("lockmgr: thread %p, not %s %p unlocking",
- thr, "exclusive lock holder",
+ td, "exclusive lock holder",
lkp->lk_lockholder);
}
if (lkp->lk_lockholder != LK_KERNPROC)
@@ -433,7 +427,7 @@
shareunlock(td, lkp, 1);
else {
printf("lockmgr: thread %p unlocking unheld lock\n",
- thr);
+ td);
kdb_backtrace();
}
@@ -448,14 +442,14 @@
* check for holding a shared lock, but at least we can
* check for an exclusive one.
*/
- if (lkp->lk_lockholder == thr)
+ if (lkp->lk_lockholder == td)
panic("lockmgr: draining against myself");
error = acquiredrain(lkp, extflags);
if (error)
break;
lkp->lk_flags |= LK_DRAINING | LK_HAVE_EXCL;
- lkp->lk_lockholder = thr;
+ lkp->lk_lockholder = td;
lkp->lk_exclusivecount = 1;
COUNT(td, 1);
#if defined(DEBUG_LOCKS)
@@ -544,6 +538,31 @@
}
/*
+ * Disown the lockmgr.
+ */
+void
+lockmgr_disown(struct lock *lkp)
+{
+ struct thread *td;
+
+ td = curthread;
+ KASSERT(lkp->lk_exclusivecount,
+ ("%s: %p lockmgr must be exclusively locked", __func__, lkp));
+ KASSERT(lkp->lk_lockholder == td || lkp->lk_lockholder == LK_KERNPROC,
+ ("%s: %p lockmgr must be locked by curthread (%p)", __func__, lkp,
+ td));
+
+ /*
+ * Drop the lock reference and switch the owner. This will result
+ * in an atomic operation like td_lock is only accessed by curthread
+ * and lk_lockholder only needs one write.
+ */
+ if (lkp->lk_lockholder == td)
+ td->td_locks--;
+ lkp->lk_lockholder = LK_KERNPROC;
+}
+
+/*
* Determine the status of a lock.
*/
int
==== //depot/projects/dtrace/src/sys/sys/buf.h#6 (text+ko) ====
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* @(#)buf.h 8.9 (Berkeley) 3/30/95
- * $FreeBSD: src/sys/sys/buf.h,v 1.196 2007/03/08 06:44:34 julian Exp $
+ * $FreeBSD: src/sys/sys/buf.h,v 1.197 2008/01/08 23:48:31 attilio Exp $
*/
#ifndef _SYS_BUF_H_
@@ -340,11 +340,8 @@
static __inline void
BUF_KERNPROC(struct buf *bp)
{
- struct thread *td = curthread;
- if (!TD_IS_IDLETHREAD(td) && bp->b_lock.lk_lockholder == td)
- td->td_locks--;
- bp->b_lock.lk_lockholder = LK_KERNPROC;
+ lockmgr_disown(&bp->b_lock);
}
#endif
/*
==== //depot/projects/dtrace/src/sys/sys/lockmgr.h#10 (text+ko) ====
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)lock.h 8.12 (Berkeley) 5/19/95
- * $FreeBSD: src/sys/sys/lockmgr.h,v 1.55 2007/12/28 00:38:13 attilio Exp $
+ * $FreeBSD: src/sys/sys/lockmgr.h,v 1.56 2008/01/08 23:48:31 attilio Exp $
*/
#ifndef _SYS_LOCKMGR_H_
@@ -197,6 +197,7 @@
int _lockmgr(struct lock *, u_int flags,
struct mtx *, struct thread *p, char *file, int line);
+void lockmgr_disown(struct lock *);
void lockmgr_printinfo(struct lock *);
int lockstatus(struct lock *, struct thread *);
int lockcount(struct lock *);
==== //depot/projects/dtrace/src/sys/sys/mbuf.h#12 (text+ko) ====
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*
* @(#)mbuf.h 8.5 (Berkeley) 2/19/95
- * $FreeBSD: src/sys/sys/mbuf.h,v 1.218 2007/12/25 14:17:16 wkoszek Exp $
+ * $FreeBSD: src/sys/sys/mbuf.h,v 1.219 2008/01/09 06:29:49 kmacy Exp $
*/
#ifndef _SYS_MBUF_H_
@@ -496,8 +496,11 @@
static __inline void
m_free_fast(struct mbuf *m)
{
- KASSERT(SLIST_EMPTY(&m->m_pkthdr.tags), ("doing fast free of mbuf with tags"));
-
+#ifdef INVARIANTS
+ if (m->m_flags & M_PKTHDR)
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list