sched: copy serial date to userspace on trap
This commit is contained in:
parent
210663fe0f
commit
8ac4b2e260
2 changed files with 5 additions and 2 deletions
|
|
@ -86,12 +86,14 @@ ssize_t serial_read(char *buf)
|
|||
char c;
|
||||
ret = ringbuf_read(tty0->data, &c, 1);
|
||||
|
||||
struct proc *proc = proc_find(getpid());
|
||||
while ((ret = ringbuf_read(tty0->data, &c, 1)) <= 0) {
|
||||
struct proc *proc = proc_find(getpid());
|
||||
proc_block(proc, tty0, buf, true, 1);
|
||||
sswtch();
|
||||
}
|
||||
|
||||
copy_to_user(proc, buf, &c, 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue