UbixOS  2.0
vmm.h File Reference
#include <sys/types.h>
#include <vmm/paging.h>
Include dependency graph for vmm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  freebsd6_mmap_args
 
struct  mMap
 

Macros

#define memAvail   1
 
#define memNotavail   2
 
#define STACK_ADDR   0xBFFFFFFF
 
#define VMM_KERN_CODE_END   0x007FEFFF
 
#define VMM_KERN_CODE_START   0x00000000
 
#define VMM_KERN_END   0xFDFFFFFF
 
#define VMM_KERN_STACK_END   0xFFFFFFFF
 
#define VMM_KERN_STACK_START   0xFE000000
 
#define VMM_KERN_START   0xC0800000
 
#define VMM_MMAP_ADDR_PMODE   VMM_KERN_START /* (PD_BASE_ADDR + PAGE_SIZE) */
 
#define VMM_MMAP_ADDR_RMODE   0x101000
 
#define VMM_PAGE_DIR   0xC0400000
 
#define VMM_PAGE_DIRS   0xC0000000
 
#define VMM_USER_END   0xBFFFFFFF
 
#define VMM_USER_LDT   0x007FF000
 
#define VMM_USER_START   0x00800000
 
#define vmmID   -3
 

Enumerations

enum  unmapFlags_t { VMM_FREE = 0, VMM_KEEP = 1 }
 

Functions

int adjustCowCounter (uint32_t baseAddr, int adjustment)
 
int countMemory ()
 
int freePage (uint32_t pageAddr)
 
int vmm_allocPageTable (uint32_t, pidType)
 
uint32_t vmm_findFreePage (pidType pid)
 
void vmm_freeProcessPages (pidType pid)
 
int vmm_init ()
 
int vmm_memMapInit ()
 
void vmm_unmapPage (uint32_t, unmapFlags_t)
 
void vmm_unmapPages (void *, uint32_t, unmapFlags_t)
 

Variables

int numPages
 
struct spinLock pdSpinLock
 
mMapvmmMemoryMap
 

Macro Definition Documentation

◆ memAvail

#define memAvail   1

Definition at line 41 of file vmm.h.

◆ memNotavail

#define memNotavail   2

Definition at line 42 of file vmm.h.

◆ STACK_ADDR

#define STACK_ADDR   0xBFFFFFFF

Definition at line 39 of file vmm.h.

◆ VMM_KERN_CODE_END

#define VMM_KERN_CODE_END   0x007FEFFF

Definition at line 54 of file vmm.h.

◆ VMM_KERN_CODE_START

#define VMM_KERN_CODE_START   0x00000000

Definition at line 53 of file vmm.h.

◆ VMM_KERN_END

#define VMM_KERN_END   0xFDFFFFFF

Definition at line 65 of file vmm.h.

◆ VMM_KERN_STACK_END

#define VMM_KERN_STACK_END   0xFFFFFFFF

Definition at line 68 of file vmm.h.

◆ VMM_KERN_STACK_START

#define VMM_KERN_STACK_START   0xFE000000

Definition at line 67 of file vmm.h.

◆ VMM_KERN_START

#define VMM_KERN_START   0xC0800000

Definition at line 64 of file vmm.h.

◆ VMM_MMAP_ADDR_PMODE

#define VMM_MMAP_ADDR_PMODE   VMM_KERN_START /* (PD_BASE_ADDR + PAGE_SIZE) */

Definition at line 50 of file vmm.h.

◆ VMM_MMAP_ADDR_RMODE

#define VMM_MMAP_ADDR_RMODE   0x101000

Definition at line 51 of file vmm.h.

◆ VMM_PAGE_DIR

#define VMM_PAGE_DIR   0xC0400000

Definition at line 62 of file vmm.h.

◆ VMM_PAGE_DIRS

#define VMM_PAGE_DIRS   0xC0000000

Definition at line 61 of file vmm.h.

◆ VMM_USER_END

#define VMM_USER_END   0xBFFFFFFF

Definition at line 59 of file vmm.h.

◆ VMM_USER_LDT

#define VMM_USER_LDT   0x007FF000

Definition at line 56 of file vmm.h.

