PERFORCE change 31807 for review
Peter Wemm
peter at FreeBSD.org
Sat May 24 11:36:30 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=31807
Change 31807 by peter at peter_overcee on 2003/05/24 11:35:32
IFC @31806
Affected files ...
.. //depot/projects/hammer/libexec/Makefile#17 integrate
.. //depot/projects/hammer/libexec/rtld-elf/amd64/reloc.c#8 integrate
.. //depot/projects/hammer/libexec/rtld-elf/amd64/rtld_start.S#11 integrate
.. //depot/projects/hammer/share/man/man4/usb.4#4 integrate
.. //depot/projects/hammer/share/man/man9/vnode.9#4 integrate
Differences ...
==== //depot/projects/hammer/libexec/Makefile#17 (text+ko) ====
@@ -1,5 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/4/93
-# $FreeBSD: src/libexec/Makefile,v 1.61 2003/05/19 15:51:59 des Exp $
+# $FreeBSD: src/libexec/Makefile,v 1.62 2003/05/24 17:38:45 peter Exp $
# Present but disabled: kpasswdd
SUBDIR= atrun \
==== //depot/projects/hammer/libexec/rtld-elf/amd64/reloc.c#8 (text+ko) ====
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/libexec/rtld-elf/amd64/reloc.c,v 1.12 2003/03/14 21:10:12 kan Exp $
+ * $FreeBSD: src/libexec/rtld-elf/amd64/reloc.c,v 1.13 2003/05/24 17:37:51 peter Exp $
*/
/*
==== //depot/projects/hammer/libexec/rtld-elf/amd64/rtld_start.S#11 (text+ko) ====
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/libexec/rtld-elf/amd64/rtld_start.S,v 1.3 1999/08/28 00:10:15 peter Exp $
+ * $FreeBSD: src/libexec/rtld-elf/amd64/rtld_start.S,v 1.4 2003/05/24 17:37:51 peter Exp $
*/
.text
==== //depot/projects/hammer/share/man/man4/usb.4#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/share/man/man4/usb.4,v 1.27 2003/02/15 19:17:30 trhodes Exp $
+.\" $FreeBSD: src/share/man/man4/usb.4,v 1.28 2003/05/24 18:28:18 hmp Exp $
.\"
.Dd February 21, 1999
.Dt USB 4
@@ -178,42 +178,47 @@
This command can be used to retrieve some information about a device
on the bus.
The
-.Va addr
+.Va udi_addr
field should be filled before the call and the other fields will
be filled by information about the device on that address.
Should no such device exist, an error is reported.
.Bd -literal
+#define USB_MAX_DEVNAMES 4
+#define USB_MAX_DEVNAMELEN 16
struct usb_device_info {
- u_int8_t bus;
- u_int8_t addr;
- usb_event_cookie_t cookie;
- char product[USB_MAX_STRING_LEN];
- char vendor[USB_MAX_STRING_LEN];
- char release[8];
- u_int16_t productNo;
- u_int16_t vendorNo;
- u_int16_t releaseNo;
- u_int8_t class;
- u_int8_t subclass;
- u_int8_t protocol;
- u_int8_t config;
- u_int8_t lowspeed;
- int power;
- int nports;
- char devnames[USB_MAX_DEVNAMES][USB_MAX_DEVNAMELEN];
- u_int8_t ports[16];
-#define USB_PORT_ENABLED 0xff
-#define USB_PORT_SUSPENDED 0xfe
-#define USB_PORT_POWERED 0xfd
-#define USB_PORT_DISABLED 0xfc
+ u_int8_t udi_bus;
+ u_int8_t udi_addr; /* device address */
+ usb_event_cookie_t udi_cookie;
+ char udi_product[USB_MAX_STRING_LEN];
+ char udi_vendor[USB_MAX_STRING_LEN];
+ char udi_release[8];
+ u_int16_t udi_productNo;
+ u_int16_t udi_vendorNo;
+ u_int16_t udi_releaseNo;
+ u_int8_t udi_class;
+ u_int8_t udi_subclass;
+ u_int8_t udi_protocol;
+ u_int8_t udi_config;
+ u_int8_t udi_speed;
+#define USB_SPEED_LOW 1
+#define USB_SPEED_FULL 2
+#define USB_SPEED_HIGH 3
+ int udi_power;/* power consumption in mA, 0 if selfpowered */
+ int udi_nports;
+ char udi_devnames[USB_MAX_DEVNAMES][USB_MAX_DEVNAMELEN];
+ u_int8_t udi_ports[16];/* hub only: addresses of devices on ports */
+#define USB_PORT_ENABLED 0xff
+#define USB_PORT_SUSPENDED 0xfe
+#define USB_PORT_POWERED 0xfd
+#define USB_PORT_DISABLED 0xfc
};
.Ed
.Pp
-.Va bus
+.Va udi_bus
and
-.Va addr
+.Va udi_addr
contain the topological information for the device.
-.Va devnames
+.Va udi_devnames
contains the device names of the connected drivers.
For example, the
third
@@ -221,30 +226,34 @@
Zip drive connected will be
.Li umass2 .
The
-.Va product , vendor
+.Va udi_product , udi_vendor
and
-.Va release
+.Va udi_release
fields contain self-explanatory descriptions of the device.
-.Va productNo , vendorNo , releaseNo , class , subclass
+.Va udi_productNo , udi_vendorNo , udi_releaseNo , udi_class , udi_subclass
and
-.Va protocol
+.Va udi_protocol
contain the corresponding values from the device descriptors.
The
-.Va config
+.Va udi_config
field shows the current configuration of the device.
.Pp
-.Va lowspeed
-indicates whether the device is a full speed (0) or low speed (1)
-device.
+.Va udi_peed
+indicates whether the device is at low speed
+.Pq Dv USB_SPEED_LOW ,
+full speed
+.Pq Dv USB_SPEED_FULL
+or high speed
+.Pq Dv USB_SPEED_HIGH .
The
-.Va power
+.Va udi_power
field shows the power consumption in milli-amps drawn at 5 volts,
or zero if the device is self powered.
.Pp
If the device is a hub, the
-.Va nports
+.Va udi_nports
field is non-zero, and the
-.Va ports
+.Va udi_ports
field contains the addresses of the connected devices.
If no device is connected to a port, one of the
.Dv USB_PORT_*
@@ -253,12 +262,12 @@
This command retrieves statistics about the controller.
.Bd -literal
struct usb_device_stats {
- u_long requests[4];
+ u_long uds_requests[4];
};
.Ed
.Pp
The
-.Va requests
+.Va udi_requests
field is indexed by the transfer kind, i.e.\&
.Dv UE_* ,
and indicates how many transfers of each kind that has been completed
@@ -337,6 +346,15 @@
a device, or a device driver.
The union contains information
pertinent to the different types of events.
+Macros,
+.Fn USB_EVENT_IS_ATTACH "ue_type"
+and
+.Fn USB_EVENT_IS_DETACH "ue_type"
+can be used to determine if an event was an
+.Dq attach
+or a
+.Dq detach
+request.
.Pp
The
.Va ue_bus
@@ -373,7 +391,7 @@
.Tn USB
specifications can be found at:
.Pp
-.D1 Pa http://www.usb.org/developers/docs.html
+.D1 Pa http://www.usb.org/developers/docs/
.Pp
.Xr aue 4 ,
.Xr cue 4 ,
==== //depot/projects/hammer/share/man/man9/vnode.9#4 (text+ko) ====
@@ -1,5 +1,3 @@
-.\" -*- nroff -*-
-.\"
.\" Copyright (c) 1996 Doug Rabson
.\"
.\" All rights reserved.
@@ -26,9 +24,9 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man9/vnode.9,v 1.24 2003/03/06 23:55:51 ceri Exp $
+.\" $FreeBSD: src/share/man/man9/vnode.9,v 1.25 2003/05/24 18:19:11 hmp Exp $
.\"
-.Dd June 30, 1999
+.Dd May 20, 2003
.Os
.Dt VNODE 9
.Sh NAME
@@ -37,114 +35,20 @@
.Sh SYNOPSIS
.In sys/param.h
.In sys/vnode.h
-.Pp
-.Bd -literal
-/*
- * Vnode types. VNON means no type.
- */
-enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD };
-
-/*
- * Each underlying file system allocates its own private area and hangs
- * it from v_data. If non-null, this area is freed in getnewvnode().
- */
-TAILQ_HEAD(buflists, buf);
-
-typedef int vop_t(void *);
-struct namecache;
-
-/*
- * Reading or writing any of these items requires holding the appropriate lock.
- * v_freelist is locked by the global vnode_free_list simple lock.
- * v_mntvnodes is locked by the global mntvnodes simple lock.
- * v_flag, v_usecount, v_holdcount and v_writecount are
- * locked by the v_interlock simple lock.
- * v_pollinfo is locked by the lock contained inside it.
- */
-struct vnode {
- u_long v_flag; /* vnode flags (see below) */
- int v_usecount; /* reference count of users */
- int v_writecount; /* reference count of writers */
- int v_holdcnt; /* page & buffer references */
- u_long v_id; /* capability identifier */
- struct mount *v_mount; /* ptr to vfs we are in */
- vop_t **v_op; /* vnode operations vector */
- TAILQ_ENTRY(vnode) v_freelist; /* vnode freelist */
- LIST_ENTRY(vnode) v_mntvnodes; /* vnodes for mount point */
- struct buflists v_cleanblkhd; /* clean blocklist head */
- struct buflists v_dirtyblkhd; /* dirty blocklist head */
- LIST_ENTRY(vnode) v_synclist; /* vnodes with dirty buffers */
- long v_numoutput; /* num of writes in progress */
- enum vtype v_type; /* vnode type */
- union {
- struct mount *vu_mountedhere;/* ptr to mounted vfs (VDIR) */
- struct socket *vu_socket; /* unix ipc (VSOCK) */
- struct {
- struct specinfo *vu_specinfo; /* device (VCHR, VBLK) */
- SLIST_ENTRY(vnode) vu_specnext;
- } vu_spec;
- struct fifoinfo *vu_fifoinfo; /* fifo (VFIFO) */
- } v_un;
- struct nqlease *v_lease; /* Soft reference to lease */
- daddr_t v_lastw; /* last write (write cluster) */
- daddr_t v_cstart; /* start block of cluster */
- daddr_t v_lasta; /* last allocation */
- int v_clen; /* length of current cluster */
- struct vm_object *v_object; /* Place to store VM object */
- struct simplelock v_interlock; /* lock on usecount and flag */
- struct lock *v_vnlock; /* used for non-locking fs's */
- const char *v_tag; /* type of underlying data */
- void *v_data; /* private data for fs */
- LIST_HEAD(, namecache) v_cache_src; /* Cache entries from us */
- TAILQ_HEAD(, namecache) v_cache_dst; /* Cache entries to us */
- struct vnode *v_dd; /* .. vnode */
- u_long v_ddid; /* .. capability identifier */
- struct {
- struct simplelock vpi_lock; /* lock to protect below */
- struct selinfo vpi_selinfo; /* identity of poller(s) */
- short vpi_events; /* what they are looking for */
- short vpi_revents; /* what has happened */
- } v_pollinfo;
-};
-#define v_mountedhere v_un.vu_mountedhere
-#define v_socket v_un.vu_socket
-#define v_rdev v_un.vu_spec.vu_specinfo
-#define v_specnext v_un.vu_spec.vu_specnext
-#define v_fifoinfo v_un.vu_fifoinfo
-
-/*
- * Vnode flags.
- */
-#define VROOT 0x00001 /* root of its file system */
-#define VTEXT 0x00002 /* vnode is a pure text prototype */
-#define VSYSTEM 0x00004 /* vnode being used by kernel */
-#define VISTTY 0x00008 /* vnode represents a tty */
-#define VXLOCK 0x00100 /* vnode is locked to change underlying type */
-#define VXWANT 0x00200 /* process is waiting for vnode */
-#define VBWAIT 0x00400 /* waiting for output to complete */
-#define VOBJBUF 0x02000 /* Allocate buffers in VM object */
-#define VAGE 0x08000 /* Insert vnode at head of free list */
-#define VOLOCK 0x10000 /* vnode is locked waiting for an object */
-#define VOWANT 0x20000 /* a process is waiting for VOLOCK */
-#define VDOOMED 0x40000 /* This vnode is being recycled */
-#define VFREE 0x80000 /* This vnode is on the freelist */
-#define VTBFREE 0x100000 /* This vnode is on the to-be-freelist */
-#define VONWORKLST 0x200000 /* On syncer work-list */
-#define VMOUNT 0x400000 /* Mount in progress */
-
-.Ed
.Sh DESCRIPTION
The vnode is the focus of all file activity in
.Ux .
+A vnode is described by
+.Vt "struct vnode" .
There is a
unique vnode allocated for each active file, each current directory,
each mounted-on file, text file, and the root.
.Pp
Each vnode has three reference counts,
-.Dv v_usecount ,
-.Dv v_holdcnt
+.Va v_usecount ,
+.Va v_holdcnt
and
-.Dv v_writecount .
+.Va v_writecount .
The first is the number of clients within the kernel which are
using this vnode. This count is maintained by
.Xr vref 9 ,
@@ -158,9 +62,9 @@
and
.Xr vdrop 9 .
When both the
-.Dv v_usecount
+.Va v_usecount
and the
-.Dv v_holdcnt
+.Va v_holdcnt
of a vnode reaches zero then the vnode will be put on the freelist
and may be reused for another file, possibly in another file system.
The transition to and from the freelist is handled by
@@ -180,7 +84,7 @@
.Xr VOP_LOOKUP 9
etc.)
will increase the
-.Dv v_usecount
+.Va v_usecount
of the vnode by one. When the caller is finished with the vnode, it
should release this reference by calling
.Xr vrele 9
@@ -189,17 +93,17 @@
if the vnode is locked).
.Pp
Other commonly used members of the vnode structure are
-.Dv v_id
+.Va v_id
which is used to maintain consistency in the name cache,
-.Dv v_mount
+.Va v_mount
which points at the file system which owns the vnode,
-.Dv v_type
+.Va v_type
which contains the type of object the vnode represents and
-.Dv v_data
+.Va v_data
which is used by file systems to store file system specific data with
the vnode.
The
-.Dv v_op
+.Va v_op
field is used by the
.Dv VOP_*
macros to call functions in the file system which implement the vnode's
More information about the p4-projects
mailing list