diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2014-12-22 20:08:06 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2014-12-22 20:08:06 +0000 |
commit | 2aeb75c0a97e4ba4b8eeb48b9e0cf45a21b6c8f1 (patch) | |
tree | d4d46baea9e6e7039a5654e20f378afc6dad13e4 /sys | |
parent | ddecdefcf0820326a418a46029a662921f3ec05f (diff) |
Replace switch workq with taskq, using the blambert@ method (tm).
Tested with non-drm and wsfb systems. ok kettenis@ miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/rasops/rasops.c | 16 | ||||
-rw-r--r-- | sys/dev/rasops/rasops.h | 7 |
2 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index f881a6540eb..6dae03cb11d 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.36 2014/12/19 22:44:58 guenther Exp $ */ +/* $OpenBSD: rasops.c,v 1.37 2014/12/22 20:08:05 krw Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -34,7 +34,7 @@ #include <sys/malloc.h> #include <sys/systm.h> #include <sys/time.h> -#include <sys/workq.h> +#include <sys/task.h> #include <sys/endian.h> #include <dev/wscons/wsdisplayvar.h> @@ -274,6 +274,8 @@ rasops_init(struct rasops_info *ri, int wantrows, int wantcols) ri->ri_ops.unpack_attr = rasops_vcons_unpack_attr; } + task_set(&ri->ri_switchtask, rasops_doswitch, ri, NULL); + rasops_init_devcmap(ri); return (0); } @@ -1425,23 +1427,23 @@ rasops_show_screen(void *v, void *cookie, int waitok, { struct rasops_info *ri = v; + ri->ri_switchcookie = cookie; if (cb) { ri->ri_switchcb = cb; ri->ri_switchcbarg = cbarg; - workq_queue_task(NULL, &ri->ri_switchwqt, 0, - rasops_doswitch, v, cookie); + task_add(systq, &ri->ri_switchtask); return (EAGAIN); } - rasops_doswitch(v, cookie); + rasops_doswitch(ri, NULL); return (0); } void -rasops_doswitch(void *v, void *cookie) +rasops_doswitch(void *v, void *dummy) { struct rasops_info *ri = v; - struct rasops_screen *scr = cookie; + struct rasops_screen *scr = ri->ri_switchcookie; int row, col; long attr; diff --git a/sys/dev/rasops/rasops.h b/sys/dev/rasops/rasops.h index bda5e40e1a3..31bbb577240 100644 --- a/sys/dev/rasops/rasops.h +++ b/sys/dev/rasops/rasops.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.h,v 1.15 2013/10/20 21:24:00 miod Exp $ */ +/* $OpenBSD: rasops.h,v 1.16 2014/12/22 20:08:05 krw Exp $ */ /* $NetBSD: rasops.h,v 1.13 2000/06/13 13:36:54 ad Exp $ */ /*- @@ -33,7 +33,7 @@ #ifndef _RASOPS_H_ #define _RASOPS_H_ 1 -#include <sys/workq.h> +#include <sys/task.h> #ifdef SMALL_KERNEL #define RASOPS_SMALL @@ -125,7 +125,8 @@ struct rasops_info { void (*ri_switchcb)(void *, int, int); void *ri_switchcbarg; - struct workq_task ri_switchwqt; + void *ri_switchcookie; + struct task ri_switchtask; int (*ri_putchar)(void *, int, int, u_int, long); int (*ri_copycols)(void *, int, int, int, int); |