Add a whole lot of extra info. Lots was gained from reading code

or comments, and some is as a result of simply documenting the
entropy harvester.

This still needs work: could a newbus guru pleazse follow up
and fix.extend my (no doubt) obvious mistakes!
This commit is contained in:
Mark Murray 2001-03-03 14:13:53 +00:00
parent 801382fa98
commit 3adc6e857d

View File

@ -29,12 +29,21 @@
.Os FreeBSD
.Sh NAME
.Nm BUS_SETUP_INTR
.Nd create and attach to an interrupt handler
.Nm bus_setup_intr
.Nm BUS_TEARDOWN_INTR
.Nm bus_teardown_intr
.Nd create and attach to an interrupt handler, and teardown the attachment
.Sh SYNOPSIS
.Fd #include <sys/param.h>
.Fd #include <sys/bus.h>
.Ft int
.Fn BUS_SETUP_INTR "device_t dev" "device_t child" "struct resource *irq" "int flags" "driver_intr_t *intr" "void *arg" "void **cookiep"
.Ft int
.Fn bus_setup_intr "device_t dev" "struct resource *r" "int flags" "driver_intr_t handler" "void *arg" "void **cookiep"
.Ft int
.Fn BUS_TEARDOWN_INTR "device_t dev" "device_t child" "struct resource *irq" "void **cookiep"
.Ft int
.Fn bus_teardown_intr "device_t dev" "struct resource *r" "void *cookiep"
.Sh DESCRIPTION
.Pp
The method
@ -43,6 +52,33 @@ will create and attach an interrupt handler to an interrupt
previously allocated by the resource manager's
.Xr BUS_ALLOC_RESOURCE 9
method.
The
.Fa flags
are found in
.Pa sys/bus.h ,
and give the broad category of interrupt.
The
.Fa flags
also tell the interrupt handlers the about certain
device driver characteristics.
.Dv INTR_FAST
means the handler is for a timing-critical function.
Extra care is take to speed up these handlers.
Use of this implies
.Dv INTR_EXCL .
.Dv INTR_EXCL
marks the handler as being
an exclusive handler for this interrupt.
.Dv INTR_MPSAFE
tells the scheduler that the interrupt handler
is well behaved in a preemptive environment
(``SMP safe''),
and does not need
to be protected by the ``Giant Lock'' mutex.
.Dv INTR_ENTROPY
marks the interrupt as being a good source of entropy -
this may be used by the entropy device
.Pa /dev/random .
The handler
.Fa intr
will be called with the value
@ -58,7 +94,7 @@ in order to tear down the correct interrupt handler.
Zero is returned on success,
otherwise an appropriate error is returned.
.Sh SEE ALSO
.Xr BUS_TEARDOWN_INTR 9 ,
.Xr random 4 ,
.Xr device 9 ,
.Xr driver 9
.Sh AUTHORS