]> git.corax.cc Git - corax/commitdiff
Make _int_handle(), _exc_handle(), and _sys_handle() void functions since the assembl...
authorMatthias Kruk <m@m10k.eu>
Wed, 2 Oct 2019 05:00:37 +0000 (14:00 +0900)
committerMatthias Kruk <m@m10k.eu>
Wed, 2 Oct 2019 05:00:37 +0000 (14:00 +0900)
kernel/arch/interrupt.c

index b0db93c5372f6d68944df5da8f02298993d9f183..ca1e2085b7e89b2e8274d260ed813cc54ef49746 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <config.h>
 #include <corax/types.h>
+#include <corax/errno.h>
 #include <debug.h>
 #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;
 }