Mercurial > hg > Members > menikon > CbC_xv6
changeset 209:02bb0f8be908
rewrite init_vmm by cbc
author | tobaru |
---|---|
date | Thu, 23 Jan 2020 18:08:22 +0900 |
parents | a0620ca23f19 |
children | ab5a80021afe 66db83ec1ec2 |
files | src/impl/vm_impl.cbc src/impl/vm_impl.h |
diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/impl/vm_impl.cbc Thu Jan 23 17:52:35 2020 +0900 +++ b/src/impl/vm_impl.cbc Thu Jan 23 18:08:22 2020 +0900 @@ -41,9 +41,15 @@ return vm; } +extern struct { + struct spinlock lock; + struct run *freelist; +} kpt_mem; __code init_vmmvm_impl(struct vm_impl* vm, __code next(...)) { - + initlock(&kpt_mem.lock, "vm"); + kpt_mem.freelist = NULL; + goto next(...); }
--- a/src/impl/vm_impl.h Thu Jan 23 17:52:35 2020 +0900 +++ b/src/impl/vm_impl.h Thu Jan 23 18:08:22 2020 +0900 @@ -10,6 +10,7 @@ uint pa; uint n; + __code init_vmm(Type* vm_impl, __code next(...)); __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(...);