X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/5ea8e2ba737f903db81d49b56778e883634512a5..8efc0cf32160c68772a2ce1887e6a397852d3d96:/lunaix-os/kernel/device/input.c diff --git a/lunaix-os/kernel/device/input.c b/lunaix-os/kernel/device/input.c index 5ddf6a4..52c8820 100644 --- a/lunaix-os/kernel/device/input.c +++ b/lunaix-os/kernel/device/input.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -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, ...) { @@ -74,10 +81,11 @@ input_add_device(char* name_fmt, ...) va_start(args, name_fmt); struct device* dev = - device_add(input_devcat, idev, name_fmt, DEV_IFSEQ, args); + device_add_vargs(input_devcat, idev, name_fmt, DEV_IFSEQ, args); idev->dev_if = dev; - dev->read = __input_dev_read; + dev->ops.read = __input_dev_read; + dev->ops.read_page = __input_dev_read_pg; va_end(args);