Fix formatting errors (bad sentence breaks).

This commit is contained in:
mycroft 1999-03-06 22:09:29 +00:00
parent 6841c53323
commit 6bb985323b
16 changed files with 210 additions and 146 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: access.9,v 1.5 1998/05/09 15:04:39 kleink Exp $
.\" $NetBSD: access.9,v 1.6 1999/03/06 22:09:29 mycroft Exp $
.\"
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -69,14 +69,15 @@ checks addresses in the kernel address space, while
.Fn useracc
considers
.Fa addr
to represent an user space address. The process context to use for this
operation is taken from the global variable
to represent an user space address.
The process context to use for this operation is taken from the global variable
.Va curproc .
.Pp
.Sh RETURN VALUES
Both functions return 1 if the type of access specified by
.Fa rw
is permitted. Otherwise 0 is returned.
is permitted.
Otherwise 0 is returned.
.Pp
.Sh BUGS
The process pointer should be passed in as an argument.

View File

@ -1,4 +1,4 @@
.\" $NetBSD: arp.9,v 1.14 1999/02/16 23:34:13 is Exp $
.\" $NetBSD: arp.9,v 1.15 1999/03/06 22:09:29 mycroft Exp $
.\"
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -59,8 +59,9 @@ functions provide the interface between the
.Nm
module and the network drivers which need
.Nm
functionality. Such drivers must request the
arp
functionality.
Such drivers must request the
.Ar arp
attribute in their "files" declaration.
.Bl -tag -width "arp_ifinit()"
.It Fn arp_ifinit
@ -81,14 +82,16 @@ SIOCSIFADDR request with an AF_INET address family.
is called by network output functions to resolve an IPv4 address.
If no
.Fa rt
is given, a new one is looked up or created. If the passed or found
is given, a new one is looked up or created.
If the passed or found
.Fa rt
does not contain a valid gateway link level address, a pointer to the packet
in
.Fa m
is stored in the route entry, possibly replacing older stored packets, and an
.Nm
request is sent instead. When an
request is sent instead.
When an
.Nm
reply is received, the last held packet is send.
Otherwise, the looked up address is returned and written into the storage
@ -97,7 +100,8 @@ points to.
.Fn arpresolve
returns 1, if a valid address was stored to
.Fa desten ,
and the packet can be sent immediately. Else a 0 is returned.
and the packet can be sent immediately.
Else a 0 is returned.
.It Fn arpintr
When an
.Nm

View File

@ -1,4 +1,4 @@
.\" $NetBSD: bus_dma.9,v 1.9 1999/02/25 23:29:33 ross Exp $
.\" $NetBSD: bus_dma.9,v 1.10 1999/03/06 22:09:29 mycroft Exp $
.\"
.\" Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -154,7 +154,8 @@ member indicates the number of segments in
.Bl -tag -width compact
.It Fn bus_dmamap_create "tag" "size" "nsegments" "maxsegsz" "boundary" "flags" "dmamp"
Allocates a DMA handle and initializes it according to the parameters
provided. Arguments are as follows:
provided.
Arguments are as follows:
.Bl -tag -width nsegments -compact
.It Fa tag
This is the bus_dma_tag_t passed down from the parent driver via
@ -230,7 +231,8 @@ If given valid arguments,
always succeeds.
.It Fn bus_dmamap_load "tag" "dmam" "buf" "buflen" "p" "flags"
Loads a DMA handle with mappings for a DMA transfer. It assumes that
all pages involved in a DMA transfer are wired. Arguments are as follows:
all pages involved in a DMA transfer are wired.
Arguments are as follows:
.Bl -tag -width buflen -compact
.It Fa tag
This is the bus_dma_tag_t passed down from the parent driver via
@ -457,7 +459,8 @@ the addresses returned are system physical addresses.
.Pp
Allocations will always be rounded to the hardware page size. Callers
may wish to take advantage of this, and cluster allocation of small
data structures. Arguments are as follows:
data structures.
Arguments are as follows:
.Bl -tag -width alignment -compact
.It Fa tag
The is the bus_dma_tag_t passed down from the parent driver via