◆ VMM_USER_START

#define VMM_USER_START   0x00800000

Definition at line 58 of file vmm.h.

◆ vmmID

#define vmmID   -3

Definition at line 43 of file vmm.h.

Enumeration Type Documentation

◆ unmapFlags_t

Enumerator
VMM_FREE 
VMM_KEEP 

Definition at line 110 of file vmm.h.

Function Documentation

◆ adjustCowCounter()

int adjustCowCounter ( uint32_t  baseAddr,
int  adjustment 
)

Referenced by vmm_createVirtualSpace().

◆ countMemory()

int countMemory ( )

Definition at line 109 of file vmm_memory.c.

References inportByte(), and outportByte().

Referenced by vmm_memMapInit().

Here is the call graph for this function:

◆ freePage()

int freePage ( uint32_t  pageAddr)

Definition at line 262 of file vmm_memory.c.

References assert, spinLock(), and vmmMemoryMap.

Referenced by vmm_unmapPage().

Here is the call graph for this function:

◆ vmm_allocPageTable()

int vmm_allocPageTable ( uint32_t  ,
pidType   
)

Definition at line 7 of file vmm_allocpagetable.c.

References bzero, KERNEL_PAGE_DEFAULT, kpanic(), PAGE_DEFAULT, PAGE_PRESENT, PAGE_SIZE, PD_BASE_ADDR, PD_ENTRIES, PD_INDEX, PT_BASE_ADDR, vmm_findFreePage(), VMM_USER_END, and VMM_USER_START.

Referenced by vmm_getFreeKernelPage().

Here is the call graph for this function:

◆ vmm_findFreePage()

uint32_t vmm_findFreePage ( pidType  pid)

Definition at line 221 of file vmm_memory.c.

References kpanic(), spinLock(), and sysID.

Referenced by elf_load_file(), execFile(), freebsd6_mmap(), kmod_load(), ldEnable(), sys_mmap(), sysExec(), vmm_allocPageTable(), vmm_getFreeKernelPage(), and vmm_pagingInit().

Here is the call graph for this function:

◆ vmm_freeProcessPages()

void vmm_freeProcessPages ( pidType  pid)

Definition at line 342 of file vmm_memory.c.

References PD_BASE_ADDR, and spinLock().

Referenced by systemTask().

Here is the call graph for this function:

◆ vmm_init()

int vmm_init ( )

Function: int vmm_init()

Description: Initializes the vmm subsystem

Notes:

Definition at line 43 of file vmm_init.c.

References K_PANIC, vmm_memMapInit(), and vmm_pagingInit().

Here is the call graph for this function:

◆ vmm_memMapInit()

int vmm_memMapInit ( )

Definition at line 57 of file vmm_memory.c.

References countMemory(), mMap::cowCounter, memNotavail, numPages, PAGE_SIZE, mMap::pageAddr, mMap::pid, mMap::status, VMM_MMAP_ADDR_RMODE, vmmID, and vmmMemoryMap.

Referenced by vmm_init().

Here is the call graph for this function:

◆ vmm_unmapPage()

void vmm_unmapPage ( uint32_t  ,
unmapFlags_t   
)

Definition at line 47 of file unmappage.c.

References freePage(), PAGE_PRESENT, PD_BASE_ADDR, and PT_BASE_ADDR.

Referenced by sys_mmap(), and vmm_createVirtualSpace().

Here is the call graph for this function:

◆ vmm_unmapPages()

void vmm_unmapPages ( void *  ,
uint32_t  ,
unmapFlags_t   
)

Definition at line 99 of file unmappage.c.

References PT_BASE_ADDR.

Referenced by sdeThread().

Variable Documentation

◆ numPages

int numPages

Definition at line 45 of file vmm_memory.c.

Referenced by vmm_memMapInit(), and vmm_pagingInit().

◆ pdSpinLock

struct spinLock pdSpinLock

Definition at line 33 of file vmm_init.c.

Referenced by vmm_getFreeKernelPage().

◆ vmmMemoryMap

mMap* vmmMemoryMap

Definition at line 47 of file vmm_memory.c.

Referenced by freePage(), vmm_memMapInit(), and vmm_pagingInit().