summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/os/printf.c')
-rw-r--r--usr/src/uts/common/os/printf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/usr/src/uts/common/os/printf.c b/usr/src/uts/common/os/printf.c
index 1caedb33b6..c9e1524de0 100644
--- a/usr/src/uts/common/os/printf.c
+++ b/usr/src/uts/common/os/printf.c
@@ -21,6 +21,8 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
#include <sys/param.h>
@@ -48,6 +50,7 @@
#include <sys/panic.h>
#include <sys/spl.h>
#include <sys/zone.h>
+#include <sys/sunddi.h>
/*
* In some debugging situations it's useful to log all messages to panicbuf,
@@ -287,6 +290,21 @@ zcmn_err(zoneid_t zoneid, int ce, const char *fmt, ...)
va_end(adx);
}
+/*PRINTFLIKE3*/
+void
+dev_err(dev_info_t *dip, int ce, char *fmt, ...)
+{
+ va_list ap;
+ char buf[LOG_MSGSIZE];
+
+ (void) snprintf(buf, sizeof (buf), "%s%d: %s",
+ ddi_driver_name(dip), ddi_get_instance(dip), fmt);
+
+ va_start(ap, fmt);
+ vcmn_err(ce, buf, ap);
+ va_end(ap);
+}
+
int
assfail(const char *a, const char *f, int l)
{