Nice userspace wrappers for ps2kb driver

This commit is contained in:
2025-09-07 22:24:34 +02:00
parent 659f98910d
commit e71361dcca
4 changed files with 23 additions and 3 deletions

View File

@ -10,6 +10,7 @@ SRCFILES := $(call GRABSRC, \
string \
system \
printf \
devices \
)
CFLAGS += -isystem $(ROOT)/share -isystem $(ROOT)/ulib -isystem $(ROOT)/std/include \

8
ulib/devices/ps2kb.c Normal file
View File

@ -0,0 +1,8 @@
#include <stdint.h>
#include <sysdefs/ipcpipe.h>
#include <system/ipcpipe.h>
int32_t dev_ps2kb_read(int32_t *ch) {
return ipcpipe(1, 0, IPCPIPE_READ, (uint8_t *)ch, sizeof(*ch));
}

10
ulib/devices/ps2kb.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef ULIB_DEVICES_PS2KB_H_
#define ULIB_DEVICES_PS2KB_H_
#include <stdint.h>
#define PS2KB_C(x) ((x) - '@')
int32_t dev_ps2kb_read(int32_t *ch);
#endif // ULIB_DEVICES_PS2KB_H_