Skip to content

Commit 8d2e19b

Browse files
author
Diego Ferrari
committed
[SYSCALL] syscall depth fix
1 parent 22065b1 commit 8d2e19b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎kernel/process/syscall.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ uint64_t syscall_char_size(process_t *ctx){
7474
}
7575

7676
uint64_t syscall_sleep(process_t *ctx){
77+
syscall_depth--;
7778
sleep_process(ctx->PROC_X0);
7879
return 0;
7980
}
8081

8182
uint64_t syscall_halt(process_t *ctx){
8283
kprintf("Process has ended with code %i",ctx->PROC_X0);
84+
syscall_depth--;
8385
stop_current_process(ctx->PROC_X0);
8486
return 0;
8587
}
@@ -213,6 +215,7 @@ void sync_el0_handler_c(){
213215
asm volatile ("mrs %0, far_el1" : "=r"(far));
214216
if (far == 0){
215217
kprintf("Process has exited %x",x0);
218+
syscall_depth--;
216219
stop_current_process(x0);
217220
}
218221
}
@@ -226,6 +229,7 @@ void sync_el0_handler_c(){
226229
} else {
227230
kprintf("Process has crashed. ESR: %x. ELR: %x. FAR: %x", esr, elr, far);
228231
coredump(esr, elr, far);
232+
syscall_depth--;
229233
stop_current_process(ec);
230234
}
231235
}

0 commit comments

Comments
 (0)