diff options
Diffstat (limited to 'share/man/man9')
-rw-r--r-- | share/man/man9/Makefile | 14 | ||||
-rw-r--r-- | share/man/man9/buf.9 | 123 | ||||
-rw-r--r-- | share/man/man9/malloc.9 | 62 | ||||
-rw-r--r-- | share/man/man9/microseq.9 | 118 | ||||
-rw-r--r-- | share/man/man9/ppbconf.9 | 205 | ||||
-rw-r--r-- | share/man/man9/sleep.9 | 116 | ||||
-rw-r--r-- | share/man/man9/spl.9 | 4 |
7 files changed, 23 insertions, 619 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 6a8e09f36842..6d1f81e1a1a3 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.42 1998/12/22 19:47:48 dillon Exp $ +# $Id: Makefile,v 1.38 1998/09/15 10:26:57 gibbs Exp $ MAN9= MD5.9 \ VFS.9 VFS_FHTOVP.9 VFS_INIT.9 VFS_MOUNT.9 VFS_QUOTACTL.9 \ @@ -11,10 +11,10 @@ MAN9= MD5.9 \ VOP_PATHCONF.9 VOP_PRINT.9 VOP_RDWR.9 VOP_READDIR.9 \ VOP_READLINK.9 VOP_REALLOCBLKS.9 VOP_REMOVE.9 VOP_RENAME.9 \ VOP_STRATEGY.9 \ - at_exit.9 at_fork.9 at_shutdown.9 bios.9 boot.9 buf.9 cd.9 copy.9 \ + at_exit.9 at_fork.9 at_shutdown.9 bios.9 boot.9 cd.9 copy.9 \ devfs_add_devswf.9 devfs_link.9 devfs_remove_dev.9 devstat.9 \ - fetch.9 ifnet.9 inittodr.9 intro.9 kernacc.9 malloc.9 microseq.9 \ - mi_switch.9 namei.9 panic.9 physio.9 posix4.9 ppbconf.9 psignal.9 \ + fetch.9 ifnet.9 inittodr.9 intro.9 kernacc.9 malloc.9 \ + mi_switch.9 namei.9 panic.9 physio.9 posix4.9 psignal.9 \ resettodr.9 rtalloc.9 rtentry.9 scsiconf.9 sd.9 sleep.9 spl.9 st.9 \ store.9 style.9 suser.9 time.9 timeout.9 uio.9 \ vget.9 vnode.9 vput.9 vref.9 vrele.9 vslock.9 @@ -53,9 +53,7 @@ MLINKS+=at_exit.9 rm_at_exit.9 MLINKS+=at_fork.9 rm_at_fork.9 MLINKS+=at_shutdown.9 rm_at_shutdown.9 MLINKS+=copy.9 copyin.9 copy.9 copyinstr.9 copy.9 copyout.9 copy.9 copystr.9 -MLINKS+=devstat.9 devicestat.9 devstat.9 devstat_add_entry.9 -MLINKS+=devstat.9 devstat_remove_entry.9 devstat.9 devstat_start_transaction.9 -MLINKS+=devstat.9 devstat_end_transaction.9 +MLINKS+=devstat.9 devicestat.9 MLINKS+=fetch.9 fubyte.9 fetch.9 fuswintr.9 fetch.9 fusword.9 fetch.9 fuword.9 MLINKS+=ifnet.9 if_data.9 ifnet.9 ifaddr.9 ifnet.9 ifqueue.9 MLINKS+=kernacc.9 useracc.9 @@ -65,8 +63,6 @@ MLINKS+=posix4.9 p1003_1b.9 MLINKS+=psignal.9 gsignal.9 psignal.9 pgsignal.9 MLINKS+=rtalloc.9 rtalloc1.9 rtalloc.9 rtalloc_ign.9 MLINKS+=sleep.9 tsleep.9 sleep.9 wakeup.9 sleep.9 wakeup_one.9 -MLINKS+=sleep.9 asleep.9 sleep.9 await.9 -MLINKS+=buf.9 bp.9 MLINKS+=spl.9 spl0.9 MLINKS+=spl.9 splbio.9 spl.9 splclock.9 spl.9 splhigh.9 spl.9 splimp.9 MLINKS+=spl.9 splnet.9 spl.9 splsoftclock.9 spl.9 splsofttty.9 diff --git a/share/man/man9/buf.9 b/share/man/man9/buf.9 deleted file mode 100644 index 869c90e29476..000000000000 --- a/share/man/man9/buf.9 +++ /dev/null @@ -1,123 +0,0 @@ -.\" Copyright (c) 1998 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" $Id: security.7,v 1.1 1998/12/20 20:12:17 dillon Exp $ -.\" -.Dd December 22, 1998 -.Dt BUF 9 -.Os -.Sh NAME -.Nm BUF/BP -.Nd Kernel Buffer I/O scheme used in FreeBSD VM system -.Sh DESCRIPTION -.Pp -The kernel implements a KVM abstraction of the buffer cache which allows it -to map potentially disparate vm_page's into contiguous KVM for use by -(mainly filesystem) devices and device I/O. This abstraction supports -block sizes from DEV_BSIZE (usually 512) to upwards of several pages or more. -It also supports a relatively primitive byte-granular valid range and dirty -range currently hardcoded for use by NFS. The code implementing the -VM Buffer abstraction is mostly concentrated in /usr/src/sys/kern/vfs_bio.c. -.Pp -One of the most important things to remember when dealing with buffer pointers -(struct buf) is that the underlying pages are mapped directly from the buffer -cache. No data copying occurs in the scheme proper, though some filesystems -such as UFS do have to copy a little when dealing with file fragments. The -second most important thing to remember is that due to the underlying page -mapping, the b_data base pointer in a buf is always *page* aligned, not -*block* aligned. When you have a VM buffer representing some b_offset and -b_size, the actual start of the buffer is (b_data + (b_offset & PAGE_MASK)) -and not just b_data. Finally, the VM system's core buffer cache supports -valid and dirty bits (m->valid, m->dirty) for pages in DEV_BSIZE chunks. Thus -a platform with a hardware page size of 4096 bytes has 8 valid and 8 dirty -bits. These bits are generally set and cleared in groups based on the device -block size of the device backing the page. Complete page's worth are often -refered to using the VM_PAGE_BITS_ALL bitmask (i.e. 0xFF if the hardware page -size is 4096). -.Pp -VM buffers also keep track of a byte-granular dirty range and valid range. -This feature is normally only used by the NFS subsystem. I'm not sure why it -is used at all, actually, since we have DEV_BSIZE valid/dirty granularity -within the VM buffer. If a buffer dirty operation creates a 'hole', -the dirty range will extend to cover the hole. If a buffer validation -operation creates a 'hole' the byte-granular valid range is left alone and -will not take into account the new extension. Thus the whole byte-granular -abstraction is considered a bad hack and it would be nice if we could get rid -of it completely. -.Pp -A VM buffer is capable of mapping the underlying VM cache pages into KVM in -order to allow the kernel to directly manipulate the data associated with -the (vnode,b_offset,b_size). The kernel typically unmaps VM buffers the moment -they are no longer needed but often keeps the 'struct buf' structure -instantiated and even bp->b_pages array instantiated despite having unmapped -them from KVM. If a page making up a VM buffer is about to undergo I/O, the -system typically unmaps it from KVM and replaces the page in the b_pages[] -array with a placemarker called bogus_page. The placemarker forces any kernel -subsystems referencing the associated struct buf to re-lookup the associated -page. I believe the placemarker hack is used to allow sophisticated devices -such as filesystem devices to remap underlying pages in order to deal with, -for example, remapping a file fragment into a file block. -.Pp -VM buffers are used to track I/O operations within the kernel. Unfortunately, -the I/O implementation is also somewhat of a hack because the kernel wants -to clear the dirty bit on the underlying pages the moment it queues the I/O -to the VFS device, not when the physical I/O is actually initiated. This -can create confusion within filesystem devices that use delayed-writes because -you wind up with pages marked clean that are actually still dirty. If not -treated carefully, these pages could be thrown away! Indeed, a number of -serious bugs related to this hack were not fixed until the 2.2.8/3.0.0 release. -The kernel uses an instantiated VM buffer (i.e. struct buf) to placemark pages -in this special state. The buffer is typically flagged B_DELWRI. When a -device no longer needs a buffer it typically flags it as B_RELBUF. Due to -the underlying pages being marked clean, the B_DELWRI|B_RELBUF combination must -be interpreted to mean that the buffer is still actually dirty and must be -written to its backing store before it can actually be released. In the case -where B_DELWRI is not set, the underlying dirty pages are still properly -marked as dirty and the buffer can be completely freed without losing that -clean/dirty state information. ( XXX do we have to check other flags in -regards to this situation ??? ). -.Pp -The kernel reserves a portion of its KVM space to hold VM Buffer's data -maps. Even though this is virtual space (since the buffers are mapped -from the buffer cache), we cannot make it arbitrarily large because -instantiated VM Buffers (struct buf's) prevent their underlying pages in the -buffer cache from being freed. This can complicate the life of the paging -system. -.Pp -.Sh SEE ALSO -.Pp -.Xr <fillmein> 9 -.Sh HISTORY -The -.Nm -manual page was originally written by Matthew Dillon and first appeared -in FreeBSD-3.0.1, December 1998. - diff --git a/share/man/man9/malloc.9 b/share/man/man9/malloc.9 index ee32f5b95e6b..bcb69bd53bec 100644 --- a/share/man/man9/malloc.9 +++ b/share/man/man9/malloc.9 @@ -85,7 +85,7 @@ the kernel version takes two more arguments. The argument further qualifies .Fn malloc No Ns 's operational characteristics as follows: -.Bl -tag -width indent +.Bl -tag -offset indent .It Dv M_NOWAIT Causes .Fn malloc @@ -95,45 +95,19 @@ if the request cannot be immediately fulfilled due to resource shortage. Otherwise, .Fn malloc may call sleep to wait for resources to be released by other processes. -If this flag is set, +If this flag is not set, .Fn malloc -will return -.Dv NULL -rather then block. Note that +will never return +.Dv NULL . +Note that .Dv M_WAITOK -is defined to be 0, meaning that blocking operation is the default. -.It Dv M_ASLEEP -Causes -.Fn malloc -to call -.Fn asleep -if the request cannot be immediately fulfilled due to a resource shortage. -M_ASLEEP is not useful alone and should always be or'd with M_NOWAIT to allow -malloc to call -.Fn asleep -and return -.Dv NULL -immediately. It is expected that the caller will at some point call -.Fn await -and then retry the allocation. Depending on the routine in question, the -caller may decide to propogate the temporary failure up the call chain -and actually have some other higher level routine block on the async wait -that -.Fn malloc -queued. -.It Dv M_WAITOK -indicates that it is Ok to wait for resources. It is unconveniently -defined as 0 so care should be taken never to compare against this value -directly or try to AND it as a flag. The default operation is to block -until the memory allocation succeeds. -.Fn malloc -can only return -.Dv NULL -if -.Dv M_NOWAIT -is specified. +is conveniently defined to be 0, and hence may be or'ed into the +.Fa flags +argument to indicate that it's Ok to wait for resources. .El .Pp +Currently, only one flag is defined. +.Pp The .Fa type argument is used to perform statistics on memory usage, and for @@ -163,23 +137,11 @@ malloc_type_t M_FOOBUF = { ... MALLOC(buf, struct foo_buf *, sizeof *buf, M_FOOBUF, M_NOWAIT); -.Ed +.Be .Sh RETURN VALUES .Fn malloc returns a kernel virtual address that is suitably aligned for storage of -any type of object, or -.Dv NULL -if the request could not be satisfied and -.Dv M_NOWAIT -was set. If -.Dv M_ASLEEP -was set and -.Fn malloc -returns -.Dv NULL , -it will call -.Fn asleep -as a side effect. +any type of object. .Sh SEE ALSO .Xr vmstat 8 .Sh DIAGNOSTICS diff --git a/share/man/man9/microseq.9 b/share/man/man9/microseq.9 deleted file mode 100644 index 630f18630089..000000000000 --- a/share/man/man9/microseq.9 +++ /dev/null @@ -1,118 +0,0 @@ -.\" Copyright (c) 1998, Nicolas Souchu -.\" 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. -.\" -.\" -.Dd June 6, 1998 -.Dt MICROSEQ 9 -.Os FreeBSD -.Sh NAME -.Nm microseq -.Nd -ppbus microseqencer developer's guide -.Sh SYNOPSIS -.Fd "#include <dev/ppbus/ppb_msq.h>" -.Sh DESCRIPTION -See -.Xr ppbus 4 -for ppbus description and general info about the microsequencer. -.Pp -The purpose of this document is to encourage developers to use the -microsequencer mechanism in order to have: -.Bl -enum -offset indent -.It -a uniform programming model -.It -efficient code -.El -.Sh INTERFACE -.Ss C structures -.Bd -literal -union ppb_insarg { - int i; - char c; - void *p; - int (* f)(void *, char *); -}; -.Ed -.Bd -literal -struct ppb_microseq { - int opcode; /* microins. opcode */ - union ppb_insarg arg[PPB_MS_MAXARGS]; /* arguments */ -}; -.Ed -.Ss Using microsequences -.Pp -To instanciate a microsequence, just declare an array of ppb_microseq -structures and initialize it as needed. You may either use defined macros -or code directly your microinstructions according to the ppb_microseq -definition. For example, -.Bd -literal - struct ppb_microseq select_microseq[] = { - - /* parameter list - */ - #define SELECT_TARGET MS_PARAM(0, 1, MS_TYP_INT) - #define SELECT_INITIATOR MS_PARAM(3, 1, MS_TYP_INT) - - /* send the select command to the drive */ - MS_DASS(MS_UNKNOWN), - MS_CASS(H_nAUTO | H_nSELIN | H_INIT | H_STROBE), - MS_CASS( H_AUTO | H_nSELIN | H_INIT | H_STROBE), - MS_DASS(MS_UNKNOWN), - MS_CASS( H_AUTO | H_nSELIN | H_nINIT | H_STROBE), - - /* now, wait until the drive is ready */ - MS_SET(VP0_SELTMO), -/* loop: */ MS_BRSET(H_ACK, 3 /* ready */), - MS_DBRA(-1 /* loop */), -/* error: */ MS_RET(1), -/* ready: */ MS_RET(0) - }; -.Ed -.Pp -Here, some parameters are undefined and must be filled before executing -the microsequence. In order to initialize seach a microsequence, one should -use the ppb_MS_init_msq() function like this: -.Bd -literal - ppb_MS_init_msq(select_microseq, 2, - SELECT_TARGET, 1 << target, - SELECT_INITIATOR, 1 << initiator); -.Ed -.Pp -and then execute the microsequence. -.Ss The microsequencer -The microsequencer is executed either at ppbus or adapter level (see -.Xr ppbus 4 -for info about ppbus system layers). -.Sh SEE ALSO -.Xr ppbus 4 -.Sh HISTORY -The -.Nm -manual page first appeared in -.Fx 3.0 . -.Sh AUTHOR -This -manual page was written by -.An Nicolas Souchu . diff --git a/share/man/man9/ppbconf.9 b/share/man/man9/ppbconf.9 deleted file mode 100644 index 9b95e7287593..000000000000 --- a/share/man/man9/ppbconf.9 +++ /dev/null @@ -1,205 +0,0 @@ -.\" Copyright (c) 1998, Nicolas Souchu -.\" 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. -.\" -.\" -.Dd April 5, 1998 -.Dt PPBCONF 9 -.Os FreeBSD -.Sh NAME -.Nm ppbconf -.Nd -ppbus developer's guide -.Sh SYNOPSIS -.Fd "#include <dev/ppbus/ppbconf.h>" -.Sh DESCRIPTION -See -.Xr ppbus 4 -for ppbus description. -.Sh PPBUS STRUCTURES -Each ppbus layer -.Po -.Em adapter , -.Em ppbus -and -.Em device -.Pc -is described by one or more C structure. -.Ss The adapter layer -.Bd -literal -struct ppb_adapter { - - void (*intr_handler)(int); - void (*reset_epp_timeout)(int); - void (*ecp_sync)(int); - - int (*exec_microseq)(int, struct ppb_microseq *, int *); - - int (*setmode)(int, int); - - void (*outsb_epp)(int, char *, int); - void (*outsw_epp)(int, char *, int); - void (*outsl_epp)(int, char *, int); - void (*insb_epp)(int, char *, int); - void (*insw_epp)(int, char *, int); - void (*insl_epp)(int, char *, int); - - char (*r_dtr)(int); - char (*r_str)(int); - char (*r_ctr)(int); - char (*r_epp)(int); - char (*r_ecr)(int); - char (*r_fifo)(int); - - void (*w_dtr)(int, char); - void (*w_str)(int, char); - void (*w_ctr)(int, char); - void (*w_epp)(int, char); - void (*w_ecr)(int, char); - void (*w_fifo)(int, char); -}; -.Ed -.Pp -This structure is the interface between -.Xr ppc 4 -layer and upper ppbus system levels. For each ppc device, this -structure is filled with generic i/o functions that may be redefined if -needed for particular chipsets. -.Pp -Developers are really encouraged to use the -exec_microseq entry to avoid indirect function call overhead. See -.Xr microseq 9 -for more info. -.Ss The ppbus layer -.Bd -literal -struct ppb_driver -{ - struct ppb_device *(*probe)(struct ppb_data *ppb); - int (*attach)(struct ppb_device *pdp); - char *name; -}; -.Ed -.Bd -literal -struct ppb_data { - -#define PPB_PnP_PRINTER 0 -#define PPB_PnP_MODEM 1 -#define PPB_PnP_NET 2 -#define PPB_PnP_HDC 3 -#define PPB_PnP_PCMCIA 4 -#define PPB_PnP_MEDIA 5 -#define PPB_PnP_FDC 6 -#define PPB_PnP_PORTS 7 -#define PPB_PnP_SCANNER 8 -#define PPB_PnP_DIGICAM 9 -#define PPB_PnP_UNKNOWN 10 - int class_id; /* not a PnP device if class_id < 0 */ - - ushort mode; /* IEEE 1284-1994 mode - * NIBBLE, PS2, EPP, ECP */ - ushort avm; /* IEEE 1284-1994 available - * modes */ - - struct ppb_link *ppb_link; /* link to the adapter */ - struct ppb_device *ppb_owner; /* device which owns the bus */ - LIST_HEAD(, ppb_device) ppb_devs; /* list of devices on the bus */ - LIST_ENTRY(ppb_data) ppb_chain; /* list of busses */ -}; -.Ed -.Ss The device layer -.Bd -literal -/* microseqences used for GET/PUT operations */ -struct ppb_xfer { - struct ppb_microseq *prolog; /* loop prologue */ - struct ppb_microseq *body; /* loop body */ - struct ppb_microseq *epilog; /* loop epilogue */ -}; -.Ed -.Bd -literal -struct ppb_context { - int valid; /* 1 if the struct is valid */ - int mode; /* operating mode */ - - struct microseq *curpc; /* pc in curmsq */ - struct microseq *curmsq; /* currently executed microseq */ -}; -.Ed -.Bd -literal -struct ppb_device { - - int id_unit; /* unit of the device */ - char *name; /* name of the device */ - - ushort mode; /* current mode of the device */ - ushort avm; /* available modes of the device */ - - struct ppb_context ctx; /* context of the device */ - - /* mode dependent get msq. If NULL, - * IEEE1284 code is used */ - struct ppb_xfer - get_xfer[PPB_MAX_XFER]; - - /* mode dependent put msq. If NULL, - * IEEE1284 code is used */ - struct ppb_xfer - put_xfer[PPB_MAX_XFER]; - - void (*intr)(int); /* interrupt handler */ - - struct ppb_data *ppb; /* link to the ppbus */ - - LIST_ENTRY(ppb_device) chain; /* list of devices on the bus */ -}; -.Ed -.Ss Linking these structures all together -.Bd -literal -struct ppb_link { - - int adapter_unit; /* unit of the adapter */ - int base; /* base address of the port */ - int id_irq; /* != 0 if irq enabled */ - -#define EPP_1_9 0x0 /* default */ -#define EPP_1_7 0x1 - int epp_protocol; /* EPP protocol: 0=1.9, 1=1.7 */ - - struct ppb_adapter *adapter; /* link to the ppc adapter */ - struct ppb_data *ppbus; /* link to the ppbus */ -}; -.Ed -.Sh EXAMPLE -See vpo.c source file. -.Sh SEE ALSO -.Xr ppbus 4 , -.Xr ppi 4 , -.Xr microseq 9 -.Sh HISTORY -The -.Nm -manual page first appeared in -.Fx 3.0 . -.Sh AUTHOR -This -manual page was written by -.An Nicolas Souchu . diff --git a/share/man/man9/sleep.9 b/share/man/man9/sleep.9 index 2d9410b30a6c..351de02e2cb6 100644 --- a/share/man/man9/sleep.9 +++ b/share/man/man9/sleep.9 @@ -23,16 +23,14 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: sleep.9,v 1.12 1998/12/21 10:34:53 dillon Exp $ +.\" $Id: sleep.9,v 1.9 1997/04/11 17:49:56 bde Exp $ .\" " -.Dd December 17, 1998 +.Dd April 3, 1996 .Os .Dt SLEEP 9 .Sh NAME .Nm sleep , .Nm tsleep , -.Nm asleep , -.Nm await , .Nm wakeup .Nd wait for events .Sh SYNOPSIS @@ -41,10 +39,6 @@ .Fd #include <sys/proc.h> .Ft int .Fn tsleep "void *ident" "int priority" "const char *wmesg" "int timo" -.Ft int -.Fn asleep "void *ident" "int priority" "const char *wmesg" "int timo" -.Ft int -.Fn await "int priority" "int timo" .Ft void .Fn wakeup "void *ident" .Ft void @@ -112,107 +106,10 @@ is returned if the system call should be interrupted by the signal is the traditional form. It doesn't let you specify a timeout nor a .Ar wmesg , hence its use is deprecated. -.Pp -.Nm Asleep -implements the new asynchronous sleep function. It takes the same arguments -as -.Fn tsleep -and places the process on the appropriate wait queue, but -.Fn asleep -leaves the process runnable and returns immediately. The caller is then -expected to, at some point in the future, call -.Fn await -to actually wait for the previously queued wait condition. -If -.Fn asleep -is called several times, only the most recent call is effective. -.Fn asleep -may be called with an -.Ar ident -value of NULL -to remove any previously queued condition. -.Pp -.Nm Await -implements the new asynchronous wait function. When -.Fn asleep -is called on an identifier it associates the process with that -identifier but does not block. -.Fn await -will actually block the process until -.Fn wakeup -is called on that identifier any time after the -.Fn asleep . -If -.Fn wakeup -is called after you -.Fn asleep -but before you -.Fn await -then the -.Fn await -call is effectively a NOP. -If -.Fn await -is called multiple times without an intervening -.Fn asleep , -the -.Fn await -is effectively a NOP but will also call -.Fn mswitch -for safety. The -.Fn await -function allows you to override the priority and timeout values to be used. -If the value -1 is specified for an argument, the value is taken from the -previous -.Fn asleep -call. If -1 is passed for the priority you must be prepared to catch signal -conditions if the prior call to -.Fn asleep -specified it in its priority. If -1 is passed for the timeout you must be -prepared to catch a timeout condition if the prior call to -.Fn asleep -specified a timeout. When you use -1, it is usually a good idea to not make -assumptions as to the arguments used by the prior -.Fn asleep -call. -.Pp -The -.Fn asleep -and -.Fn await -functions are mainly used by the kernel to shift the burden of blocking -away from extremely low level routines and to push it onto their callers. -This in turn allows more complex interlocking code to -.Em backout -of a temporary resource failure -(such as lack of memory) in order to release major locks prior to actually -blocking, and to then retry the operation on wakeup. This key feature is -expected to be heavily used in SMP situations in order to allow code to make -better use of spinlocks. A spinlock, by its very nature, cannot be used -around code that might block. It is hoped that these capabilities will -make it easier to migrate the SMP master locks deeper into the kernel. -.Pp -These routines may also be used to avoid nasty spl*() calls to get around -race conditions with simple conditional test/wait interlocks. You simple -call -.Fn asleep -prior to your test, then conditonally -.Fn await -only if the test fails. It is usually a good idea to cancel an -.Fn asleep -if you wind up never calling the related -.Fn await , -but it is not required. If you do not want to waste cpu calling -.Fn asleep -unnecessarily, you can surround the whole thing with a second test. The -race condition is still handled by the inside -.Fn asleep -call. .Sh RETURN VALUES See above. .Sh SEE ALSO -.Xr ps 1 , -.Xr malloc 9 +.Xr ps 1 .Sh HISTORY The sleep/wakeup process synchronization mechanism is very old. It appeared in a very early version of Unix. @@ -220,12 +117,7 @@ appeared in a very early version of Unix. .Nm Tsleep appeared in .Bx 4.4 . -.Pp -.Nm Asleep/await -first appeared in FreeBSD-3.0.1 and is designed to shift the burden of blocking -away from extremely low level routines and push it up to their callers. .Sh AUTHORS This man page has been written by .ie t J\(:org Wunsch. -.el Joerg Wunsch. -asleep/await designed and written by Matthew Dillon. +.el Joerg Wunsch. diff --git a/share/man/man9/spl.9 b/share/man/man9/spl.9 index ef1a19cad830..f4befd45aaf6 100644 --- a/share/man/man9/spl.9 +++ b/share/man/man9/spl.9 @@ -23,7 +23,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. .\" -.\" $Id: spl.9,v 1.6 1998/01/16 18:14:34 bde Exp $ +.\" $Id: spl.9,v 1.5 1997/04/13 14:49:09 bde Exp $ .\" " .Dd July 21, 1996 .Os @@ -84,7 +84,7 @@ Each driver that uses interrupts is normally assigned to an interrupt priority group by a keyword in its config line. For example: .Bd -literal -offset indent -device foo0 at isa? port 0x0815 irq 12 tty +device foo0 at isa? port 0x0815 irq 12 tty vector foointr .Ed .Pp assigns interrupt 12 to the |