View File

@ -1,4 +1,4 @@
.\" $NetBSD: bus_space.9,v 1.8 1998/07/07 06:40:34 ross Exp $
.\" $NetBSD: bus_space.9,v 1.9 1999/03/06 22:09:29 mycroft Exp $
.\"
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -452,8 +452,8 @@ used on many systems' I/O port spaces, and on some systems
.Dv BUS_SPACE_MAP_LINEAR
without
.Dv BUS_SPACE_MAP_CACHEABLE
may never work. When
the system hardware or firmware provides hints as to how spaces should be
may never work.
When the system hardware or firmware provides hints as to how spaces should be
mapped (e.g. the PCI memory mapping registers' "prefetchable" bit), those
hints should be followed for maximum compatibility. On some systems,
requesting a mapping that cannot be satisfied (e.g. requesting a
@ -564,8 +564,8 @@ zero, fills in the bus address pointed to by
with the bus space address of the allocated region, and fills in
the bus space handle pointed to by
.Fa handlep
with the handle that can be used to access that region. If unsuccessful,
it returns non-zero and leaves the bus address pointed to by
with the handle that can be used to access that region.
If unsuccessful, it returns non-zero and leaves the bus address pointed to by
.Fa addrp
and the bus space handle pointed to by
.Fa handlep

View File

@ -1,4 +1,4 @@
.\" $NetBSD: ctxsw.9,v 1.8 1998/09/22 11:24:52 kleink Exp $
.\" $NetBSD: ctxsw.9,v 1.9 1999/03/06 22:09:29 mycroft Exp $
.\"
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -50,8 +50,9 @@
The
.Fn mi_switch
function implements the machine-independent prelude to a process context
switch. It is called from only a few distinguished places in the kernel
code as a result of the principle of non-preemptable kernel mode execution.
switch.
It is called from only a few distinguished places in the kernel code as a
result of the principle of non-preemptable kernel mode execution.
The three major uses of
.Fn mi_switch
can be enumerated as follows:
@ -67,12 +68,12 @@ available.
.It
After handling a trap
.Pq e.g. a system call or device interrupt
when the kernel prepares a return to user-mode execution. This case is
typically handled by machine-dependent trap-handling code after detection
of a change in the signal disposition of the current process, or when a
higher priority process might be available to run. The latter event is
communicated by the machine-independent scheduling routines by calling
the machine-dependent
when the kernel prepares a return to user-mode execution.
This case is typically handled by machine-dependent trap-handling code after
detection of a change in the signal disposition of the current process, or
when a higher priority process might be available to run.
The latter event is communicated by the machine-independent scheduling
routines by calling the machine-dependent
.Fn need_resched "void" .
.It
In the signal handling code
@ -98,7 +99,8 @@ which will perform the actual process context switch.
.Pp
.Fn cpu_switch
will make a choice amongst the processes which are ready to run from a
priority queue data-structure. The priority queue consists of an array
priority queue data-structure.
The priority queue consists of an array
.Va qs[NQS]
of queue header structures each of which identifies a list of runnable
processes of equal priority
@ -119,8 +121,10 @@ If no processes are available on the run queues,
.Fn cpu_switch
shall go into an
.Dq idle
loop. The idle loop must allow interrupts to be taken that will eventually
cause processes to appear again on the run queues. The variable
loop.
The idle loop must allow interrupts to be taken that will eventually cause
processes to appear again on the run queues.
The variable
.Va curproc
should be
.Dv NULL

View File

@ -1,4 +1,4 @@
.\" $NetBSD: disklabel.9,v 1.6 1998/09/03 08:12:57 msaitoh Exp $
.\" $NetBSD: disklabel.9,v 1.7 1999/03/06 22:09:29 mycroft Exp $
.\"
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -55,11 +55,11 @@
.Fn bounds_check_with_label "struct buf *bp" "struct disklabel *lp" "int wlabel"
.Sh DESCRIPTION
This collection of routines provides a disklabel management interface to
kernel device drivers. These routines are classified as machine- or
architecture-dependent because of restrictions imposed by the machine
architecture and boot-strapping code on the location of the label, or because
co-operation with other operating systems requires specialized conversion
code.
kernel device drivers.
These routines are classified as machine- or architecture-dependent because
of restrictions imposed by the machine architecture and boot-strapping code
on the location of the label, or because cooperation with other operating
systems requires specialized conversion code.
.Pp
.Fn readdisklabel
attempts to read a disklabel from the device identified by
@ -73,7 +73,8 @@ Some fields in the in the disklabel passed in
.Fa lp
may be pre-initialized by the caller in order to meet device driver
requirements for the I/O operation initiated to get to the disklabel data
on the medium. In particular, the field
on the medium.
In particular, the field
.Dq d_secsize ,
if non-zero, is used by
.Fn readdisklabel
@ -123,7 +124,8 @@ field is returned.
.Fn setdisklabel
checks a proposed new disk label passed in
.Fa nlp
for some amount of basic sanity. This includes a check on attempts to
for some amount of basic sanity.
This includes a check on attempts to
change the location, or reduce the size, of an existing disk partition
that is currently in use by the system.
The current disposition of the disk partitions is made available through
@ -138,7 +140,8 @@ results in a
.Dv EINVAL
return value, while a vetoed update of the partition layout is signaled by a
.Dv EBUSY
return value. Otherwise, 0 is returned.
return value.
Otherwise, 0 is returned.
.Pp
.Fn bounds_check_with_label
is used to check whether a device transfer described by
@ -157,12 +160,14 @@ sets the
.Dv B_ERROR
flag in
.Dq Va b_flags ,
and returns -1. If the argument
and returns -1.
If the argument
.Fa wlabel
is zero, and the transfer is a write operation, a check is done if the transfer
would overwrite
.Pq a portion of
the disklabel area on the medium. If that is the case,
the disklabel area on the medium.
If that is the case,
.Dv EROFS
is set in
.Dq Va b_error ,
@ -174,8 +179,9 @@ and -1 is returned.
Note that
.Fa wlabel
should be set to a non-zero value if the intended operation is expected to
install or update the disk label. Programs that intend to do so using the
raw device interface should notify the driver by using a
install or update the disk label.
Programs that intend to do so using the raw device interface should notify
the driver by using a
.Dv DIOCWLABEL
ioctl function.
.Pp

View File

@ -1,4 +1,4 @@
.\" $NetBSD: ethersubr.9,v 1.8 1999/02/16 23:34:13 is Exp $
.\" $NetBSD: ethersubr.9,v 1.9 1999/03/06 22:09:29 mycroft Exp $
.\"
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -75,13 +75,17 @@ The
.Nm
functions provide the interface between the
.Nm
module and the network drivers which need Ethernet support. Such
drivers must request the "ether" attribute in their "files" declaration
and call the appropriate functions as specified below.
module and the network drivers which need Ethernet support.
Such drivers must request the
.Ar ether
attribute in their
.Ar files
declaration and call the appropriate functions as specified below.
.Pp
FDDI drivers must request the "fddi" attribute in their "files"
declaration and call the functions tagged with "fddi_" or "FDDI_"
instead, where different. Some macros are shared.
instead, where different.
Some macros are shared.
.Pp
Note that you also need the
.Xr arp 9
@ -117,7 +121,8 @@ handle
.Dv SIOCADDMULTI
and
.Dv SIOCDELMULTI
requests. If they return
requests.
If they return
.Er ENETRESET ,
the hardware multicast filter must be reinitialized.
.Pp
@ -125,7 +130,8 @@ These functions accept
.Dv AF_UNSPEC
addresses, which are interpreted as Ethernet addresses, or
.Dv AF_INET
addresses. In the latter case,
addresses.
In the latter case,
.Dv INADDR_ANY
is mapped to a range describing all the Ethernet address
space reserved for IPv4 multicast addresses.

View File

@ -1,4 +1,4 @@
.\" $NetBSD: malloc.9,v 1.8 1998/07/29 22:07:14 pk Exp $
.\" $NetBSD: malloc.9,v 1.9 1999/03/06 22:09:29 mycroft Exp $
.\"
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -108,7 +108,8 @@ The
.Fa type
argument broadly identifies the kernel subsystem for which the allocated
memory was needed, and is commonly used to maintain statistics about
kernel memory usage. The following types are currently defined:
kernel memory usage.
The following types are currently defined:
.Pp
.Bl -tag -offset indent -width XXXXXXXXXXXXXX -compact
.It Dv M_FREE
@ -317,8 +318,8 @@ such things as writing outside the allocated area and imbalanced calls to the
.Fn malloc
and
.Fn free
functions. Failing consistency checks will cause a panic or a system console
message:
functions.
Failing consistency checks will cause a panic or a system console message:
.Bl -bullet -offset indent -compact
.Pp
.It

View File

@ -1,4 +1,4 @@
.\" $NetBSD: mbuf.9,v 1.5 1998/09/03 08:12:57 msaitoh Exp $
.\" $NetBSD: mbuf.9,v 1.6 1999/03/06 22:09:29 mycroft Exp $
.\"
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -230,31 +230,37 @@ and is used instead of the internal data area; this is done when at least
bytes of data must be stored.
.Bl -tag -width compact
.It Fn m_get "int nowait" "int type"
Allocates an mbuf and initializes it to contain internal data. The
Allocates an mbuf and initializes it to contain internal data.
The
.Fa nowait
parameter is a choice of
.Dv M_WAIT / M_DONTWAIT
from caller.
.Dv M_WAIT
means the call cannot fail, but may take forever. The
means the call cannot fail, but may take forever.
The
.Fa type
parameter is an mbuf type.
.It Fn m_getclr "int nowait" "int type"
Allocates an mbuf and initializes it to contain internal data, then
zeros the data area. The
zeros the data area.
The
.Fa nowait
parameter is a choice of
.Dv M_WAIT / M_DONTWAIT
from caller. The
from caller.
The
.Fa type
parameter is an mbuf type.
.It Fn m_gethdr "int nowait" "int type"
Allocates an mbuf and initializes it to contain a packet header and internal
data. The
data.
The
.Fa nowait
parameter is a choice of
.Dv M_WAIT / M_DONTWAIT
from caller. The
from caller.
The
.Fa type
parameter is an mbuf type.
.It Fn m_devget "char *buf" "int totlen" "int off0" "struct ifnet *ifp" "void (*copy) __P((const void *, void *, size_t))"
@ -322,7 +328,8 @@ allocates new mbuf
.Fa m
of size
.Fa len
to prepend to the chain, copying junk along. The
to prepend to the chain, copying junk along.
The
.Fa how
parameter is a choice of
.Dv M_WAIT / M_DONTWAIT
@ -356,7 +363,8 @@ restore the chain to its original state.
.It Fn m_adj "struct mbuf *mp" "int req_len"
Shaves off
.Fa req_len
bytes from head or tail of the (valid) data area. If
bytes from head or tail of the (valid) data area.
If
.Fa req_len
is greater than zero, front bytes are being shaved off, if it's smaller,
from the back (and if it is zero, the mbuf will stay bearded).
@ -394,13 +402,15 @@ Implemented as a macro.
.It Fn MGET "struct mbuf *m" "int how" "int type"
Allocates mbuf
.Fa m
and initializes it to contain internal data. See
and initializes it to contain internal data.
See
.Fn m_get .
Implemented as a macro.
.It Fn MGETHDR "struct mbuf *m" "int how" "int type"
Allocates mbuf
.Fa m
and initializes it to contain a packet header. See
and initializes it to contain a packet header.
See
.Fn m_gethdr .
Implemented as a macro.
.It Fn MEXTMALLOC "struct mbuf *m" "int len" "int how"
@ -503,7 +513,8 @@ to mbuf
.Fa m .
If a new mbuf must be allocated,
.Fa how
specifies whether to wait. If
specifies whether to wait.
If
.Fa how
is
.Dv M_DONTWAIT

View File

@ -1,4 +1,4 @@
.\" $NetBSD: panic.9,v 1.6 1998/09/03 08:12:57 msaitoh Exp $
.\" $NetBSD: panic.9,v 1.7 1999/03/06 22:09:29 mycroft Exp $
.\"
.\" Copyright (c) 1996 Michael Graff.
.\" All rights reserved.
@ -15,7 +15,7 @@
.\" must display the following acknowledgement:
.\" This product includes software developed by Michael Graff
.\" for the NetBSD Project.
.\" 3. The name of the author may not be used to endorse or promote products
.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR

View File

@ -1,4 +1,4 @@
.\" $NetBSD: physio.9,v 1.3 1997/10/08 22:00:35 jtc Exp $
.\" $NetBSD: physio.9,v 1.4 1999/03/06 22:09:30 mycroft Exp $
.\"
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -54,8 +54,8 @@
The
.Fn physio
is a helper function typically called from character device read and write
routines to start I/O on a user process buffer. It calls back on the
provided
routines to start I/O on a user process buffer.
It calls back on the provided
.Fa strategy
routine one or more times to complete the transfer described by
.Fa uio .
@ -63,7 +63,8 @@ The maximum amount of data to transfer with each call to
.Fa strategy
is determined by the
.Fa minphys
routine. Since
routine.
Since
.Fa uio
normally describes user space addresses,
.Fn physio
@ -75,8 +76,8 @@ and
.Xr vsunlock 9 ).
.Fn physio
always awaits the completion of the entire requested transfer before
returning, unless an error condition is detected earlier. In all cases,
the buffer passed in
returning, unless an error condition is detected earlier.
In all cases, the buffer passed in
.Fa bp
is locked (marked as
.Dq busy )
@ -88,12 +89,14 @@ A break-down of the arguments follows:
The device strategy routine to call for each chunk of data to initiate
device I/O.
.It Fa bp
The buffer to use with the strategy routine. The buffer flags will have
The buffer to use with the strategy routine.
The buffer flags will have
.Dv B_BUSY ,
.Dv B_PHYS ,
and
.Dv B_RAW
set when passed to the strategy routine. If
set when passed to the strategy routine.
If
.Dv NULL ,
a buffer is allocated from a system pool.
.It Fa dev
@ -131,7 +134,8 @@ by examining the
.Dv B_ERROR
buffer flag and the
.Sq b_error
field. Note that the actual transfer size may be less than requested by
field.
Note that the actual transfer size may be less than requested by
.Fa uio
if the device signals an
.Dq end of file

View File

@ -1,4 +1,4 @@
.\" $NetBSD: rnd.9,v 1.4 1999/02/28 17:08:18 explorer Exp $
.\" $NetBSD: rnd.9,v 1.5 1999/03/06 22:09:30 mycroft Exp $
.\"
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -150,7 +150,8 @@ is the number of bytes in
.Fa data
and
.Fa entropy
is an "entropy quality" measurement. If every bit of
is an "entropy quality" measurement.
If every bit of
.Fa data
is known to be random,
.Fa entropy

View File

@ -1,4 +1,4 @@
.\" $NetBSD: sleep.9,v 1.8 1999/01/16 16:39:52 msaitoh Exp $
.\" $NetBSD: sleep.9,v 1.9 1999/03/06 22:09:30 mycroft Exp $
.\"
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -71,9 +71,9 @@ other processes.
The function
.Fn wakeup
is used to notify sleeping processes of possible changes to the condition
that caused them to go to sleep. Typically, an awakened process will --
after it has acquired a context again -- retry the action that blocked
its operation to see if the
that caused them to go to sleep.
Typically, an awakened process will -- after it has acquired a context
again -- retry the action that blocked its operation to see if the
.Dq blocking
condition has cleared.
.Pp
@ -84,10 +84,10 @@ function takes the following arguments:
.It Fa ident
An identifier of the
.Dq wait channel
representing the resource for which the current process needs to wait. This
typically is the virtual address of some kernel data-structure related
to the resource for which the process is contending. The same identifier
must be used in a call to
representing the resource for which the current process needs to wait.
This typically is the virtual address of some kernel data-structure related
to the resource for which the process is contending.
The same identifier must be used in a call to
.Fn wakeup
to get the process going again.
.Fa ident
@ -95,9 +95,11 @@ should not be
.Dv NULL .
.It Fa priority
The process priority to be used when the process is awakened and put on
the queue of runnable processes. This mechanism is used to optimize
the queue of runnable processes.
This mechanism is used to optimize
.Dq throughput
of processes executing in kernel mode. If the flag
of processes executing in kernel mode.
If the flag
.Dv PCATCH
is OR'ed into
.Fa priority
@ -111,7 +113,8 @@ for user level utilities such as
.It Fa timo
If non-zero, the process will sleep for at most
.Li timo/hz
seconds. If this amount of time elapses and no
seconds.
If this amount of time elapses and no
.Fn wakeup "ident"
has occurred, and no signal
.Pq if Dv PCATCH No was set
@ -123,8 +126,8 @@ will return
.Pp
The
.Fn sleep
function puts the process in an uninterruptable sleep. It is functionally
equivalent to:
function puts the process in an uninterruptable sleep.
It is functionally equivalent to:
.Bd -literal -offset indent
tsleep(ident, priority & PRIMASK, 0, 0)
.Ed
@ -133,18 +136,19 @@ The
.Fn wakeup
function will mark all processes which are currently sleeping on the identifier
.Fa ident
as runnable. Eventually, each of the processes will resume execution in
the kernel context, causing a return from
as runnable.
Eventually, each of the processes will resume execution in the kernel
context, causing a return from
.Fn [t]sleep .
Note that processes returning from sleep should always re-evaluate the
conditions that blocked them, since a call to
.Fn wakeup
merely signals a
.Em possible
change to the blocking conditions. For example, when two or more processes
are waiting for an exclusive lock, only one of them will succeed in acquiring
the lock when it is released. All others will have to go back to sleep and
wait for the next opportunity.
change to the blocking conditions.
For example, when two or more processes are waiting for an exclusive lock,
only one of them will succeed in acquiring the lock when it is released.
All others will have to go back to sleep and wait for the next opportunity.
.Sh RETURN VALUES
.Fn tsleep
returns 0 if it returns as a result of a

View File

@ -1,4 +1,4 @@
.\" $NetBSD: timeout.9,v 1.5 1998/06/08 11:33:21 lukem Exp $
.\" $NetBSD: timeout.9,v 1.6 1999/03/06 22:09:30 mycroft Exp $
.\"
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -53,7 +53,8 @@ schedules a call to the function given by the argument
.Fa fnt
to take place after
.Fa ticks Ns No /hz
seconds. Non-positive values of
seconds.
Non-positive values of
.Fa ticks
are silently converted to the value
.Sq 1 .
@ -72,7 +73,8 @@ cancels the first scheduled call
.Pq i.e. the one with the shortest delay left
that matches the
.Aq Fa fnt , Ns Fa arg
pair. If a match can not be found in the callout queue, nothing happens.
pair.
If a match can not be found in the callout queue, nothing happens.
.Sh SEE ALSO
.Xr hz 9
.Sh BUGS

View File

@ -1,4 +1,4 @@
.\" $NetBSD: uiomove.9,v 1.1 1999/02/13 08:03:34 nathanw Exp $
.\" $NetBSD: uiomove.9,v 1.2 1999/03/06 22:09:30 mycroft Exp $
.\"
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -74,8 +74,8 @@ struct uio {
A
.Fa struct uio
typically describes data in motion. Several of the fields described
below reflect that expectation.
typically describes data in motion.
Several of the fields described below reflect that expectation.
.Bl -tag -width uio_xxxxxx
.It uio_iov
@ -129,8 +129,8 @@ such that
is decremented by the amount of data moved,
.Fa uio->uio_offset
is incremented by the same amount, and the array of iovecs is adjusted
to point that much farther into the region described. This allows
multiple calls to
to point that much farther into the region described.
This allows multiple calls to
.Nm
to easily be used to fill or drain the region of data.

View File

@ -1,4 +1,4 @@
.\" $NetBSD: wdc.9,v 1.1 1998/10/19 12:52:21 bouyer Exp $
.\" $NetBSD: wdc.9,v 1.2 1999/03/06 22:09:30 mycroft Exp $
.\"
.\" Copyright (c) 1998 Manuel Bouyer.
@ -50,7 +50,8 @@
The
.Nm
driver provides the machine independant core functions for driving IDE
devices. IDE devices-specific drivers (
devices.
IDE devices-specific drivers (
.Nm wd
or
.Nm atapibus )
@ -63,8 +64,9 @@ vith the
.Va wdc_softc
and
.Va channel_softc
structures. The first one defines global controller properties, and the second
contain per-channel informations.
structures.
The first one defines global controller properties, and the second contain
per-channel informations.
.Nm
returns informations about the attached devices in the
.Va ata_drive_datas
@ -185,22 +187,23 @@ and
.Va dma_finish
functions.
.Va dma_init
is called just before issuing a DMA command to the IDE device. The arguments
are, respectively:
is called just before issuing a DMA command to the IDE device.
The arguments are, respectively:
.Va dma_arg ,
the channel number, the drive number on this channel,
the virtual address of the DMA buffer, the size of the transfert, and the
.Va WDC_DMA
flags.
.Va dma_start
is called just after issuing a DMA command to the IDE device. The arguments
are, respectively:
is called just after issuing a DMA command to the IDE device.
The arguments are, respectively:
.Va dma_arg ,
the channel number, the drive number on this channel, and the
.Va WDC_DMA
flags.
.Va dma_finish
is called once the transfert is complete. The arguments are, respectively:
is called once the transfert is complete.
The arguments are, respectively:
.Va dma_arg ,
the channel number, the drive number on this channel, and the
.Va WDC_DMA
@ -215,15 +218,18 @@ The
flag means that the bus front-end can program the PIO and DMA modes, so
.Nm
needs to provide back the supported modes for each drives, and set the drives
modes. The
modes.
The
.Va pio_mode
and
.Va dma_mode
needs to be set to the hightest PIO and DMA mode supported. If
needs to be set to the hightest PIO and DMA mode supported.
If
.Va WDC_CAPABILITY_UDMA
is set, then
.Va dma_mode
must be set to the hightest Ultra-DMA mode supported. If
must be set to the hightest Ultra-DMA mode supported.
If
.Va WDC_CAPABILITY_MODE
is not set,
.Nm
@ -233,7 +239,8 @@ firmware has done it rigth.
The
.Va WDC_CAPABILITY_HWLOCK
flag is set for controllers needing hardware looking before access to the
I/O ports. If this flag is set, the bus front-end needs to provide the
I/O ports.
If this flag is set, the bus front-end needs to provide the
.Va claim_hw
and
.Va free_hw
@ -241,13 +248,15 @@ functions.
.Va claim_hw
will be called when the driver wants to access the controller ports.
The second parameter is set to 1 when it is possible to sleep wainting
for the lock, 0 otherwise. It should return 1 when access has been granted,
0 otherwise. When access has not been granted and sleep is not allowed,
the bus front-end shall call
for the lock, 0 otherwise.
It should return 1 when access has been granted, 0 otherwise.
When access has not been granted and sleep is not allowed, the bus
front-end shall call
.Va wdcrestart()
with the first argument passed to
.Va claim_hw
as argument. This arguments will also be the one passed to
as argument.
This arguments will also be the one passed to
.Va free_hw.
This function is called once the transfert is complete, so that the lock can
be released.
@ -257,17 +266,19 @@ unless the
.Va WDC_CAPABILITY_ATA_NOSTREAM
or
.Va WDC_CAPABILITY_ATAPI_NOSTREAM
flags are set. This should not be used, unless the data bus is not wired
properly (which seems common on big-endian systems), and byte-order needs
to be preserved for compatibility with the host's firmware. Also note that
the IDE bus is a little-endian bus, so the bus_space functions used
for the bus_space tag passed in the
flags are set.
This should not be used, unless the data bus is not wired properly (which
seems common on big-endian systems), and byte-order needs to be preserved
for compatibility with the host's firmware.
Also note that the IDE bus is a little-endian bus, so the bus_space
functions used for the bus_space tag passed in the
.Va channel_softc
have to do the apropriate byte-swapping for big-endian systems.
.Pp
.Va WDC_CAPABILITY_NO_EXTRA_RESETS
avoid the controller reset at the end of the disks probe. This reset is needed
for some controllers, and cause problems with some others.
avoid the controller reset at the end of the disks probe.
This reset is needed for some controllers, and cause problems with some
others.
.Pp
The bus front-end needs to fill in the following
elements of
@ -290,7 +301,8 @@ This will hold the queues of outstanding commands for this controller.
The following elements are optional:
.Bl -tag -compact -width "dma_finish" -offset "xxxx"
.It data32iot, data32ioh
Bus-space tag and handle for 32-bit data accesses. Only needed if
Bus-space tag and handle for 32-bit data accesses.
Only needed if
.Va WDC_CAPABILITY_DATA32
is set in the controller's
.Va wdc_softc .
@ -311,24 +323,26 @@ function, with a properly inithialised
.Va struct channel_softc
as argument (
.Va wdc
can be set to NULL. This allows
can be set to NULL.
This allows
.Va wdcprobe
to be easily used in bus front-end probe functions). This function will return
an integer where bit 0
will be set if the master device has been found, and 1 if the slave
device has been found.
to be easily used in bus front-end probe functions).
This function will return an integer where bit 0 will be set if the master
device has been found, and 1 if the slave device has been found.
.Pp
The bus-specific's attach function has to call
.Va wdcattach()
for each channels, with a pointer to a properly initialised
.Va channel softc
as argument. This will probe devices attached to the IDE channel and attach
them. Once this function returns, the
as argument.
This will probe devices attached to the IDE channel and attach them.
Once this function returns, the
.Va ch_drive
array of the
.Va channel_softc
will contains the drive's capabilities. This can be used to properly
initialise the controller's mode, or disable a channel without drives.
will contains the drive's capabilities.
This can be used to properly initialise the controller's mode, or disable a
channel without drives.
.Pp
The elements of interest in
.Va ata_drive_datas
@ -337,23 +351,26 @@ for a bus front-end are:
.It drive
The drive number
.It drive_flags
Flags indicating the drive capabilities. A null
Flags indicating the drive capabilities.
A null
.Va drive_flags
indicate either that no drive are here, or that no driver was
found for this device.
.It PIO_mode, DMA_mode, UDMA_mode
the hightest supported modes for this drive compatible with the controller's
capabilities. Needs to be reset to the mode to use by the drive, if known.
capabilities.
Needs to be reset to the mode to use by the drive, if known.
.It drv_softc
A pointer to the drive's softc. Can be used to print the drive's name.
A pointer to the drive's softc.
Can be used to print the drive's name.
.El
.Pp
.Va drive_flags
handles the following flags:
.Bl -tag -compact -width "dma_finish" -offset "xxxx"
.It DRIVE_ATA, DRIVE_ATAPI
Gives the drive type, if any. The shortcut DRIVE can be used to just test
the presence/absence of a drive.
Gives the drive type, if any.
The shortcut DRIVE can be used to just test the presence/absence of a drive.
.It DRIVE_CAP32
This drive works with 32-bit data I/O.
.It DRIVE_DMA