changeset 292:42a37a8a02c9

impl described_data_gear mode
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 04 Feb 2020 12:30:09 +0900
parents 96fd8e1db32f
children 9e8441699711
files src/gearsTools/generate_stub.pl src/impl/vm_impl.h src/interface/vm.h
diffstat 3 files changed, 50 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gearsTools/generate_stub.pl	Tue Feb 04 12:08:33 2020 +0900
+++ b/src/gearsTools/generate_stub.pl	Tue Feb 04 12:30:09 2020 +0900
@@ -75,7 +75,7 @@
 
 sub getDataGear {
     my ($filename) = @_;
-    my ($codeGearName, $name, $inTypedef);
+    my ($codeGearName, $name, $inTypedef,$described_data_gear);
     open my $fd,"<",$filename or die("can't open $filename $!");
     while (<$fd>) {
         if (! $inTypedef) {
@@ -137,9 +137,11 @@
             if ($ttype =~ /^(union|struct)?\s*(\w+)/) {
                 $ttype = $2;
             }
+            $described_data_gear = 1;
             $var{$name}->{$tname} = $ttype;
         }
         if (/__code (\w+)/) {
+            next if $described_data_gear;
             my $args = $';
             while ($args =~ /\s*(struct|union|const)?\s*([\w\[\]_]+)\*?\s*(\w+),?/g) {
               #$args eq  (Impl* vm, pde_t* pgdir, char* init, uint sz, __code next(...));
--- a/src/impl/vm_impl.h	Tue Feb 04 12:08:33 2020 +0900
+++ b/src/impl/vm_impl.h	Tue Feb 04 12:30:09 2020 +0900
@@ -1,4 +1,33 @@
 typedef struct vm_impl<Impl, Isa> impl vm{
+    union Data* vm_impl;
+    uint i;
+    pte_t* pte;
+    uint sz;
+    pde_t* pgdir;
+    char* addr;
+    struct inode* ip;
+    uint offset;
+    uint pa;
+    uint n;
+    uint oldsz;
+    uint newsz;
+    uint a;
+    int ret;
+    char* mem;
+    char* uva;
+    pde_t* d;
+    uint ap;
+    uint phy_low;
+    uint phy_hi;
+    uint va;
+    void* pp;
+    uint len;
+    char* buf;
+    char* pa0;
+    uint va0;
+    proc_struct* p;
+    char* init;
+
     __code kpt_alloc_check_impl(Type* vm_impl, __code next(...));
     __code loaduvm_ptesize_check(Type* vm_impl, __code next(int ret, ...));
     __code loaduvm_loop(Type* vm_impl, uint i, pte_t* pte, uint sz, __code next(int ret, ...));
--- a/src/interface/vm.h	Tue Feb 04 12:08:33 2020 +0900
+++ b/src/interface/vm.h	Tue Feb 04 12:30:09 2020 +0900
@@ -1,4 +1,22 @@
 typedef struct vm<Type,Impl> {
+    union Data* vm;
+    uint low;
+    uint hi;
+    struct proc* p;
+    pde_t* pgdir;
+    char* init;
+    uint sz;
+    char* addr;
+    struct inode* ip;
+    uint offset;
+    uint oldsz;
+    uint newsz;
+    char* uva;
+    uint va;
+    void* pp;
+    uint len;
+    uint phy_low;
+    uint phy_hi;
     __code init_vmm(Impl* vm, __code next(...));
     __code kpt_freerange(Impl* vm, uint low, uint hi, __code next(...));
     __code kpt_alloc(Impl* vm ,__code next(...));