Module Name: src
Committed By: dyoung
Date: Fri Jan 21 17:46:20 UTC 2011
Modified Files:
src/sys/dev/ic: ath_netbsd.c ath_netbsd.h
src/sys/kern: subr_prf.c
src/sys/sys: systm.h
Log Message:
Move device_printf() from ath_netbsd.c to subr_prf.c for reuse in a new
driver.
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/ath_netbsd.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/ath_netbsd.h
cvs rdiff -u -r1.138 -r1.139 src/sys/kern/subr_prf.c
cvs rdiff -u -r1.245 -r1.246 src/sys/sys/systm.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/ath_netbsd.c
diff -u src/sys/dev/ic/ath_netbsd.c:1.17 src/sys/dev/ic/ath_netbsd.c:1.18
--- src/sys/dev/ic/ath_netbsd.c:1.17 Mon Oct 19 23:19:39 2009
+++ src/sys/dev/ic/ath_netbsd.c Fri Jan 21 17:46:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ath_netbsd.c,v 1.17 2009/10/19 23:19:39 rmind Exp $ */
+/* $NetBSD: ath_netbsd.c,v 1.18 2011/01/21 17:46:19 dyoung Exp $ */
/*-
* Copyright (c) 2003, 2004 David Young
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ath_netbsd.c,v 1.17 2009/10/19 23:19:39 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ath_netbsd.c,v 1.18 2011/01/21 17:46:19 dyoung Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -57,18 +57,6 @@
#include <dev/ic/ath_netbsd.h>
#include <dev/ic/athvar.h>
-void
-device_printf(device_t dev, const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- printf("%s: ", device_xname(dev));
- vprintf(fmt, ap);
- va_end(ap);
- return;
-}
-
/*
* Setup sysctl(3) MIB, hw.ath.*.
*
Index: src/sys/dev/ic/ath_netbsd.h
diff -u src/sys/dev/ic/ath_netbsd.h:1.10 src/sys/dev/ic/ath_netbsd.h:1.11
--- src/sys/dev/ic/ath_netbsd.h:1.10 Fri Mar 19 01:31:11 2010
+++ src/sys/dev/ic/ath_netbsd.h Fri Jan 21 17:46:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ath_netbsd.h,v 1.10 2010/03/19 01:31:11 dyoung Exp $ */
+/* $NetBSD: ath_netbsd.h,v 1.11 2011/01/21 17:46:19 dyoung Exp $ */
/*-
* Copyright (c) 2003, 2004 David Young
@@ -119,8 +119,6 @@
SYSCTL_DESCR(__descr), NULL, 0, &ath_##__var, 0, CTL_CREATE,\
CTL_EOL)
-extern void device_printf(device_t, const char *fmt, ...)
- __attribute__((__format__(__printf__,2,3)));
const struct sysctlnode *ath_sysctl_treetop(struct sysctllog **);
const struct sysctlnode *ath_sysctl_instance(const char *, struct sysctllog **);
Index: src/sys/kern/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.138 src/sys/kern/subr_prf.c:1.139
--- src/sys/kern/subr_prf.c:1.138 Tue Jan 26 12:59:50 2010
+++ src/sys/kern/subr_prf.c Fri Jan 21 17:46:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_prf.c,v 1.138 2010/01/26 12:59:50 he Exp $ */
+/* $NetBSD: subr_prf.c,v 1.139 2011/01/21 17:46:19 dyoung Exp $ */
/*-
* Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.138 2010/01/26 12:59:50 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.139 2011/01/21 17:46:19 dyoung Exp $");
#include "opt_ddb.h"
#include "opt_ipkdb.h"
@@ -1138,6 +1138,18 @@
} \
}
+void
+device_printf(device_t dev, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ printf("%s: ", device_xname(dev));
+ vprintf(fmt, ap);
+ va_end(ap);
+ return;
+}
+
/*
* Guts of kernel printf. Note, we already expect to be in a mutex!
*/
Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.245 src/sys/sys/systm.h:1.246
--- src/sys/sys/systm.h:1.245 Thu Dec 30 16:49:25 2010
+++ src/sys/sys/systm.h Fri Jan 21 17:46:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: systm.h,v 1.245 2010/12/30 16:49:25 pooka Exp $ */
+/* $NetBSD: systm.h,v 1.246 2011/01/21 17:46:19 dyoung Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
@@ -48,10 +48,10 @@
#ifdef _KERNEL
#include <sys/types.h>
+#include <sys/device_if.h>
#endif
struct clockframe;
-struct device;
struct lwp;
struct proc;
struct timeval;
@@ -89,7 +89,7 @@
extern dev_t rootdev; /* root device */
extern struct vnode *rootvp; /* vnode equivalent to above */
-extern struct device *root_device; /* device equivalent to above */
+extern device_t root_device; /* device equivalent to above */
extern const char *rootspec; /* how root device was specified */
extern int ncpu; /* number of CPUs configured */
@@ -187,17 +187,18 @@
void aprint_debug(const char *, ...)
__attribute__((__format__(__printf__,1,2)));
-struct device;
+void device_printf(device_t, const char *fmt, ...)
+ __attribute__((__format__(__printf__,2,3)));
-void aprint_normal_dev(struct device *, const char *, ...)
+void aprint_normal_dev(device_t, const char *, ...)
__attribute__((__format__(__printf__,2,3)));
-void aprint_error_dev(struct device *, const char *, ...)
+void aprint_error_dev(device_t, const char *, ...)
__attribute__((__format__(__printf__,2,3)));
-void aprint_naive_dev(struct device *, const char *, ...)
+void aprint_naive_dev(device_t, const char *, ...)
__attribute__((__format__(__printf__,2,3)));
-void aprint_verbose_dev(struct device *, const char *, ...)
+void aprint_verbose_dev(device_t, const char *, ...)
__attribute__((__format__(__printf__,2,3)));
-void aprint_debug_dev(struct device *, const char *, ...)
+void aprint_debug_dev(device_t, const char *, ...)
__attribute__((__format__(__printf__,2,3)));
struct ifnet;
@@ -367,10 +368,10 @@
#define ROOT_FSTYPE_ANY "?"
extern const char *rootfstype;
-void *mountroothook_establish(void (*)(struct device *), struct device *);
+void *mountroothook_establish(void (*)(device_t), device_t);
void mountroothook_disestablish(void *);
void mountroothook_destroy(void);
-void domountroothook(struct device *);
+void domountroothook(device_t);
/*
* Exec hooks. Subsystems may want to do cleanup when a process