Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/wscons give up some silly macros which were only use...
details: https://anonhg.NetBSD.org/src/rev/3b2e1fef8294
branches: trunk
changeset: 751374:3b2e1fef8294
user: drochner <drochner%NetBSD.org@localhost>
date: Tue Feb 02 16:54:40 2010 +0000
description:
give up some silly macros which were only used ~once, and reduce
dependency on "locators.h"
makes the code more LKM frienly
diffstat:
sys/dev/wscons/wsdisplay.c | 18 ++++++++++--------
sys/dev/wscons/wsdisplayvar.h | 9 +--------
2 files changed, 11 insertions(+), 16 deletions(-)
diffs (87 lines):
diff -r 79f6dc8735bf -r 3b2e1fef8294 sys/dev/wscons/wsdisplay.c
--- a/sys/dev/wscons/wsdisplay.c Tue Feb 02 16:25:30 2010 +0000
+++ b/sys/dev/wscons/wsdisplay.c Tue Feb 02 16:54:40 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.129 2010/02/02 16:18:29 drochner Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.130 2010/02/02 16:54:40 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.129 2010/02/02 16:18:29 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.130 2010/02/02 16:54:40 drochner Exp $");
#include "opt_wsdisplay_compat.h"
#include "opt_wsmsgattrs.h"
@@ -66,6 +66,8 @@
#include <dev/wscons/wscons_callbacks.h>
#include <dev/cons.h>
+#include "locators.h"
+
struct wsscreen_internal {
const struct wsdisplay_emulops *emulops;
void *emulcookie;
@@ -524,13 +526,13 @@
{
struct wsemuldisplaydev_attach_args *ap = aux;
- if (match->wsemuldisplaydevcf_console !=
- WSEMULDISPLAYDEVCF_CONSOLE_UNK) {
+ if (match->cf_loc[WSEMULDISPLAYDEVCF_CONSOLE] !=
+ WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT) {
/*
* If console-ness of device specified, either match
* exactly (at high priority), or fail.
*/
- if (match->wsemuldisplaydevcf_console != 0 &&
+ if (match->cf_loc[WSEMULDISPLAYDEVCF_CONSOLE] != 0 &&
ap->console != 0)
return (10);
else
@@ -554,8 +556,8 @@
ap->console = 0;
wsdisplay_common_attach(sc, ap->console,
- device_cfdata(self)->wsemuldisplaydevcf_kbdmux, ap->scrdata,
- ap->accessops, ap->accesscookie);
+ device_cfdata(self)->cf_loc[WSEMULDISPLAYDEVCF_KBDMUX],
+ ap->scrdata, ap->accessops, ap->accesscookie);
if (ap->console) {
int maj;
@@ -605,7 +607,7 @@
sc->sc_dev = self;
wsdisplay_common_attach(sc, 0,
- device_cfdata(self)->wsemuldisplaydevcf_kbdmux, NULL,
+ device_cfdata(self)->cf_loc[WSDISPLAYDEVCF_KBDMUX], NULL,
ap->accessops, ap->accesscookie);
}
diff -r 79f6dc8735bf -r 3b2e1fef8294 sys/dev/wscons/wsdisplayvar.h
--- a/sys/dev/wscons/wsdisplayvar.h Tue Feb 02 16:25:30 2010 +0000
+++ b/sys/dev/wscons/wsdisplayvar.h Tue Feb 02 16:54:40 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplayvar.h,v 1.47 2008/03/25 00:49:20 cube Exp $ */
+/* $NetBSD: wsdisplayvar.h,v 1.48 2010/02/02 16:54:40 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -149,13 +149,6 @@
void *accesscookie; /* access cookie */
};
-#include "locators.h"
-
-#define wsemuldisplaydevcf_console cf_loc[WSEMULDISPLAYDEVCF_CONSOLE] /* spec'd as console? */
-#define WSEMULDISPLAYDEVCF_CONSOLE_UNK (WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT)
-#define wsemuldisplaydevcf_kbdmux cf_loc[WSEMULDISPLAYDEVCF_KBDMUX]
-#define wsdisplaydevcf_kbdmux cf_loc[WSDISPLAYDEVCF_KBDMUX]
-
struct wscons_syncops {
int (*detach)(void *, int, void (*)(void *, int, int), void *);
int (*attach)(void *, int, void (*)(void *, int, int), void *);
Home |
Main Index |
Thread Index |
Old Index