annotate src/impl/vm_impl.cbc @ 200:1301727600cc

success build
author anatofuz
date Wed, 22 Jan 2020 21:56:18 +0900
parents 429f0c3cc097
children 9fb193a2c352
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
197
tobaru
parents: 195
diff changeset
1 #include "../../context.h"
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
2 #interface "vm.h"
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
3
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
4 // ----
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
5 // typedef struct vm_impl<Impl, Isa> impl vm{
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
6 // uint i;
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
7 // pte_t *pte;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
8 // unsigned int sz;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
9 //
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
10 // __code loaduvm_ptesize_check(Type* vm_impl, __code next(...));
1301727600cc success build
anatofuz
parents: 197
diff changeset
11 // __code loaduvm_loop(Type* vm_impl, uint i, pte_t *pte, unsigned int sz, __code next(...));
1301727600cc success build
anatofuz
parents: 197
diff changeset
12 // __code next(...);
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
13 //
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
14 //
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
15 // } vm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
16 // ----
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
17
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
18 vm* createvm_impl(struct Context* cbc_context) {
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
19 struct vm* vm = new vm();
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
20 struct vm_impl* vm_impl = new vm_impl();
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
21 vm->vm = (union Data*)vm_impl;
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
22 vm_impl->i = 0;
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
23 vm_impl->sz = 0;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
24 vm->init_vmm = C_init_vmmvm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
25 vm->kpt_freerange = C_kpt_freerangevm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
26 vm->kpt_alloc = C_kpt_allocvm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
27 vm->switchuvm = C_switchuvmvm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
28 vm->init_inituvm = C_init_inituvmvm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
29 vm->loaduvm = C_loaduvmvm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
30 vm->allocuvm = C_allocuvmvm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
31 vm->clearpteu = C_clearpteuvm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
32 vm->copyuvm = C_copyuvmvm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
33 vm->uva2ka = C_uva2kavm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
34 vm->copyout = C_copyoutvm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
35 vm->pagind_int = C_pagind_intvm_impl;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
36 return vm;
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
37 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
38
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
39
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
40
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
41 __code init_vmmvm_impl(struct vm_impl* vm, __code next(...)) {
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
42
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
43 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
44 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
45
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
46 __code kpt_freerangevm_impl(struct vm_impl* vm, uint low, uint hi, __code next(...)) {
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
47
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
48 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
49 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
50
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
51 __code kpt_allocvm_impl(struct vm_impl* vm ,__code next(...)) {
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
52
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
53 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
54 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
55
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
56 typedef struct proc proc;
1301727600cc success build
anatofuz
parents: 197
diff changeset
57 __code switchuvmvm_impl(struct vm_impl* vm ,struct proc* p, __code next(...)) { //:skip
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
58
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
59 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
60 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
61
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
62 __code init_inituvmvm_impl(struct vm_impl* vm, pde_t* pgdir, char* init, uint sz, __code next(...)) { //:skip
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
63
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
64 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
65 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
66
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
67 __code loaduvmvm_impl(struct vm_impl* vm,pde_t* pgdir, char* addr, struct inode* ip, uint offset, uint sz, __code next(...)) {
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
68
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
69 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
70 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
71
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
72 __code allocuvmvm_impl(struct vm_impl* vm, pde_t* pgdir, uint oldsz, uint newsz, __code next(...)) {
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
73
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
74 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
75 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
76
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
77 __code clearpteuvm_impl(struct vm_impl* vm, pde_t* pgdir, char* uva, __code next(...)) {
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
78
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
79 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
80 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
81
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
82 __code copyuvmvm_impl(struct vm_impl* vm, pde_t* pgdir, uint sz, __code next(...)) {
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
83
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
84 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
85 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
86
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
87 __code uva2kavm_impl(struct vm_impl* vm, pde_t* pgdir, char* uva, __code next(...)) {
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
88
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
89 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
90 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
91
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
92 __code copyoutvm_impl(struct vm_impl* vm, pde_t* pgdir, uint va, void* pp, uint len, __code next(...)) {
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
93
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
94 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
95 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
96
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
97 __code pagind_intvm_impl(struct vm_impl* vm, uint phy_low, uint phy_hi, __code next(...)) {
195
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
98
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
99 goto next(...);
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
100 }
14aa35b56347 add page table interface
tobaru
parents:
diff changeset
101
200
1301727600cc success build
anatofuz
parents: 197
diff changeset
102