1
0
Files
irix-657m-src/eoe/man/manD/xtalk_error.d3
2022-09-29 17:59:04 +03:00

119 lines
2.4 KiB
Plaintext

.TH xtalk_error D3
.IX "\f4xtalk_error_register\f1(D3)"
.SH NAME
\f4xtalk_error_register\f1 \- register handling function
.SH SYNOPSIS
.nf
.ds fT \f1
.if t .ds fT \f4
\*(fT#include <sys/xtalk/xtalk.h>
#include <sys/ioerror.h>
.sp .8v
int
xtalk_error_register(
vertex_hdl_t \f2vhdl\*(fT,
error_handler_f *\f2func\*(fT,
error_handler_arg_t \f2arg\*(fT)\f1
.fi
.SS Arguments
.IP "\f2vhdl\f1" 8n
is the appropriate XIO registerion point.
.IP "\f2func\f1" 8n
is a function to be used for error service
.IP "\f2arg\f1" 8n
is the parameter to pass
as the first argument
to the function when
an error is diagnosed as a PIO to
or a DMA from this XIO device.
.SH DESCRIPTION
Some devices may, from time to time, either
trigger a PIO error or encounter a DMA error
that is expected by the driver.
.IR xtalk_error_register ()
provides a mechanism whereby the driver can
be informed that such an error has occurred,
and be given the ability to either recover
from the error, or do a more precise diagnosis
of the problem than is possible in the generic
error handling code.
.P
There is no explicit unregistration function;
to stop receiving error reports, call
.IR xtalk_error_register ()
with NULL values for the function pointer
and parameter values.
.P
The error handler should be registered
and unregistered at the same time as the
interrupt handlers are connected and disconnected,
and for the same reason: we would not want
to call an error handler that no longer actually
existed at the stored address.
Note that error handlers would rarely use the
alternate registration scenario outlined in
\f4xtalk_intr\f1(D3).
.SH EXAMPLES
Here is the typical way that
.if t .ft 4
.nf
xiofoo_attach(vertex_hdl_t pconn_vhdl)
{
...
xtalk_error_register(pconn_vhdl
xiofoo_error_handler,
xiofoo_soft);
...
static int
xiofoo_error_handler(
error_handler_arg_t einfo,
int error_code,
ioerror_mode_t mode,
ioerror_t *ioe)
{
...
if (recoverable) {
recover the error;
return IOERROR_HANDLED;
}
diagnose the chip into the console log;
return IOERROR_PANIC;
}
.fi
.ft 1
The set of error codes, return codes, and
fields within the ioerror structure may
be expanded from time to time.
The available values are documented in
/usr/include/sys/ioerror.h
.\" .SH NOTES
.SH FILES
/usr/include/sys/ioerror.h
.\" .br
.\" sample_xtalk.c
.SH "SEE ALSO"
xtalk(D3),
xtalk_dma(D3),
xtalk_intr(D3),
xtalk_get(D3),
xtalk_pio(D3).
.\" .SH DIAGNOSTICS