From: Matthias Kruk Date: Wed, 2 Oct 2019 05:00:37 +0000 (+0900) Subject: Make _int_handle(), _exc_handle(), and _sys_handle() void functions since the assembl... X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=a6521d2fea3ca1a48ec80b5a2b3a9b33fb039d65;p=corax Make _int_handle(), _exc_handle(), and _sys_handle() void functions since the assembly code that calls them ignores the return value --- diff --git a/kernel/arch/interrupt.c b/kernel/arch/interrupt.c index b0db93c..ca1e208 100644 --- a/kernel/arch/interrupt.c +++ b/kernel/arch/interrupt.c @@ -18,6 +18,7 @@ #include #include +#include #include #include "cpu.h" #include "defs.h" @@ -36,7 +37,7 @@ extern void _apic_eoi(u32_t); extern void _i8259_eoi(u32_t); #endif /* CONFIG_APIC */ -int _int_handle(stack_frame_t ctx) +void _int_handle(stack_frame_t ctx) { switch(ctx.intn) { #if CONFIG_APIC == 1 @@ -116,10 +117,10 @@ int _int_handle(stack_frame_t ctx) break; } - return(0); + return; } -int _exc_handle(stack_frame_t ctx) +void _exc_handle(stack_frame_t ctx) { dbg_printf("Exception %u [%s] occurred. Error code 0x%08x.\n", ctx.intn, ctx.intn < EXC_MAX ? _exc_name[ctx.intn] : 0, ctx.error); dbg_printf("Fault in 0x%02x:%08x; EFLAGS = 0x%08x\n", ctx.cs, ctx.eip, ctx.eflags); @@ -133,11 +134,15 @@ int _exc_handle(stack_frame_t ctx) PANIC("Unhandled exception"); - return(0); + return; } -int _sys_handle(stack_frame_t ctx) +void _sys_handle(stack_frame_t ctx) { + int ret_val; + + ret_val = -ENOSYS; + switch(ctx.intn) { case SYS_VECTOR_CORAX: dbg_printf("_corax_call(0x%x, 0x%x, 0x%x);\n", ctx.eax, ctx.ebx, ctx.ecx); @@ -154,5 +159,7 @@ int _sys_handle(stack_frame_t ctx) break; } - return(0); + ctx.eax = ret_val; + + return; }