Mercurial > hg > CbC > CbC_xv6
diff src/impl/vm_impl.cbc @ 190:14aa35b56347
add page table interface
author | tobaru |
---|---|
date | Wed, 22 Jan 2020 18:40:15 +0900 |
parents | |
children | 429f0c3cc097 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/impl/vm_impl.cbc Wed Jan 22 18:40:15 2020 +0900 @@ -0,0 +1,127 @@ +#include "../context.h" +#interface "vm.h" + +// ---- +// typedef struct vm_impl<Impl, Isa> impl vm{ +// unsigned int i; +// pte_t *pte; +// unsigned int sz; +// +// __code loaduvm_ptesize_check(Impl* vm_impl, __code next(...)); +// __code loaduvm_loop(Impl* vm_impl, unsigned int i, pte_t *pte, unsigned int sz, __code next(...)); +// +// +// } vm_impl; +// ---- + +vm* createvm_impl(struct Context* cbc_context) { + struct vm* vm = new vm(); + struct vm_impl* vm_impl = new vm_impl(); + vm->vm = (union Data*)vm_impl; + vm_impl->i = 0; + vm_impl->int = 0; + vm_impl->sz = 0; + vm_impl->int = 0; + vm->low = 0; + vm->hi = 0; + vm->p = NULL; + vm->pgdir = NULL; + vm->init = NULL; + vm->sz = 0; + vm->addr = NULL; + vm->ip = NULL; + vm->offset = 0; + vm->oldsz = 0; + vm->newsz = 0; + vm->uva = NULL; + vm->va = 0; + vm->p = NULL; + vm->len = 0; + vm->phy_low = 0; + vm->phy_hi = 0; + vm_impl->loaduvm_ptesize_check = C_loaduvm_ptesize_checkvm_impl; + vm_impl->loaduvm_loop = C_loaduvm_loopvm_impl; + vm->init_vmm = C_init_vmmvm_impl; + vm->kpt_freerange = C_kpt_freerangevm_impl; + vm->kpt_alloc = C_kpt_allocvm_impl; + vm->switchuvm = C_switchuvmvm_impl; + vm->init_inituvm = C_init_inituvmvm_impl; + vm->loaduvm = C_loaduvmvm_impl; + vm->allocuvm = C_allocuvmvm_impl; + vm->clearpteu = C_clearpteuvm_impl; + vm->copyuvm = C_copyuvmvm_impl; + vm->uva2ka = C_uva2kavm_impl; + vm->copyout = C_copyoutvm_impl; + vm->pagind_int = C_pagind_intvm_impl; + return vm; +} +__code loaduvm_ptesize_checkvm_impl(Impl* vm_impl, __code next(...)) { + + goto next(...); +} + +__code loaduvm_loopvm_impl(Impl* vm_impl, unsigned int i, pte_t *pte, unsigned int sz, __code next(...)) { + + goto next(...); +} + +__code init_vmmvm_impl(struct vm_impl* vm, __code next(...)) { + + goto next(...); +} + +__code kpt_freerangevm_impl(struct vm_impl* vm, unsigned int low, unsigned int hi, __code next(...)) { + + goto next(...); +} + +__code kpt_allocvm_impl(struct vm_impl* vm ,__code next(...)) { + + goto next(...); +} + +__code switchuvmvm_impl(struct vm_impl* vm ,struct proc* p, __code next(...)) { + + goto next(...); +} + +__code init_inituvmvm_impl(struct vm_impl* vm, pde_t* pgdir, char* init, unsigned int sz, __code next(...)) { + + goto next(...); +} + +__code loaduvmvm_impl(struct vm_impl* vm,pde_t* pgdir, char* addr, struct inode* ip, unsigned int offset, unsigned int sz, __code next(...)) { + + goto next(...); +} + +__code allocuvmvm_impl(struct vm_impl* vm, pde_t* pgdir, unsigned int oldsz, unsigned int newsz, __code next(...)) { + + goto next(...); +} + +__code clearpteuvm_impl(struct vm_impl* vm, pde_t* pgdir, char* uva, __code next(...)) { + + goto next(...); +} + +__code copyuvmvm_impl(struct vm_impl* vm, pde_t* pgdir, unsigned int sz, __code next(...)) { + + goto next(...); +} + +__code uva2kavm_impl(struct vm_impl* vm, pde_t* pgdir, char* uva, __code next(...)) { + + goto next(...); +} + +__code copyoutvm_impl(struct vm_impl* vm, pde_t* pgdir, unsigned int va, void* p, unsigned int len, __code next(...)) { + + goto next(...); +} + +__code pagind_intvm_impl(struct vm_impl* vm, unsigned int phy_low, unsigned int phy_hi, __code next(...)) { + + goto next(...); +} +