|
Defines |
| #define | PROCPDEPTR(pr, pi) |
| #define | NOPDE (-1) |
| #define | PDEMASK(n) (1L << (n)) |
| #define | WANT_FREEPDES (sizeof(dirtypde)*8-5) |
| #define | HASPT(procptr) ((procptr)->p_seg.p_cr3 != 0) |
| #define | TYPEDIRECT 0 |
| #define | TYPEPROCMAP 1 |
| #define | TYPEPHYS 2 |
| #define | CREATEPDE(PROC, PTR, LINADDR, REMAIN, BYTES, PDE, TYPE) |
| #define | DONEPDE(PDE) |
| #define | WIPEPDE(PDE) |
| #define | FLAG(v) do { if(e & (v)) { strcat(str, #v " "); e &= ~v; } } while(0) |
| #define | NOPT(p) (!(p) || !HASPT(p)) |
Functions |
| FORWARD | _PROTOTYPE (u32_t phys_get32,(phys_bytes v)) |
| FORWARD | _PROTOTYPE (void vm_enable_paging,(void)) |
| PUBLIC void | vm_init (struct proc *newptproc) |
| PRIVATE int | lin_lin_copy (struct proc *srcproc, vir_bytes srclinaddr, struct proc *dstproc, vir_bytes dstlinaddr, vir_bytes bytes) |
| PRIVATE u32_t | phys_get32 (phys_bytes addr) |
| PRIVATE void | set_cr3 () |
| PUBLIC void | vm_set_cr3 (struct proc *newptproc) |
| PRIVATE char * | cr0_str (u32_t e) |
| PRIVATE char * | cr4_str (u32_t e) |
| PRIVATE void | vm_enable_paging (void) |
| PUBLIC vir_bytes | alloc_remote_segment (u32_t *selector, segframe_t *segments, int index, phys_bytes phys, vir_bytes size, int priv) |
| PUBLIC phys_bytes | umap_remote (struct proc *rp, int seg, vir_bytes vir_addr, vir_bytes bytes) |
| PUBLIC phys_bytes | umap_local (struct proc *rp, int seg, vir_bytes vir_addr, vir_bytes bytes) |
| PUBLIC phys_bytes | umap_virtual (struct proc *rp, int seg, vir_bytes vir_addr, vir_bytes bytes) |
| PUBLIC int | vm_lookup (struct proc *proc, vir_bytes virtual, vir_bytes *physical, u32_t *ptent) |
| PUBLIC int | vm_contiguous (struct proc *targetproc, u32_t vir_buf, size_t bytes) |
| PRIVATE int | vm_suspend (struct proc *caller, struct proc *target, vir_bytes linaddr, vir_bytes len, int wrflag, int type) |
| int | delivermsg (struct proc *rp) |
| PRIVATE char * | flagstr (u32_t e, int dir) |
| PRIVATE void | vm_pt_print (u32_t *pagetable, u32_t v) |
| PRIVATE void | vm_print (u32_t *root) |
| u32_t | read_cr3 (void) |
| int | vm_phys_memset (phys_bytes ph, u8_t c, phys_bytes bytes) |
| PUBLIC int | virtual_copy_f (struct vir_addr *src_addr, struct vir_addr *dst_addr, vir_bytes bytes, int vmcheck) |
| PUBLIC int | data_copy (endpoint_t from_proc, vir_bytes from_addr, endpoint_t to_proc, vir_bytes to_addr, size_t bytes) |
| PUBLIC int | data_copy_vmcheck (endpoint_t from_proc, vir_bytes from_addr, endpoint_t to_proc, vir_bytes to_addr, size_t bytes) |
| PUBLIC int | arch_pre_exec (struct proc *pr, u32_t ip, u32_t sp) |
| PUBLIC int | arch_umap (struct proc *pr, vir_bytes offset, vir_bytes count, int seg, phys_bytes *addr) |
| void | i386_freepde (int pde) |
| PUBLIC | arch_phys_map (int index, phys_bytes *addr, phys_bytes *len, int *flags) |
| PUBLIC int | arch_phys_map_reply (int index, vir_bytes addr) |
| PUBLIC int | arch_enable_paging (void) |
Variables |
| PRIVATE int | psok = 0 |
| PUBLIC u8_t * | vm_pagedirs = NULL |
| PUBLIC u32_t | dirtypde |
| PRIVATE int | nfreepdes = 0 |
| PRIVATE int | freepdes [WANT_FREEPDES] |
| PRIVATE int | inusepde = NOPDE |
| PRIVATE u32_t | vm_cr3 |
| u32_t | thecr3 |