refactor: one more step towards arch-agnostic design
[lunaix-os.git] / lunaix-os / kernel / device / input.c
index 5ddf6a4ce3cc0067b58e2a31aa1630b3e33c9d94..bf4c157039399af5124d2e579e6cd846418c45f7 100644 (file)
@@ -1,5 +1,6 @@
 #include <lunaix/clock.h>
 #include <lunaix/input.h>
+#include <lunaix/mm/page.h>
 #include <lunaix/mm/valloc.h>
 #include <lunaix/spike.h>
 #include <lunaix/status.h>
@@ -62,6 +63,12 @@ __input_dev_read(struct device* dev, void* buf, size_t offset, size_t len)
     return sizeof(struct input_evt_pkt);
 }
 
+int
+__input_dev_read_pg(struct device* dev, void* buf, size_t offset)
+{
+    return __input_dev_read(dev, buf, offset, PG_SIZE);
+}
+
 struct input_device*
 input_add_device(char* name_fmt, ...)
 {
@@ -78,6 +85,7 @@ input_add_device(char* name_fmt, ...)
 
     idev->dev_if = dev;
     dev->read = __input_dev_read;
+    dev->read_page = __input_dev_read_pg;
 
     va_end(args);