changeset 270:052669f2ef74

mv vm_void_ret to interface
author anatofuz
date Mon, 27 Jan 2020 14:50:26 +0900
parents bd948528b2d6
children d1c7018537c0
files src/impl/vm_impl.cbc src/impl/vm_impl_private.cbc src/interface/vm.h src/proc.cbc
diffstat 4 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/impl/vm_impl.cbc	Mon Jan 27 14:13:05 2020 +0900
+++ b/src/impl/vm_impl.cbc	Mon Jan 27 14:50:26 2020 +0900
@@ -35,7 +35,7 @@
     vm_impl->copyout_loopvm_impl = C_copyout_loopvm_impl;
     vm_impl->switchuvm_check_pgdirvm_impl = C_switchuvm_check_pgdirvm_impl;
     vm_impl->init_inituvm_check_sz = C_init_inituvm_check_sz;
-    vm_impl->void_ret  = C_vm_void_ret;
+    vm->void_ret  = C_vm_void_ret;
     vm->init_vmm = C_init_vmmvm_impl;
     vm->kpt_freerange = C_kpt_freerangevm_impl;
     vm->kpt_alloc = C_kpt_allocvm_impl;
@@ -56,11 +56,11 @@
     struct run *freelist;
 } kpt_mem;
 
-__code init_vmmvm_impl(struct vm_impl* vm) {
+__code init_vmmvm_impl(struct vm_impl* vm,__code next(...)) {
     initlock(&kpt_mem.lock, "vm");
     kpt_mem.freelist = NULL;
     
-    goto vm->void_ret();
+    goto next(...);
 }
 
 extern struct run {
@@ -144,3 +144,6 @@
     goto paging_intvmvm_impl(vm, phy_low, phy_hi, next(...));
 }
 
+__code vm_void_ret(struct vm_impl* vm) {
+    return;
+}
--- a/src/impl/vm_impl_private.cbc	Mon Jan 27 14:13:05 2020 +0900
+++ b/src/impl/vm_impl_private.cbc	Mon Jan 27 14:50:26 2020 +0900
@@ -398,6 +398,3 @@
     goto next(...);
 }
 
-__code vm_void_ret(struct vm_impl* vm_impl) {
-    return;
-}
--- a/src/interface/vm.h	Mon Jan 27 14:13:05 2020 +0900
+++ b/src/interface/vm.h	Mon Jan 27 14:50:26 2020 +0900
@@ -29,5 +29,6 @@
     __code uva2ka(Impl* vm, pde_t* pgdir, char* uva, __code next(...));
     __code copyout(Impl* vm, pde_t* pgdir, uint va, void* pp, uint len, __code next(...));
     __code paging_int(Impl* vm, uint phy_low, uint phy_hi, __code next(...));
+    __code void_ret(Impl* vm);
     __code next(...);
 } vm;
--- a/src/proc.cbc	Mon Jan 27 14:13:05 2020 +0900
+++ b/src/proc.cbc	Mon Jan 27 14:50:26 2020 +0900
@@ -129,11 +129,12 @@
 __ncode cbc_init_vmm_dummy(struct Context* cbc_context, struct proc* p, pde_t* pgdir, char* init, uint sz){//:skip
 
     struct vm* vm = createvm_impl(cbc_context);
-    // goto vm->init_vmm(vm, pgdir, init, sz , next(...));
+    // 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_vmm);
 }