mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
Input: uinput - convert to dynalloc allocation
Also introduce proper locking when creating/deleting device. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
e753b650e1
commit
29506415a0
2 changed files with 170 additions and 154 deletions
|
@ -34,8 +34,7 @@
|
|||
#define UINPUT_BUFFER_SIZE 16
|
||||
#define UINPUT_NUM_REQUESTS 16
|
||||
|
||||
/* state flags => bit index for {set|clear|test}_bit ops */
|
||||
#define UIST_CREATED 0
|
||||
enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED };
|
||||
|
||||
struct uinput_request {
|
||||
int id;
|
||||
|
@ -52,11 +51,12 @@ struct uinput_request {
|
|||
|
||||
struct uinput_device {
|
||||
struct input_dev *dev;
|
||||
unsigned long state;
|
||||
struct semaphore sem;
|
||||
enum uinput_state state;
|
||||
wait_queue_head_t waitq;
|
||||
unsigned char ready,
|
||||
head,
|
||||
tail;
|
||||
unsigned char ready;
|
||||
unsigned char head;
|
||||
unsigned char tail;
|
||||
struct input_event buff[UINPUT_BUFFER_SIZE];
|
||||
|
||||
struct uinput_request *requests[UINPUT_NUM_REQUESTS];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue