Manual browser: ipkdbsbyte(9)
|IPKDB(9)||Kernel Developer's Manual||IPKDB(9)|
NAMEipkdb — machine-dependent interface to ipkdb
ipkdbif_init(struct ipkdb_if *kip);
ipkdbsbyte(u_char *c, int i);
DESCRIPTIONThe machine-dependent code must support this interface for operation with ipkdb(4).
During system bootstrap, machine-dependent code must invoke ipkdb_init(). If the kernel is booted with RB_KDB set in boothowto (see boothowto(9)), 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:
- user wants to continue
- user wants to do single stepping
- user has detached from debugging
FUNCTIONSThe machine-dependent code must provide the following functions for the machine-independent code.
- This routine gets called when the debugger should be entered for the first time.
- This routine is part of the trap handler. Whenever a trap happens (e.g., when hitting a breakpoint during debugging), ipkdb_trap() 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.
- This routine gets called after a panic to check for a key press by the user. If implemented it allows the user to press any key on the console to do the automatic reboot after a panic. Otherwise the debugging interface will wait forever for some remote debugger to attach in case of a panic.
In order to be able to find the debugging interface, the network driver must invoke ipkdbif_init() 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:
- fill this with the own ethernet address of the device/machine
- mark at least IPKDB_MYHW here
- name of the device, only used for a message
- routine called every time ipkdb is entered
- routine called every time ipkdb is left
- routine called to receive a packet
- routine called to send a packet
Additional fields that may be set are:
- fill this with the own internet address, and mark IPKDB_MYIP in flags
- may be used as a pointer to some device
- This routine should fetch a byte from address c. It must not enter any trap handling code, but instead return -1 on inability to access the data.
- ipkdbsbyte(c, i)
- This routine should set the byte pointed to by 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.
|September 4, 2009||NetBSD 7.0|