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
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]
23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <mdb/mdb_modapi.h>
30 #include <mdb/mdb_ks.h>
31 #include <sys/logindmux_impl.h>
34 * Print our peer's upper queue pointer, and our lower queue pointer.
37 logdmux_uqinfo(const queue_t
*q
, char *buf
, size_t nbytes
)
40 uintptr_t peer
, lower
;
44 * First, get the pointer to our lower write queue.
46 (void) mdb_vread(&tmx
, sizeof (tmx
), (uintptr_t)q
->q_ptr
);
47 lower
= (uintptr_t)tmx
.muxq
;
50 * Now read in the lower's peer, and follow that to up to our peer.
52 (void) mdb_vread(&lq
, sizeof (lq
), (uintptr_t)tmx
.peerq
);
53 (void) mdb_vread(&tmx
, sizeof (tmx
), (uintptr_t)lq
.q_ptr
);
54 peer
= (uintptr_t)tmx
.rdq
;
56 (void) mdb_snprintf(buf
, nbytes
, "peer rq : %p\nlower wq : %p",
61 * Print our peer's lower queue pointer, and our upper queue pointer.
64 logdmux_lqinfo(const queue_t
*q
, char *buf
, size_t nbytes
)
68 (void) mdb_vread(&tmx
, sizeof (tmx
), (uintptr_t)q
->q_ptr
);
69 (void) mdb_snprintf(buf
, nbytes
, "peer wq : %p\nupper rq : %p",
70 (uintptr_t)tmx
.peerq
, (uintptr_t)tmx
.rdq
);
74 logdmux_lrnext(const queue_t
*q
)
78 (void) mdb_vread(&tmx
, sizeof (tmx
), (uintptr_t)q
->q_ptr
);
79 return ((uintptr_t)tmx
.rdq
);
83 logdmux_uwnext(const queue_t
*q
)
87 (void) mdb_vread(&tmx
, sizeof (tmx
), (uintptr_t)q
->q_ptr
);
88 return ((uintptr_t)tmx
.muxq
);
91 static const mdb_qops_t logdmux_uqops
= {
92 logdmux_uqinfo
, mdb_qrnext_default
, logdmux_uwnext
95 static const mdb_qops_t logdmux_lqops
= {
96 logdmux_lqinfo
, logdmux_lrnext
, mdb_qwnext_default
99 static const mdb_modinfo_t modinfo
= { MDB_API_VERSION
};
101 const mdb_modinfo_t
*
106 if (mdb_lookup_by_obj("logindmux", "logdmuxuwinit", &sym
) == 0)
107 mdb_qops_install(&logdmux_uqops
, (uintptr_t)sym
.st_value
);
108 if (mdb_lookup_by_obj("logindmux", "logdmuxlwinit", &sym
) == 0)
109 mdb_qops_install(&logdmux_lqops
, (uintptr_t)sym
.st_value
);
119 if (mdb_lookup_by_obj("logindmux", "logdmuxuwinit", &sym
) == 0)
120 mdb_qops_remove(&logdmux_uqops
, (uintptr_t)sym
.st_value
);
121 if (mdb_lookup_by_obj("logindmux", "logdmuxlwinit", &sym
) == 0)
122 mdb_qops_remove(&logdmux_lqops
, (uintptr_t)sym
.st_value
);