version 1.23, 2007/02/09 21:55:30 |
version 1.23.20.2, 2008/03/23 02:04:55 |
|
|
/* $NetBSD$ */ |
/* wsevent.c,v 1.23.20.1 2008/01/09 01:54:49 matt Exp */ |
|
|
/*- |
/*- |
* Copyright (c) 2006 The NetBSD Foundation, Inc. |
* Copyright (c) 2006 The NetBSD Foundation, Inc. |
|
|
*/ |
*/ |
|
|
#include <sys/cdefs.h> |
#include <sys/cdefs.h> |
__KERNEL_RCSID(0, "$NetBSD$"); |
__KERNEL_RCSID(0, "wsevent.c,v 1.23.20.1 2008/01/09 01:54:49 matt Exp"); |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/kernel.h> |
#include <sys/kernel.h> |
Line 158 wsevent_init(struct wseventvar *ev, stru |
|
Line 158 wsevent_init(struct wseventvar *ev, stru |
|
ev->get = ev->put = 0; |
ev->get = ev->put = 0; |
ev->q = malloc((u_long)WSEVENT_QSIZE * sizeof(struct wscons_event), |
ev->q = malloc((u_long)WSEVENT_QSIZE * sizeof(struct wscons_event), |
M_DEVBUF, M_WAITOK|M_ZERO); |
M_DEVBUF, M_WAITOK|M_ZERO); |
|
selinit(&ev->sel); |
ev->io = p; |
ev->io = p; |
} |
} |
|
|
Line 173 wsevent_fini(struct wseventvar *ev) |
|
Line 174 wsevent_fini(struct wseventvar *ev) |
|
#endif |
#endif |
return; |
return; |
} |
} |
|
seldestroy(&ev->sel); |
free(ev->q, M_DEVBUF); |
free(ev->q, M_DEVBUF); |
ev->q = NULL; |
ev->q = NULL; |
} |
} |
Line 299 wsevent_kqfilter(struct wseventvar *ev, |
|
Line 301 wsevent_kqfilter(struct wseventvar *ev, |
|
break; |
break; |
|
|
default: |
default: |
return (1); |
return (EINVAL); |
} |
} |
|
|
kn->kn_hook = ev; |
kn->kn_hook = ev; |
|
|
wsevent_wakeup(struct wseventvar *ev) |
wsevent_wakeup(struct wseventvar *ev) |
{ |
{ |
|
|
selnotify(&ev->sel, 0); |
selnotify(&ev->sel, 0, 0); |
|
|
if (ev->wanted) { |
if (ev->wanted) { |
ev->wanted = 0; |
ev->wanted = 0; |