ps2 mouse

This commit is contained in:
Matheus
2024-04-14 22:22:32 -03:00
parent 7215113c14
commit 7f297728fb
8 changed files with 332 additions and 4 deletions
+1
View File
@@ -15,6 +15,7 @@
#define DEV_MAJOR_E9 8
#define DEV_MAJOR_URANDOM 9
#define DEV_MAJOR_NET 10
#define DEV_MAJOR_MOUSE 11
typedef struct {
int (*open)(int minor, int flags);
+2 -1
View File
@@ -15,9 +15,10 @@
#define IPL_IGNORE -1
#define IPL_MAX 0
#define IPL_TIMER 1
#define IPL_KEYBOARD 2
#define IPL_NET 400
#define IPL_DISK 500
#define IPL_KEYBOARD 600
#define IPL_MOUSE 650
#define IPL_DPC 900
#define IPL_NORMAL 1000
+29
View File
@@ -0,0 +1,29 @@
#ifndef _MOUSE_H
#define _MOUSE_H
#include <ringbuffer.h>
#include <kernel/poll.h>
#define MOUSE_FLAG_RB 1
#define MOUSE_FLAG_MB 2
#define MOUSE_FLAG_LB 4
#define MOUSE_FLAG_B4 8
#define MOUSE_FLAG_B5 16
typedef struct {
int flags;
int x,y,z;
} mousepacket_t;
typedef struct {
ringbuffer_t packetbuffer;
spinlock_t lock;
pollheader_t pollheader;
int flags;
} mouse_t;
void mouse_init();
mouse_t *mouse_new();
void mouse_packet(mouse_t *mouse, mousepacket_t *packet);
#endif