From 9e528320cf2e7acb90c2caaae67a12e3a28d7b26 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Mon, 8 Nov 2021 22:31:57 +0100 Subject: [PATCH] syscall fix variable decl --- core/syscall.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/core/syscall.c b/core/syscall.c index fe350a2..19b3a21 100644 --- a/core/syscall.c +++ b/core/syscall.c @@ -1,36 +1,39 @@ +#include "syscall.h" #include "keyboard.h" #include "klibc.h" #include "stdarg.h" -#include "syscall.h" #include "thread.h" -int syscallExecute(int syscallId, const struct cpu_state *userCtx){ +int syscallExecute(int syscallId, const struct cpu_state *userCtx) +{ int ret; switch (syscallId) { - case SYSCALL_ID_EXIT: + case SYSCALL_ID_EXIT: { uint status; ret = syscallGet1arg(userCtx, &status); - if(ret != 0) + if (ret != 0) break; threadExit(); assert(0); break; + } case SYSCALL_ID_YOLO: ret = printf("YOLO FROM USERSPACE\n"); break; - case SYSCALL_ID_PUTC: + case SYSCALL_ID_PUTC: { unsigned int c; ret = syscallGet1arg(userCtx, &c); putc(c); break; + } case SYSCALL_ID_READ: ret = keyboardRead(); break; default: - printf("Unknon syscall id %d\n", syscallId); - ret = -ENOENT; + printf("Unknon syscall id %d\n", syscallId); + ret = -ENOENT; } return ret; }