diff options
author | dzwdz | 2022-09-03 14:56:05 +0200 |
---|---|---|
committer | dzwdz | 2022-09-03 14:56:05 +0200 |
commit | 9889b47b5216bdcd301e2b63baf71683bcbb22af (patch) | |
tree | af8879a53ea7f6d249b4143d31a18e5363853d9f /src/kernel/arch/amd64/driver/util.h | |
parent | 6e4b9831f903e583d58de8b4265159f6d859ebc2 (diff) |
driver/ps2,serial: handle all pending reads at the same time
Diffstat (limited to 'src/kernel/arch/amd64/driver/util.h')
-rw-r--r-- | src/kernel/arch/amd64/driver/util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/kernel/arch/amd64/driver/util.h b/src/kernel/arch/amd64/driver/util.h index d89992a..06ca672 100644 --- a/src/kernel/arch/amd64/driver/util.h +++ b/src/kernel/arch/amd64/driver/util.h @@ -1,4 +1,5 @@ #pragma once +#include <shared/container/ring.h> #include <stdbool.h> #include <stddef.h> @@ -14,3 +15,7 @@ int req_readcopy(struct vfs_request *req, const void *buf, size_t len); void postqueue_join(struct vfs_request **queue, struct vfs_request *req); bool postqueue_pop(struct vfs_request **queue, void (*accept)(struct vfs_request *)); + +/** If there are any pending read requests, and the ring buffer isn't empty, fulfill them + * all with a single read. */ +void postqueue_ringreadall(struct vfs_request **queue, ring_t *r); |