# HG changeset patch # User anatofuz # Date 1595915705 -32400 # Node ID 174e02ed350910439ba3ca2496afe4c48ce3bd05 # Parent bfcfba3860c3fc7913bb591741a9cf68254e022b remove vm_impl.cbc diff -r bfcfba3860c3 -r 174e02ed3509 src/CMakeLists.txt --- a/src/CMakeLists.txt Mon Jul 27 19:32:09 2020 +0900 +++ b/src/CMakeLists.txt Tue Jul 28 14:55:05 2020 +0900 @@ -128,8 +128,8 @@ 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.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 init_kernel_context.cbc impl/ReadSyscallImpl.cbc impl/ReadSyscallEntry.cbc + SingleLinkedStack.cbc entry.S + impl/KernelRetImpl.cbc impl/KernelError.cbc impl/SyscallDispatchImpl.cbc impl/CbCProcImpl.cbc init_kernel_context.cbc impl/ReadSyscallImpl.cbc impl/ReadSyscallEntry.cbc ) # sys_read_impl.cbc diff -r bfcfba3860c3 -r 174e02ed3509 src/proc.cbc --- a/src/proc.cbc Mon Jul 27 19:32:09 2020 +0900 +++ b/src/proc.cbc Tue Jul 28 14:55:05 2020 +0900 @@ -6,7 +6,6 @@ #include "arm.h" #include "proc.h" #include "spinlock.h" -#interface "vm.h" #include "kernel.h" @@ -122,21 +121,6 @@ //PAGEBREAK: 32 // hand-craft the first user process. We link initcode.S into the kernel // as a binary, the linker will generate __binary_initcode_start/_size -void cbc_init_vmm_dummy(struct Context* cbc_context, struct proc* p, pde_t* pgdir, char* init, uint sz) -{ - // inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); - - struct vm* vm = createvm_impl(cbc_context); - // goto vm->init_vmm(vm, pgdir, init, sz , vm->void_ret); - Gearef(cbc_context, vm)->vm = (union Data*) vm; - Gearef(cbc_context, vm)->pgdir = pgdir; - Gearef(cbc_context, vm)->init = init; - Gearef(cbc_context, vm)->sz = sz ; - Gearef(cbc_context, vm)->next = C_vm_void_ret ; - goto meta(cbc_context, vm->init_inituvm); -} - - void userinit(void) @@ -154,7 +138,7 @@ panic("userinit: out of memory?"); } - cbc_init_vmm_dummy(&p->cbc_context, p, p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); + inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); p->sz = PTE_SZ; @@ -177,15 +161,6 @@ } -void switchuvm_dummy(struct Context* cbc_context, struct proc* proc) -{ - struct vm* vm = createvm_impl(cbc_context); - Gearef(cbc_context, vm)->vm = (union Data*) vm; - Gearef(cbc_context, vm)->p = proc; - Gearef(cbc_context, vm)->next = C_vm_void_ret ; - goto meta(cbc_context, vm->switchuvm); -} - // Grow current process's memory by n bytes. // Return 0 on success, -1 on failure. @@ -207,8 +182,8 @@ } proc->sz = sz; - //switchuvm(proc); - switchuvm_dummy(&proc->cbc_context, proc); + switchuvm(proc); + //switchuvm_dummy(&proc->cbc_context, proc); return 0; }