#include <minix/callnr.h>#include <minix/com.h>#include <minix/config.h>#include <minix/const.h>#include <minix/ds.h>#include <minix/endpoint.h>#include <minix/keymap.h>#include <minix/minlib.h>#include <minix/type.h>#include <minix/ipc.h>#include <minix/sysutil.h>#include <minix/syslib.h>#include <minix/safecopies.h>#include <minix/cpufeature.h>#include <minix/bitmap.h>#include <errno.h>#include <stdlib.h>#include <assert.h>#include <string.h>#include <env.h>#include <stdio.h>#include <fcntl.h>#include "../proto.h"#include "../glo.h"#include "../util.h"#include "../vm.h"#include "../sanitycheck.h"#include "memory.h"Go to the source code of this file.
Defines | |
| #define | _SYSTEM 1 |
| #define | _POSIX_SOURCE 1 |
| #define | SPAREPAGES 25 |
| #define | MAX_KERNMAPPINGS 10 |
| #define | BYTESPERPDE (I386_VM_PT_ENTRIES * I386_PAGE_SIZE) |
| #define | CLICK2PAGE(c) ((c) / CLICKSPERPAGE) |
Functions | |
| PRIVATE void * | aalloc (size_t bytes) |
| PRIVATE u32_t | findhole (pt_t *pt, u32_t vmin, u32_t vmax) |
| PRIVATE void | vm_freepages (vir_bytes vir, vir_bytes phys, int pages, int reason) |
| PRIVATE void * | vm_getsparepage (u32_t *phys) |
| PRIVATE void * | vm_checkspares (void) |
| PUBLIC void * | vm_allocpage (phys_bytes *phys, int reason) |
| PUBLIC void | vm_pagelock (void *vir, int lockflag) |
| PRIVATE int | pt_ptalloc (pt_t *pt, int pde, u32_t flags) |
| PUBLIC int | pt_writemap (pt_t *pt, vir_bytes v, phys_bytes physaddr, size_t bytes, u32_t flags, u32_t writemapflags) |
| PUBLIC int | pt_checkrange (pt_t *pt, vir_bytes v, size_t bytes, int write) |
| PUBLIC int | pt_new (pt_t *pt) |
| PUBLIC int | pt_identity (pt_t *pt) |
| PUBLIC void | pt_init (phys_bytes usedlimit) |
| PUBLIC int | pt_bind (pt_t *pt, struct vmproc *who) |
| PUBLIC void | pt_free (pt_t *pt) |
| PUBLIC int | pt_mapkernel (pt_t *pt) |
| PUBLIC void | pt_cycle (void) |
Variables | |
| PRIVATE int | id_map_high_pde = -1 |
| PRIVATE int | pagedir_pde = -1 |
| PRIVATE u32_t | global_bit = 0 |
| PRIVATE u32_t | pagedir_pde_val |
| PRIVATE int | proc_pde = 0 |
| PRIVATE int | bigpage_ok = 0 |
| struct vmproc * | vmp = &vmproc[VM_PROC_NR] |
| int | missing_spares = SPAREPAGES |
| struct { | |
| void * page | |
| u32_t phys | |
| } | sparepages [SPAREPAGES] |
| struct { | |
| phys_bytes phys_addr | |
| phys_bytes len | |
| vir_bytes lin_addr | |
| int flags | |
| } | kern_mappings [MAX_KERNMAPPINGS] |
| int | kernmappings = 0 |
| u32_t | page_directories_phys |
| u32_t * | page_directories = NULL |
| #define _POSIX_SOURCE 1 |
Definition at line 3 of file pagetable.c.
| #define _SYSTEM 1 |
Definition at line 2 of file pagetable.c.
| #define BYTESPERPDE (I386_VM_PT_ENTRIES * I386_PAGE_SIZE) |
Definition at line 82 of file pagetable.c.
Definition at line 85 of file pagetable.c.
| #define MAX_KERNMAPPINGS 10 |
Definition at line 61 of file pagetable.c.
| #define SPAREPAGES 25 |
Definition at line 54 of file pagetable.c.
| PRIVATE void* aalloc | ( | size_t | bytes | ) |
Definition at line 134 of file pagetable.c.
Definition at line 149 of file pagetable.c.
Definition at line 871 of file pagetable.c.
Definition at line 544 of file pagetable.c.
| PUBLIC void pt_cycle | ( | void | ) |
Definition at line 961 of file pagetable.c.
| PUBLIC void pt_free | ( | pt_t * | pt | ) |
Definition at line 903 of file pagetable.c.
| PUBLIC int pt_identity | ( | pt_t * | pt | ) |
Definition at line 626 of file pagetable.c.
| PUBLIC void pt_init | ( | phys_bytes | usedlimit | ) |
Definition at line 656 of file pagetable.c.
| PUBLIC int pt_mapkernel | ( | pt_t * | pt | ) |
Definition at line 919 of file pagetable.c.
| PUBLIC int pt_new | ( | pt_t * | pt | ) |
Definition at line 588 of file pagetable.c.
Definition at line 383 of file pagetable.c.
| PUBLIC int pt_writemap | ( | pt_t * | pt, | |
| vir_bytes | v, | |||
| phys_bytes | physaddr, | |||
| size_t | bytes, | |||
| u32_t | flags, | |||
| u32_t | writemapflags | |||
| ) |
Definition at line 419 of file pagetable.c.
| PUBLIC void* vm_allocpage | ( | phys_bytes * | phys, | |
| int | reason | |||
| ) |
Definition at line 275 of file pagetable.c.
| PRIVATE void* vm_checkspares | ( | void | ) |
Definition at line 249 of file pagetable.c.
Definition at line 208 of file pagetable.c.
| PRIVATE void* vm_getsparepage | ( | u32_t * | phys | ) |
Definition at line 228 of file pagetable.c.
| PUBLIC void vm_pagelock | ( | void * | vir, | |
| int | lockflag | |||
| ) |
Definition at line 351 of file pagetable.c.
| PRIVATE int bigpage_ok = 0 |
Definition at line 45 of file pagetable.c.
| int flags |
Definition at line 66 of file pagetable.c.
| PRIVATE u32_t global_bit = 0 |
Definition at line 40 of file pagetable.c.
| PRIVATE int id_map_high_pde = -1 |
Definition at line 39 of file pagetable.c.
| PRIVATE { ... } kern_mappings[MAX_KERNMAPPINGS] |
| int kernmappings = 0 |
Definition at line 68 of file pagetable.c.
Definition at line 64 of file pagetable.c.
Definition at line 65 of file pagetable.c.
| int missing_spares = SPAREPAGES |
Definition at line 55 of file pagetable.c.
| void* page |
Definition at line 57 of file pagetable.c.
| u32_t * page_directories = NULL |
Definition at line 88 of file pagetable.c.
Definition at line 88 of file pagetable.c.
| PRIVATE int pagedir_pde = -1 |
Definition at line 39 of file pagetable.c.
| PRIVATE u32_t pagedir_pde_val |
Definition at line 40 of file pagetable.c.
Definition at line 58 of file pagetable.c.
Definition at line 63 of file pagetable.c.
| PRIVATE int proc_pde = 0 |
Definition at line 42 of file pagetable.c.
| PRIVATE { ... } sparepages[SPAREPAGES] |
Definition at line 48 of file pagetable.c.
1.5.8