1 .\" $NetBSD: ipkdb.9,v 1.8 2008/04/30 13:10:58 martin Exp $
3 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Gregory McGarry.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd machine-dependent interface to ipkdb
41 .Fn ipkdb_connect "int when"
51 .Fn ipkdbif_init "struct ipkdb_if *kip"
53 .Fn ipkdbfbyte "u_char *c"
55 .Fn ipkdbsbyte "u_char *c" "int i"
57 The machine-dependent code must support this interface for operation with
60 During system bootstrap, machine-dependent code must invoke
62 If the kernel is booted with
69 is enabled by invoking
76 is invoked by machine-dependent code when the trap mechanism
77 determines that the debugger should be entered, i.e., on a single step
78 or breakpoint interrupt from kernel code.
79 The trapping mechanism should already have stored the registers into
80 the global area ipkdbregs.
81 The layout of this area must be the same as that expected by
83 Valid return values are:
85 .Bl -tag -offset indent -width IPKDB_CMD_EXITXX -compact
87 user wants to continue
89 user wants to do single stepping
91 user has detached from debugging
94 The machine-dependent code must provide the following functions for
95 the machine-independent code.
96 .Bl -tag -width ipkdbif_initXXXXXXX -compact
98 This routine gets called when the debugger should be entered for the
101 This routine is part of the trap handler.
102 Whenever a trap happens (e.g., when hitting a breakpoint during debugging),
104 decides if the Debugger needs to be called.
105 If there are other ways to decide that, it's not necessary to provide an
109 This routine gets called after a panic to check for a key press by the
111 If implemented it allows the user to press any key on the
112 console to do the automatic reboot after a panic.
113 Otherwise the debugging interface will wait forever for some remote
114 debugger to attach in case of a panic.
115 .It Fn ipkdbif_init "kip"
116 In order to be able to find the debugging interface, the network
123 plus some additional parameters that allow it to access the devices
124 registers, hopefully using
129 structure, the attach routine must initialize the following fields:
131 .Bl -tag -offset indent -width myenetaddr -compact
133 fill this with the own ethernet address of the device/machine
139 name of the device, only used for a message
141 routine called every time
145 routine called every time
149 routine called to receive a packet
151 routine called to send a packet
154 Additional fields that may be set are:
156 .Bl -tag -offset indent -width myinetaddr -compact
158 fill this with the own internet address, and mark
162 may be used as a pointer to some device
164 .It Fn ipkdbfbyte "c"
165 This routine should fetch a byte from address
167 It must not enter any
168 trap handling code, but instead return \-1 on inability to access the data.
169 .It Fn ipkdbsbyte "c" "i"
170 This routine should set the byte pointed to by
172 to the value given as
174 The routine must not enter any trap handling code.
175 Furthermore it should reset the modification bit in the relevant page
176 table entry to the value before the store.