void
ipkdb_init(
void
)
void
ipkdb_connect(
int when
)
int
ipkdbcmds(
void
)
void
ipkdbinit(
void
)
void
ipkdb_trap(
void
)
int
ipkdb_poll(
void
)
int
ipkdbif_init(
struct ipkdb_if *kip
)
int
ipkdbfbyte(
u_char *c
)
int
ipkdbsbyte(
u_char *c
, int i
)
During system bootstrap, machine-dependent code must invoke
ipkdb_init().
If the kernel is booted with
RB_KDB
set in boothowto, then
ipkdb(4)
is enabled by invoking
ipkdb_connect(),
setting the
when
argument to 0.
ipkdbcmds()
is invoked by machine-dependent code when the trap mechanism
determines that the debugger should be entered, i.e., on a single step
or breakpoint interrupt from kernel code.
The trapping mechanism should already have stored the registers into
the global area ipkdbregs.
The layout of this area must be the same as that expected by
gdb(1).
Valid return values are:
IPKDB_CMD_RUN
IPKDB_CMD_STEP
IPKDB_CMD_EXIT
)
)
)
decides if the Debugger needs to be called.
If there are other ways to decide that, it's not necessary to provide an
ipkdb_trap(
)
implementation.
)
kip
)
)
with
kip
specifying a
struct
ipkdb_if
plus some additional parameters that allow it to access the devices
registers, hopefully using
bus_space(9)
methods.
In the
ipkdb_if
structure, the attach routine must initialize the following fields:
IPKDB_MYHW
here
Additional fields that may be set are:
IPKDB_MYIP
in flags
c
)
c
.
It must not enter any
trap handling code, but instead return -1 on inability to access the data.
c
, i
)
c
to the value given as
i
.
The routine must not enter any trap handling code.
Furthermore it should reset the modification bit in the relevant page
table entry to the value before the store.