changeset 284:1696f9c2ad0d

call interface switchuvm
author tobaru
date Mon, 03 Feb 2020 16:53:19 +0900
parents 875ad11af596
children 4f72a447d518
files src/gearsTools/generate_stub.pl src/proc.cbc
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gearsTools/generate_stub.pl	Sun Feb 02 13:31:03 2020 +0900
+++ b/src/gearsTools/generate_stub.pl	Mon Feb 03 16:53:19 2020 +0900
@@ -3,6 +3,7 @@
 use strict;
 use Getopt::Std;
 use File::Path qw(make_path);
+use Data::Dumper;
 
 # interface.h
 # typedef struct Worker {
@@ -144,6 +145,7 @@
         }
     }
 
+    print Dumper \%var;
 }
 
 sub getCodeGear {
--- a/src/proc.cbc	Sun Feb 02 13:31:03 2020 +0900
+++ b/src/proc.cbc	Mon Feb 03 16:53:19 2020 +0900
@@ -174,6 +174,19 @@
     p->state = RUNNABLE;
 }
 
+
+void switchuvm_dummy(struct proc* proc)
+{
+    goto cbc_switchuvm_dummy(&proc->cbc_context, proc);
+}
+
+__ncode cbc_switchuvm_dummy(struct Context* cbc_context, struct proc* proc){
+
+    struct vm* vm = createvm_impl(cbc_context);
+    Gearef(cbc_context, vm)->vm = (union Data*) vm;
+    goto meta(cbc_context, vm->switchuvm);
+}
+
 // Grow current process's memory by n bytes.
 // Return 0 on success, -1 on failure.
 int growproc(int n)
@@ -194,7 +207,8 @@
     }
 
     proc->sz = sz;
-    switchuvm(proc);
+    // switchuvm(proc);
+    switchuvm_dummy(proc);
 
     return 0;
 }