From 4ed3f29e7f159d57a072126be10dd8b7518e2263 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Mon, 19 May 2014 10:18:55 +0200 Subject: [PATCH] Message type for INPUT_EVENT Change-Id: I50a815623ff4a9b6b0113000a798a3495c911ecf --- include/minix/com.h | 9 +++------ include/minix/ipc.h | 13 +++++++++++++ lib/libinputdriver/inputdriver.c | 10 +++++----- servers/input/input.c | 12 ++++++------ 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/include/minix/com.h b/include/minix/com.h index daf95b79c..0b5b0c2dd 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -1071,7 +1071,9 @@ /* This message uses no message fields. */ #define TTY_INPUT_EVENT (TTY_RQ_BASE + 3) /* relayed input event */ -/* This message shares its message fields with INPUT_EVENT. */ +# define INPUT_PAGE m7_i2 /* usage page */ +# define INPUT_CODE m7_i3 /* usage code */ +# define INPUT_VALUE m7_i4 /* event value */ /*===========================================================================* * Messages for input server and drivers * @@ -1087,11 +1089,6 @@ # define INPUT_LED_MASK m7_i1 /* status mask of LEDs */ #define INPUT_EVENT (INPUT_RS_BASE + 0) /* send input event */ -# define INPUT_ID m7_i1 /* device ID */ -# define INPUT_PAGE m7_i2 /* usage page */ -# define INPUT_CODE m7_i3 /* usage code */ -# define INPUT_VALUE m7_i4 /* event value */ -# define INPUT_FLAGS m7_i5 /* flags associated with value */ /*===========================================================================* * VFS-FS TRANSACTION IDs * diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 0c9a7f662..0e449e284 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -640,6 +640,17 @@ typedef struct { } mess_input_linputdriver_input_conf; _ASSERT_MSG_SIZE(mess_input_linputdriver_input_conf); +typedef struct { + int id; + int page; + int code; + int value; + int flags; + + uint8_t padding[36]; +} mess_linputdriver_input_event; +_ASSERT_MSG_SIZE(mess_linputdriver_input_event); + typedef struct { uint32_t flags; endpoint_t endpoint; @@ -1309,6 +1320,8 @@ typedef struct { mess_li2cdriver_i2c_busc_i2c_exec m_li2cdriver_i2c_busc_i2c_exec; mess_li2cdriver_i2c_busc_i2c_reserve m_li2cdriver_i2c_busc_i2c_reserve; + mess_linputdriver_input_event m_linputdriver_input_event; + mess_lsys_krn_schedctl m_lsys_krn_schedctl; mess_lsys_krn_schedule m_lsys_krn_schedule; diff --git a/lib/libinputdriver/inputdriver.c b/lib/libinputdriver/inputdriver.c index 74c1f38da..480aa0c44 100644 --- a/lib/libinputdriver/inputdriver.c +++ b/lib/libinputdriver/inputdriver.c @@ -56,11 +56,11 @@ inputdriver_send_event(int mouse, unsigned short page, unsigned short code, memset(&m, 0, sizeof(m)); m.m_type = INPUT_EVENT; - m.INPUT_ID = id; - m.INPUT_PAGE = page; - m.INPUT_CODE = code; - m.INPUT_VALUE = value; - m.INPUT_FLAGS = flags; + m.m_linputdriver_input_event.id = id; + m.m_linputdriver_input_event.page = page; + m.m_linputdriver_input_event.code = code; + m.m_linputdriver_input_event.value = value; + m.m_linputdriver_input_event.flags = flags; /* * Use a blocking send call, for two reasons. First, this avoids the diff --git a/servers/input/input.c b/servers/input/input.c index 1b06edaef..99e082f7b 100644 --- a/servers/input/input.c +++ b/servers/input/input.c @@ -345,11 +345,11 @@ input_process(struct input_dev *input_dev, const message *m) #endif } next = (input_dev->tail + input_dev->count) % EVENTBUF_SIZE; - input_dev->eventbuf[next].page = m->INPUT_PAGE; - input_dev->eventbuf[next].code = m->INPUT_CODE; - input_dev->eventbuf[next].value = m->INPUT_VALUE; - input_dev->eventbuf[next].flags = m->INPUT_FLAGS; - input_dev->eventbuf[next].devid = m->INPUT_ID; + input_dev->eventbuf[next].page = m->m_linputdriver_input_event.page; + input_dev->eventbuf[next].code = m->m_linputdriver_input_event.code; + input_dev->eventbuf[next].value = m->m_linputdriver_input_event.value; + input_dev->eventbuf[next].flags = m->m_linputdriver_input_event.flags; + input_dev->eventbuf[next].devid = m->m_linputdriver_input_event.id; input_dev->eventbuf[next].rsvd[0] = 0; input_dev->eventbuf[next].rsvd[1] = 0; input_dev->count++; @@ -380,7 +380,7 @@ input_event(message *m) int r, id; /* Unlike minor numbers, device IDs are in fact array indices. */ - id = m->INPUT_ID; + id = m->m_linputdriver_input_event.id; if (id < 0 || id >= INPUT_DEV_MAX) return; -- 2.44.0