UbixOS
2.0
|
Go to the source code of this file.
Macros | |
#define | btoc(x) (((vm_offset_t)(x)+PAGE_MASK)>>PAGE_SHIFT) |
#define | ctob(x) ((x)<<PAGE_SHIFT) |
#define | KERNEL_PAGE_DEFAULT (PAGE_PRESENT|PAGE_WRITE) |
#define | PAGE_ 0x00000100 |
#define | PAGE_ACCESSED 0x00000020 |
#define | PAGE_CACHE_DISABLED 0x00000010 |
#define | PAGE_COW 0x00000200 |
#define | PAGE_DEFAULT (PAGE_PRESENT|PAGE_WRITE|PAGE_USER) |
#define | PAGE_DIRTY 0x00000040 |
#define | PAGE_GLOBAL 0x00000080 |
#define | PAGE_MASK (PAGE_SIZE-1) |
#define | PAGE_PRESENT 0x00000001 |
#define | PAGE_SHIFT 12 |
#define | PAGE_SIZE 0x1000 |
#define | PAGE_STACK 0x00000400 |
#define | PAGE_USER 0x00000004 |
#define | PAGE_WIRED 0x00000800 |
#define | PAGE_WRITE 0x00000002 |
#define | PAGE_WRITE_THROUGH 0x00000008 |
#define | PD_BASE_ADDR 0xC0400000 |
#define | PD_BASE_ADDR2 ((PAGE_SIZE << 0xA) + VMM_KERN_START) |
#define | PD_ENTRIES (PAGE_SIZE/4) |
#define | PD_INDEX(v_addr) (v_addr >> 22) |
#define | PD_OFFSET(v_addr) (v_addr >> 0xA) |
#define | PT_BASE_ADDR 0xC0000000 |
#define | PT_ENTRIES (PAGE_SIZE/4) |
#define | PT_INDEX(v_addr) ((v_addr >> 12) & 0x03FF) |
#define | round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK) |
#define | trunc_page(x) ((x) & ~PAGE_MASK) |
#define | VM_TASK 1 |
#define | VM_THRD 0 |
Functions | |
void | _vmm_pageFault () |
int | mmap (struct thread *, struct sys_mmap_args *) |
int | munmap (struct thread *, struct sys_munmap_args *) |
int | obreak (struct thread *, struct obreak_args *) |
int | vmm_cleanVirtualSpace (uint32_t) |
void * | vmm_copyVirtualSpace (pidType) |
void * | vmm_createVirtualSpace (pidType) |
void * | vmm_getFreeKernelPage (pidType pid, uint16_t count) |
void * | vmm_getFreeMallocPage (uint16_t count) |
void * | vmm_getFreePage (pidType) |
void * | vmm_getFreeVirtualPage (pidType, int, int) |
uint32_t | vmm_getPhysicalAddr (uint32_t) |
uint32_t | vmm_getRealAddr (uint32_t) |
void * | vmm_mapFromTask (pidType, void *, uint32_t) |
void | vmm_pageFault (struct trapframe *, uint32_t) |
int | vmm_pagingInit () |
int | vmm_remapPage (uint32_t, uint32_t, uint16_t, pidType, int haveLock) |
int | vmm_setPageAttributes (uint32_t, uint16_t) |
int | vmmClearVirtualPage (uint32_t pageAddr) |
Variables | |
uint32_t * | kernelPageDirectory |
#define btoc | ( | x | ) | (((vm_offset_t)(x)+PAGE_MASK)>>PAGE_SHIFT) |
#define ctob | ( | x | ) | ((x)<<PAGE_SHIFT) |
#define KERNEL_PAGE_DEFAULT (PAGE_PRESENT|PAGE_WRITE) |
#define PAGE_DEFAULT (PAGE_PRESENT|PAGE_WRITE|PAGE_USER) |
#define PD_BASE_ADDR2 ((PAGE_SIZE << 0xA) + VMM_KERN_START) |
void _vmm_pageFault | ( | ) |
Referenced by vmm_pagingInit().
int mmap | ( | struct thread * | , |
struct sys_mmap_args * | |||
) |
int munmap | ( | struct thread * | , |
struct sys_munmap_args * | |||
) |
int obreak | ( | struct thread * | , |
struct obreak_args * | |||
) |
int vmm_cleanVirtualSpace | ( | uint32_t | ) |
void* vmm_copyVirtualSpace | ( | pidType | ) |
Definition at line 51 of file copyvirtualspace.c.
References spinLock().
Referenced by fork_copyProcess(), and sys_fork().
void* vmm_createVirtualSpace | ( | pidType | ) |
Definition at line 53 of file createvirtualspace.c.
References adjustCowCounter(), bzero, KERNEL_PAGE_DEFAULT, PAGE_COW, PAGE_PRESENT, PAGE_SIZE, PD_BASE_ADDR, PD_ENTRIES, PD_INDEX, PT_BASE_ADDR, PT_ENTRIES, vmm_getFreePage(), vmm_getPhysicalAddr(), VMM_KERN_START, and vmm_unmapPage().
Definition at line 291 of file paging.c.
References K_PANIC, KERNEL_PAGE_DEFAULT, kpanic(), PAGE_PRESENT, PAGE_SIZE, PD_BASE_ADDR, PD_ENTRIES, PD_INDEX, pdSpinLock, PT_BASE_ADDR, PT_ENTRIES, spinLock(), spinUnlock(), vmm_allocPageTable(), vmm_clearVirtualPage(), vmm_findFreePage(), VMM_KERN_END, VMM_KERN_START, and vmm_remapPage().
Referenced by biosCall(), and execThread().
void* vmm_getFreeMallocPage | ( | uint16_t | count | ) |
void* vmm_getFreePage | ( | pidType | ) |
Definition at line 45 of file getfreepage.c.
References spinLock().
Referenced by vmm_createVirtualSpace().
void * vmm_getFreeVirtualPage | ( | pidType | , |
int | , | ||
int | |||
) |
Definition at line 47 of file getfreevirtualpage.c.
References spinLock().
Referenced by sys_mmap(), and sysGetFreePage().
Function: void *vmm_getPhysicalAddr(); Description: Returns The Physical Address Of The Virtual Page Notes:
Definition at line 38 of file getphysicaladdr.c.
References PT_BASE_ADDR.
Referenced by vmm_createVirtualSpace().
Definition at line 56 of file getphysicaladdr.c.
References PT_BASE_ADDR.
Referenced by initLNC(), and lncAttach().
Definition at line 372 of file paging.c.
Referenced by sdeThread().
Definition at line 53 of file pagefault.c.
References _current, taskStruct::id, kprintf(), spinLock(), trapframe::tf_eip, trapframe::tf_err, and trapframe::tf_esp.
int vmm_pagingInit | ( | ) |
Definition at line 58 of file paging.c.
References _vmm_pageFault(), bzero, K_PANIC, KERNEL_PAGE_DEFAULT, kernelPageDirectory, kprintf(), numPages, PAGE_DEFAULT, PAGE_GLOBAL, PAGE_SIZE, PAGE_STACK, PD_BASE_ADDR, PD_ENTRIES, PD_INDEX, PT_BASE_ADDR, sysID, vmm_findFreePage(), VMM_KERN_END, VMM_KERN_START, VMM_MMAP_ADDR_PMODE, VMM_MMAP_ADDR_RMODE, vmm_remapPage(), and vmmMemoryMap.
Referenced by vmm_init().
Definition at line 199 of file paging.c.
References K_PANIC, kpanic(), spinLock(), sysID, VMM_USER_END, and VMM_USER_START.
Referenced by elf_load_file(), execFile(), freebsd6_mmap(), kmod_load(), ldEnable(), ogDisplay_UbixOS::SetMode(), sys_mmap(), sysExec(), vmm_getFreeKernelPage(), and vmm_pagingInit().
Definition at line 39 of file setpageattributes.c.
References kpanic(), and PT_BASE_ADDR.
Referenced by elf_load_file(), execFile(), and sysExec().
int vmmClearVirtualPage | ( | uint32_t | pageAddr | ) |
uint32_t* kernelPageDirectory |
Definition at line 41 of file paging.c.
Referenced by biosCall(), execFile(), execThread(), and vmm_pagingInit().