aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/syscall.c
diff options
context:
space:
mode:
authorMarvin Borner2021-06-19 13:12:34 +0200
committerMarvin Borner2021-06-19 13:12:34 +0200
commit73a55007a44d23be40be681c4882fd6ad1e30b60 (patch)
tree87f37dff42d8ae51dbb2250f1752a03081298cc3 /kernel/features/syscall.c
parent02a0c882275959c0fbd58754418ecc1218821e76 (diff)
Improved bus and device management
Diffstat (limited to 'kernel/features/syscall.c')
-rw-r--r--kernel/features/syscall.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c
index 997fa96..16a83d6 100644
--- a/kernel/features/syscall.c
+++ b/kernel/features/syscall.c
@@ -63,10 +63,11 @@ static u32 syscall_handler(u32 esp)
break;
}
case SYS_DEV_READ: {
- res ready = dev_ready(frame->ebx);
- if (ready == -EAGAIN) {
+ // TODO: This could be done more elegant (e.g. with better bus design)
+ res ready;
+ while ((ready = dev_ready(frame->ebx)) == -EAGAIN)
dev_block(frame->ebx, proc_current());
- } else if (ready != EOK) {
+ if (ready != EOK) {
frame->eax = ready;
break;
}