dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / mdb / common / kmdb / kmdb_wr_impl.h
blob424ec3e963c9dc39c068cfafbd3f8e565bb864da
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _KMDB_WR_IMPL_H
28 #define _KMDB_WR_IMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <kmdb/kmdb_wr.h>
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
38 #define WNTASK_DMOD_LOAD 0x0001 /* Load a specific dmod */
39 #define WNTASK_DMOD_LOAD_ALL 0x0002 /* Load all dmods for kmods */
40 #define WNTASK_DMOD_UNLOAD 0x0004 /* Unload a specific dmod */
41 #define WNTASK_DMOD_PATH_CHANGE 0x0008 /* Change dmod search path */
43 #define WNFLAGS_NOFREE 0x0001 /* Don't free this wr on ack */
45 #define WNTASK_ACK 0x8000 /* Acknowledgement of req */
47 #define WR_ISACK(wr) ((((kmdb_wr_t *)(wr))->wn_task) & WNTASK_ACK)
48 #define WR_ACK(wr) (((kmdb_wr_t *)(wr))->wn_task) |= WNTASK_ACK
49 #define WR_TASK(wr) ((((kmdb_wr_t *)(wr))->wn_task) & ~WNTASK_ACK)
51 struct kmdb_wr {
52 struct kmdb_wr *wn_next; /* List of work requests */
53 struct kmdb_wr *wn_prev; /* List of work requests */
54 ushort_t wn_task; /* Task to be performed */
55 ushort_t wn_flags; /* Flags for this request */
56 uint_t wn_errno; /* Status for completed reqs */
60 * Debugger-initiated loads: Debugger creates, passes to driver, driver loads
61 * the module, returns the request as an ack. Driver-initiated loads: driver
62 * creates, loads module, passes to debugger as announcement, debugger returns
63 * as an ack.
65 typedef struct kmdb_wr_load {
66 kmdb_wr_t dlr_node;
68 /* Supplied by requestor */
69 char *dlr_fname;
71 /* Filled in by driver upon successful completion */
72 struct modctl *dlr_modctl;
75 * Used by the driver to track outstanding driver-initiated
76 * notifications for leak prevention.
78 struct kmdb_wr_load *dlr_next;
79 struct kmdb_wr_load *dlr_prev;
80 } kmdb_wr_load_t;
82 #define dlr_errno dlr_node.wn_errno
85 * The debugger creates a request for a module to be unloaded, and passes it
86 * to the driver. The driver unloads the module, and returns the message to
87 * the debugger as an ack.
89 typedef struct kmdb_wr_unload {
90 kmdb_wr_t dur_node;
92 /* Supplied by requestor */
93 char *dur_modname;
94 struct modctl *dur_modctl;
95 } kmdb_wr_unload_t;
97 #define dur_errno dur_node.wn_errno
100 * The debugger creates a new path-change "request" when the dmod search path
101 * changes, and sends it to the driver. The driver hangs onto the request
102 * until either the path changes again or the debugger is unloaded. Either way,
103 * the state change request is passed back at that time as an ack.
105 typedef struct kmdb_wr_path {
106 kmdb_wr_t dpth_node;
108 /* Supplied by requestor */
109 const char **dpth_path;
110 size_t dpth_pathlen;
111 } kmdb_wr_path_t;
113 #define dpth_errno dpth_node.wn_errno
115 #ifdef __cplusplus
117 #endif
119 #endif /* _KMDB_WR_IMPL_H */