summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-10-18 14:17:24 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-10-18 14:17:24 +0000
commit5ab69dd0535deb5307a201b5f1eb2d4167f54183 (patch)
tree51f9e57acbd046c03815c62f3f7c43dde6d3c88f /sys
parent26e224bf402db9c36502c7564577569d678e526d (diff)
Add a conditional to disable most of the `abort state' code in the emulation
code. Enable this if SMALL_KERNEL, since this code is currently only really needed for udl(4) which is not on any tight (SMALL_KERNEL) installation media.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/wscons/wscons_features.h7
-rw-r--r--sys/dev/wscons/wsemulvar.h12
2 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/wscons/wscons_features.h b/sys/dev/wscons/wscons_features.h
index 459059d3fe9..b18603fe4e8 100644
--- a/sys/dev/wscons/wscons_features.h
+++ b/sys/dev/wscons/wscons_features.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wscons_features.h,v 1.1 2013/10/18 13:54:08 miod Exp $ */
+/* $OpenBSD: wscons_features.h,v 1.2 2013/10/18 14:17:23 miod Exp $ */
/* public domain */
/*
@@ -15,6 +15,10 @@
* wsdisplay supports this
* HAVE_JUMP_SCROLL
* defined to enable jump scroll in the textmode emulation code
+ * HAVE_RESTARTABLE_EMULOPS
+ * defined to disable most of the restartable emulops code (to be used
+ * only if all wsdisplay drivers are compliant, i.e. no udl(4) in the
+ * kernel configuration)
*/
#ifdef _KERNEL
@@ -24,6 +28,7 @@
#define HAVE_BURNER_SUPPORT
#define HAVE_SCROLLBACK_SUPPORT
#define HAVE_JUMP_SCROLL
+#define HAVE_RESTARTABLE_EMULOPS
#endif
#endif
diff --git a/sys/dev/wscons/wsemulvar.h b/sys/dev/wscons/wsemulvar.h
index b9256573ec7..77a9fd38fed 100644
--- a/sys/dev/wscons/wsemulvar.h
+++ b/sys/dev/wscons/wsemulvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsemulvar.h,v 1.13 2010/07/01 02:33:06 maja Exp $ */
+/* $OpenBSD: wsemulvar.h,v 1.14 2013/10/18 14:17:23 miod Exp $ */
/* $NetBSD: wsemulvar.h,v 1.6 1999/01/17 15:46:15 drochner Exp $ */
/*
@@ -48,6 +48,8 @@
#ifdef _KERNEL
+#include <dev/wscons/wscons_features.h>
+
struct device;
struct wsdisplay_emulops;
@@ -165,6 +167,7 @@ wsemul_reset_abortstate(struct wsemul_abortstate *was)
* Wrapper macro to handle failing emulops calls consistently.
*/
+#ifdef HAVE_RESTARTABLE_EMULOPS
#define WSEMULOP(rc, edp, was, rutin, args) \
do { \
if ((was)->skip != 0) { \
@@ -176,5 +179,12 @@ do { \
if ((rc) == 0) \
(was)->done++; \
} while (0)
+#else
+#define WSEMULOP(rc, edp, was, rutin, args) \
+do { \
+ (void)(*(edp)->emulops->rutin) args ; \
+ (rc) = 0; \
+} while(0)
+#endif
#endif /* _KERNEL */