Mercurial > hg > Members > menikon > CbC_xv6
changeset 303:17ccc6e21e35
update_vm_impl_contracto
author | anatofuz |
---|---|
date | Wed, 05 Feb 2020 13:14:33 +0900 |
parents | 06665ec9e2a0 |
children | 9fa2e66bc9ed |
files | src/impl/vm_impl.cbc |
diffstat | 1 files changed, 71 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/src/impl/vm_impl.cbc Wed Feb 05 13:01:09 2020 +0900 +++ b/src/impl/vm_impl.cbc Wed Feb 05 13:14:33 2020 +0900 @@ -3,16 +3,31 @@ // ---- // typedef struct vm_impl<Impl, Isa> impl vm{ -// union Data* vm_impl; -// uint i; -// pte_t* pte; -// uint sz; -// -// __code loaduvm_ptesize_check(Type* vm_impl, __code next(...)); -// __code loaduvm_loop(Type* vm_impl, uint i, pte_t* pte, uint sz, __code next(...)); -// __code next(...); -// -// +// __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 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_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, ...)); +// __code copyuvm_check_nullvm_impl(Type* vm_impl, pde_t* pgdir, uint sz, __code next(int ret, ...)); +// __code copyuvm_loopvm_impl(Type* vm_impl, pde_t* pgdir, uint sz, pde_t* d, pte_t* pte, uint pa, uint i, uint ap, char* mem, __code next(int ret, ...)); +// __code copyuvm_loop_check_walkpgdir(Type* vm_impl, pde_t* pgdir, uint sz, pde_t* d, pte_t* pte, uint pa, uint i, uint ap, char* mem, __code next(int ret, ...)); +// __code copyuvm_loop_check_pte(Type* vm_impl, pde_t* pgdir, uint sz, pde_t* d, pte_t* pte, uint pa, uint i, uint ap, char* mem, __code next(int ret, ...)); +// __code copyuvm_loop_check_mem(Type* vm_impl, pde_t* pgdir, uint sz, pde_t* d, pte_t* pte, uint pa, uint i, uint ap, char* mem, __code next(int ret, ...)); +// __code copyuvm_loop_check_mappages(Type* vm_impl, pde_t* pgdir, uint sz, pde_t* d, pte_t* pte, uint pa, uint i, uint ap, char* mem, __code next(int ret, ...)); +// __code copyuvm_loop_bad(Type* vm_impl, pde_t* d, __code next(int ret, ...)); +// __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, ...)); // } vm_impl; // ---- @@ -21,21 +36,55 @@ struct vm_impl* vm_impl = new vm_impl(); vm->vm = (union Data*)vm_impl; vm_impl->vm_impl = NULL; - vm_impl->i = 0; - vm_impl->pte = NULL; + vm_impl->ret = 0; + vm_impl->pgdir = NULL; + vm_impl->va = 0; + vm_impl->pp = NULL; + vm_impl->len = 0; + vm_impl->va0 = 0; + vm_impl->pa0 = NULL; + vm_impl->n = 0; + vm_impl->buf = NULL; + vm_impl->uva = NULL; + vm_impl->vm = NULL; + vm_impl->p = NULL; + vm_impl->init = NULL; vm_impl->sz = 0; - vm_impl->loaduvm_ptesize_check = C_loaduvm_ptesize_checkvm_impl; - vm_impl->loaduvm_loop = C_loaduvm_loopvm_impl; - vm_impl->allocuvm_check_newsz = C_allocuvm_check_newszvm_impl; - vm_impl->allocuvm_loop = C_allocuvm_loopvm_impl; - vm_impl->copyuvm_check_null = C_copyuvm_check_nullvm_impl; - vm_impl->copyuvm_loop = C_copyuvm_loopvm_impl; + vm_impl->oldsz = 0; + vm_impl->newsz = 0; + vm_impl->mem = NULL; + vm_impl->a = 0; + vm_impl->d = NULL; + vm_impl->pte = NULL; + vm_impl->pa = 0; + vm_impl->i = 0; + vm_impl->ap = 0; + vm_impl->phy_low = 0; + vm_impl->phy_hi = 0; + vm_impl->kpt_alloc_check_impl = C_kpt_alloc_check_impl; + vm_impl->loaduvm_ptesize_checkvm_impl = C_loaduvm_ptesize_checkvm_impl; + vm_impl->loaduvm_check_PTE_SZ = C_loaduvm_check_PTE_SZ; + vm_impl->copyout_loop_check_n = C_copyout_loop_check_n; + vm_impl->clearpteu_check_ptevm_impl = C_clearpteu_check_ptevm_impl; vm_impl->uva2ka_check_pe_types = C_uva2ka_check_pe_types; - vm_impl->paging_intvm_impl = C_paging_intvmvm_impl; 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->void_ret = C_vm_void_ret; + vm_impl->loaduvm_loopvm_impl = C_loaduvm_loopvm_impl; + vm_impl->loaduvm_check_pgdir = C_loaduvm_check_pgdir; + vm_impl->loaduvm_exit = C_loaduvm_exit; + vm_impl->allocuvm_check_newszvm_impl = C_allocuvm_check_newszvm_impl; + vm_impl->allocuvm_loopvm_impl = C_allocuvm_loopvm_impl; + vm_impl->copyuvm_check_nullvm_impl = C_copyuvm_check_nullvm_impl; + vm_impl->copyuvm_loopvm_impl = C_copyuvm_loopvm_impl; + vm_impl->copyuvm_loop_check_walkpgdir = C_copyuvm_loop_check_walkpgdir; + vm_impl->copyuvm_loop_check_pte = C_copyuvm_loop_check_pte; + vm_impl->copyuvm_loop_check_mem = C_copyuvm_loop_check_mem; + vm_impl->copyuvm_loop_check_mappages = C_copyuvm_loop_check_mappages; + vm_impl->copyuvm_loop_bad = C_copyuvm_loop_bad; + vm_impl->uva2ka_check_pte_ap = C_uva2ka_check_pte_ap; + vm_impl->paging_intvmvm_impl = C_paging_intvmvm_impl; + vm_impl->copyout_loop_check_pa0 = C_copyout_loop_check_pa0; vm->init_vmm = C_init_vmmvm_impl; vm->kpt_freerange = C_kpt_freerangevm_impl; vm->kpt_alloc = C_kpt_allocvm_impl; @@ -48,9 +97,11 @@ vm->uva2ka = C_uva2kavm_impl; vm->copyout = C_copyoutvm_impl; vm->paging_int = C_paging_intvm_impl; + vm->void_ret = C_vm_void_ret; return vm; } + extern struct { struct spinlock lock; struct run *freelist;