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 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <sys/types.h>
30 #include <sys/cmn_err.h>
31 #include <sys/varargs.h>
32 #include <sys/bootconf.h>
33 #include <sys/sysmacros.h>
37 * The boot printing interfaces don't expose anything that'll allow us
38 * to print multiple arguments at once. That is, they expose printf-like
39 * interfaces, but these interfaces only support one format specifier per
40 * invocation. The routines in this file allow the rest of the driver
41 * to pretend that this limitation doesn't exist.
44 #include <kmdb/kctl/kctl.h>
47 kctl_vprintf(int code
, const char *format
, va_list ap
)
49 if (kctl
.kctl_boot_ops
== NULL
) {
50 vcmn_err(code
, format
, ap
);
56 BOP_PUTSARG(kctl
.kctl_boot_ops
, "WARNING: ", NULL
);
57 else if (code
== CE_NOTE
)
58 BOP_PUTSARG(kctl
.kctl_boot_ops
, "NOTE: ", NULL
);
60 (void) vsnprintf(buf
, sizeof (buf
), format
, ap
);
61 BOP_PUTSARG(kctl
.kctl_boot_ops
, "%s\n", buf
);
66 kctl_warn(const char *format
, ...)
71 kctl_vprintf(CE_WARN
, format
, ap
);
76 kctl_dprintf(const char *format
, ...)
80 if (!(kctl
.kctl_flags
& KMDB_F_DRV_DEBUG
))
84 kctl_vprintf(CE_NOTE
, format
, ap
);