kernel: do preparation work for copyless read/write

This commit is contained in:
Matheus
2024-09-18 21:17:37 -03:00
parent 1140244816
commit 611f13b562
12 changed files with 134 additions and 47 deletions
+5
View File
@@ -122,6 +122,11 @@ static int read(int minor, void *buffer, size_t size, uintmax_t offset, int flag
}
*readc = ringbuffer_read(&mouse->packetbuffer, buffer, sizeof(mousepacket_t) * packetcount);
if (*readc == RINGBUFFER_USER_COPY_FAILED) {
error = EFAULT;
goto leave;
}
__assert(*readc);
leave: