Mercurial > hg > CbC > CbC_xv6
changeset 272:600fd7db5344
fix_build_about_kernel_error
author | anatofuz |
---|---|
date | Thu, 06 Feb 2020 17:58:56 +0900 |
parents | 11cd1c607427 |
children | b58517e62ebf |
files | src/CMakeLists.txt src/impl/KernelError.cbc src/impl/KernelError.h src/interface/Err.h src/interface/Error.h |
diffstat | 5 files changed, 25 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/CMakeLists.txt Thu Feb 06 17:40:44 2020 +0900 +++ b/src/CMakeLists.txt Thu Feb 06 17:58:56 2020 +0900 @@ -128,7 +128,7 @@ SOURCES 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.c 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/kernel_error.cbc + SingleLinkedStack.cbc entry.S impl/vm_impl.cbc impl/vm_impl_private.cbc impl/KernelError.cbc ) # sys_read_impl.cbc
--- a/src/impl/KernelError.cbc Thu Feb 06 17:40:44 2020 +0900 +++ b/src/impl/KernelError.cbc Thu Feb 06 17:58:56 2020 +0900 @@ -1,5 +1,6 @@ -#include "../context.h" -#interface "Error.h" +#include "param.h" +#include "proc.h" +#interface "Err.h" // ---- // typedef struct KernelError <Type, Isa> impl Error { @@ -7,27 +8,27 @@ // } KernelError; // ---- -Error* createKernelError(struct Context* cbc_context) { - struct Error* error = new Error(); +Err* createKernelError(struct Context* cbc_context) { + struct Err* err = new Err(); struct KernelError* kernel_error = new KernelError(); - error->error = (union Data*)kernel_error; - kernel_error->error = (union Data*)kernel_error; - kernel_error->t = 0; - kernel_error->infinity_loop = C_infinity_loop; - error->error = C_errorKernelError; - error->panic = C_panicKernelError; - return error; + err->err = (union Data*)kernel_error; + kernel_error->err = (union Data*)kernel_error; + kernel_error->infinity_loop = C_infinity_loopKernelError; + err->error = C_errorKernelError; + err->panic = C_panicKernelError; + return err; } -__code infinity_loopKernelError(struct KernelError* error, next(...)) { + +__code infinity_loopKernelError(struct KernelError* err, __code next(...)) { } -__code errorKernelError(struct KernelError* error, int err_code, __code next(...)) { +__code errorKernelError(struct KernelError* err, int err_code, __code next(...)) { goto next(...); } -__code panicKernelError(struct KernelError* error, char* msg) { +__code panicKernelError(struct KernelError* err, char* msg) { extern struct cpu* cpu; extern struct { struct spinlock lock; int locking; } cons; extern int panicked; @@ -40,7 +41,7 @@ show_callstk(msg); panicked = 1; // freeze other CPU - goto infinity_loopKernelError(error_gear, error_gear->inifinity_loop); + goto infinity_loopKernelError(err, err->inifinity_loop); }
--- a/src/impl/KernelError.h Thu Feb 06 17:40:44 2020 +0900 +++ b/src/impl/KernelError.h Thu Feb 06 17:58:56 2020 +0900 @@ -1,3 +1,4 @@ -typedef struct KernelError <Type, Isa> impl Error { - __code infinity_loop(Type* error, next(...)); +typedef struct KernelError <Type, Isa> impl Err { + __code infinity_loop(Type* err, __code next(...)); + __code next(...); } KernelError;