changeset 384:287581b5d348

add init_kernel_context.cbc
author anatofuz
date Tue, 21 Jul 2020 14:31:11 +0900
parents 3f243b59bcee
children 4e9638616d31
files src/CMakeLists.txt src/init_kernel_context.cbc src/main.c
diffstat 3 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/CMakeLists.txt	Mon Jul 20 16:42:45 2020 +0900
+++ b/src/CMakeLists.txt	Tue Jul 21 14:31:11 2020 +0900
@@ -129,7 +129,7 @@
 	string.c arm.c asm.S bio.c buddy.c console.cbc exec.c file.cbc fs.c log.c main.c memide.c pipe.cbc proc.cbc spinlock.cbc
 	start.c swtch.S syscall.cbc sysfile.cbc sysproc.c trap_asm.S trap.cbc vm.c device/picirq.c device/timer.c device/uart.c
   SingleLinkedStack.cbc entry.S impl/vm_impl.cbc impl/vm_impl_private.cbc
-  impl/fs_impl.cbc impl/fs_impl_private.cbc impl/KernelRetImpl.cbc impl/KernelError.cbc impl/SyscallDispatchImpl.cbc impl/CbCProcImpl.cbc
+  impl/fs_impl.cbc impl/fs_impl_private.cbc impl/KernelRetImpl.cbc impl/KernelError.cbc impl/SyscallDispatchImpl.cbc impl/CbCProcImpl.cbc init_kernel_context.cbc
 )
 
 # sys_read_impl.cbc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/init_kernel_context.cbc	Tue Jul 21 14:31:11 2020 +0900
@@ -0,0 +1,5 @@
+#include "context.h"
+
+void initKernelContext(struct KernelContext* kernel_context) {
+    kernel_context->panicked = 0;
+}
--- a/src/main.c	Mon Jul 20 16:42:45 2020 +0900
+++ b/src/main.c	Tue Jul 21 14:31:11 2020 +0900
@@ -39,6 +39,7 @@
 
     kernel_context = calloc(sizeof(struct KernelContext), 1);
     initContext(&kernel_context->context);
+    initKernelContext(&kernel_context);
 
     trap_init ();				// vector table and stacks for models
     pic_init (P2V(VIC_BASE));	// interrupt controller