svn commit: r272024 - in user/jceel/soc2014_evdev/head/sys: amd64/conf dev/evdev
Jakub Wojciech Klama
jceel at FreeBSD.org
Tue Sep 23 10:56:43 UTC 2014
Author: jceel
Date: Tue Sep 23 10:56:42 2014
New Revision: 272024
URL: http://svnweb.freebsd.org/changeset/base/272024
Log:
Changes as follows:
* Added vt(4) to EVDEV kernel config
* Fixed /dev/input/event%d device numbering
* Fixed uinput evdev_alloc()/evdev_free() to prevent memory leaks
Modified:
user/jceel/soc2014_evdev/head/sys/amd64/conf/EVDEV
user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c
user/jceel/soc2014_evdev/head/sys/dev/evdev/uinput.c
Modified: user/jceel/soc2014_evdev/head/sys/amd64/conf/EVDEV
==============================================================================
--- user/jceel/soc2014_evdev/head/sys/amd64/conf/EVDEV Tue Sep 23 08:39:08 2014 (r272023)
+++ user/jceel/soc2014_evdev/head/sys/amd64/conf/EVDEV Tue Sep 23 10:56:42 2014 (r272024)
@@ -186,6 +186,11 @@ device splash # Splash screen and scr
device sc
options SC_PIXEL_MODE # add support for the raster text mode
+# vt is the new video console driver
+device vt
+device vt_vga
+device vt_efifb
+
device agp # support several AGP chipsets
# PCCARD (PCMCIA) support
Modified: user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c
==============================================================================
--- user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c Tue Sep 23 08:39:08 2014 (r272023)
+++ user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c Tue Sep 23 10:56:42 2014 (r272024)
@@ -42,7 +42,7 @@
#include <dev/evdev/input.h>
#include <dev/evdev/evdev.h>
-//#define DEBUG
+#define DEBUG
#ifdef DEBUG
#define debugf(fmt, args...) printf("evdev: " fmt "\n", ##args);
#else
@@ -167,7 +167,7 @@ evdev_read(struct cdev *dev, struct uio
return (ret);
if (state->ecs_revoked)
- return (EPERM);
+ return (ENODEV);
client = state->ecs_client;
@@ -574,7 +574,7 @@ evdev_cdev_create(struct evdev_dev *evde
snprintf(evdev->ev_cdev_name, NAMELEN, "input/event%d",
evdev_cdev_count++);
cdev = make_dev(&evdev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
- evdev->ev_cdev_name, evdev_cdev_count++);
+ "%s", evdev->ev_cdev_name);
sc = malloc(sizeof(struct evdev_cdev_softc), M_EVDEV,
M_WAITOK | M_ZERO);
@@ -588,6 +588,8 @@ evdev_cdev_create(struct evdev_dev *evde
int
evdev_cdev_destroy(struct evdev_dev *evdev)
{
+
destroy_dev(evdev->ev_cdev);
+ evdev_cdev_count--;
return (0);
}
Modified: user/jceel/soc2014_evdev/head/sys/dev/evdev/uinput.c
==============================================================================
--- user/jceel/soc2014_evdev/head/sys/dev/evdev/uinput.c Tue Sep 23 08:39:08 2014 (r272023)
+++ user/jceel/soc2014_evdev/head/sys/dev/evdev/uinput.c Tue Sep 23 10:56:42 2014 (r272024)
@@ -57,9 +57,6 @@ static int uinput_poll(struct cdev *, in
static void uinput_dtor(void *);
static int uinput_setup_provider(struct evdev_dev *, struct uinput_user_dev *);
-
-
-
static int uinput_cdev_create(void);
static struct cdevsw uinput_cdevsw = {
@@ -120,11 +117,10 @@ uinput_dtor(void *data)
{
struct uinput_cdev_state *state = (struct uinput_cdev_state *)data;
- if (state->ucs_connected) {
+ if (state->ucs_connected)
evdev_unregister(NULL, state->ucs_evdev);
- evdev_free(state->ucs_evdev);
- }
+ evdev_free(state->ucs_evdev);
free(data, M_EVDEV);
}
@@ -258,8 +254,6 @@ uinput_ioctl(struct cdev *dev, u_long cm
return (0);
evdev_unregister(NULL, state->ucs_evdev);
- evdev_free(state->ucs_evdev);
- state->ucs_evdev = NULL;
state->ucs_connected = false;
break;
More information about the svn-src-user
mailing list