Mercurial > hg > Members > menikon > CbC_xv6
changeset 304:9fa2e66bc9ed
comment at vm_impl private field
author | anatofuz |
---|---|
date | Wed, 05 Feb 2020 14:11:58 +0900 |
parents | 17ccc6e21e35 |
children | 00ae47e57834 97c6157bac16 |
files | src/gearsTools/update_implheader.pl src/impl/vm_impl.h src/impl/vm_impl_private.cbc |
diffstat | 3 files changed, 17 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gearsTools/update_implheader.pl Wed Feb 05 13:14:33 2020 +0900 +++ b/src/gearsTools/update_implheader.pl Wed Feb 05 14:11:58 2020 +0900 @@ -96,6 +96,7 @@ } map { print $fh " $_\n"} @$write_codes; + print $fh " __code next(...);\n"; print $fh "} $impl;\n"; close $fh; }
--- a/src/impl/vm_impl.h Wed Feb 05 13:14:33 2020 +0900 +++ b/src/impl/vm_impl.h Wed Feb 05 14:11:58 2020 +0900 @@ -1,16 +1,15 @@ typedef struct vm_impl<Impl, Isa> impl vm{ __code kpt_alloc_check_impl(Type* vm_impl, __code next(...)); - __code loaduvm_ptesize_checkvm_impl(Type* vm_impl, __code next(int ret, ...)); - __code loaduvm_check_PTE_SZ(Type* vm_impl, __code next(int ret, ...)); + __code loaduvm_ptesize_checkvm_impl(Type* vm_impl,char* addr, __code next(int ret, ...)); + __code loaduvm_check_PTE_SZ(Type* vm_impl, uint sz, uint i, uint n, struct inode* ip, uint pa, uint offset, __code next(int ret, ...)); __code copyout_loop_check_n(Type* vm_impl, pde_t* pgdir, uint va, void* pp, uint len, uint va0, char* pa0, uint n, char* buf, __code next(...)); __code clearpteu_check_ptevm_impl(Type* vm_impl, pde_t* pgdir, char* uva, __code next(int ret, ...)); __code uva2ka_check_pe_types(Type* vm, pde_t* pgdir, char* uva, __code next(int ret, ...)); __code copyout_loopvm_impl(Type* vm_impl, pde_t* pgdir, uint va, void* pp, uint len, uint va0, char* pa0, __code next(int ret, ...)); __code switchuvm_check_pgdirvm_impl(Type* vm_impl, proc_struct* p, __code next(...)); __code init_inituvm_check_sz(Type* vm_impl, pde_t* pgdir, char* init, uint sz, __code next(...)); - - __code loaduvm_loopvm_impl(Type* vm_impl, __code next(int ret, ...)); - __code loaduvm_check_pgdir(Type* vm_impl, __code next(int ret, ...)); + __code loaduvm_loopvm_impl(Type* vm_impl, uint i, uint sz,__code next(int ret, ...)); + __code loaduvm_check_pgdir(Type* vm_impl, pte_t* pte, pde_t* pgdir, uint i, char* addr, uint pa, __code next(int ret, ...)); __code loaduvm_exit(Type* vm_impl, __code next(int ret, ...)); __code allocuvm_check_newszvm_impl(Type* vm_impl, pde_t* pgdir, uint oldsz, uint newsz, __code next(int ret, ...)); __code allocuvm_loopvm_impl(Type* vm_impl, pde_t* pgdir, uint oldsz, uint newsz, char* mem, uint a, __code next(int ret, ...)); @@ -24,4 +23,5 @@ __code uva2ka_check_pte_ap(Type* vm, pde_t* pgdir, char* uva, pte_t* pte, __code next(int ret, ...)); __code paging_intvmvm_impl(Type* vm_impl, uint phy_low, uint phy_hi, __code next(...)); __code copyout_loop_check_pa0(Type* vm_impl, pde_t* pgdir, uint va, void* pp, uint len, uint va0, char* pa0, uint n, __code next(int ret, ...)); + __code next(...); } vm_impl;
--- a/src/impl/vm_impl_private.cbc Wed Feb 05 13:14:33 2020 +0900 +++ b/src/impl/vm_impl_private.cbc Wed Feb 05 14:11:58 2020 +0900 @@ -9,8 +9,8 @@ vm_impl* createvm_impl2(); //:skip */ -__code loaduvm_ptesize_checkvm_impl(struct vm_impl* vm_impl, __code next(int ret, ...)) { - char* addr = vm_impl->addr; +__code loaduvm_ptesize_checkvm_impl(struct vm_impl* vm_impl,char* addr, __code next(int ret, ...)) { + //char* addr = vm_impl->addr; if ((uint) addr %PTE_SZ != 0) { // goto panic @@ -19,9 +19,11 @@ goto loaduvm_loopvm_impl(vm_impl, next(ret, ...)); } -__code loaduvm_loopvm_impl(struct vm_impl* vm_impl, __code next(int ret, ...)) { +__code loaduvm_loopvm_impl(struct vm_impl* vm_impl, uint i, uint sz,__code next(int ret, ...)) { +/* uint i = vm_impl->i; uint sz = vm_impl->sz; +*/ if (i < sz) { goto loaduvm_check_pgdir(vm_impl, next(ret, ...)); @@ -60,12 +62,14 @@ } -__code loaduvm_check_pgdir(struct vm_impl* vm_impl, __code next(int ret, ...)) { +__code loaduvm_check_pgdir(struct vm_impl* vm_impl, pte_t* pte, pde_t* pgdir, uint i, char* addr, uint pa, __code next(int ret, ...)) { +/* pte_t* pte = vm_impl->pte; pde_t* pgdir = vm_impl->pgdir; uint i = vm_impl->i; char* addr = vm_impl->addr; uint pa = vm_impl->pa; +*/ if ((pte = walkpgdir(pgdir, addr + i, 0)) == 0) { // goto panic @@ -80,13 +84,15 @@ goto loaduvm_check_PTE_SZ(vm_impl, next(ret, ...)); } -__code loaduvm_check_PTE_SZ(struct vm_impl* vm_impl, __code next(int ret, ...)) { +__code loaduvm_check_PTE_SZ(struct vm_impl* vm_impl, uint sz, uint i, uint n, struct inode* ip, uint pa, uint offset, __code next(int ret, ...)) { +/* uint sz = vm_impl->sz; uint i = vm_impl->i; uint n = vm_impl->n; struct inode* ip = vm_impl->ip; uint pa = vm_impl->pa; uint offset = vm_impl->offset; +*/ if (sz - i < PTE_SZ) { n = sz - i;