# vmm.h File Reference

`#include <vmm/paging.h>`
`#include <ubixos/types.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 | mMap

## Defines

#define | memAvail 1
#define | memNotavail 2
#define | vmmID -3
#define | vmmMemoryMapAddr 0xE6667000

## Functions

int | adjustCowCounter (uInt32 baseAddr, int adjustment)
int | countMemory ()
int | freePage (uInt32 pageAddr)
int | vmm_init ()
u_int32_t | vmmFindFreePage (pidType pid)
void | vmmFreeProcessPages (pidType pid)
int | vmmMemMapInit ()

## Variables

int | numPages
mMap * | vmmMemoryMap

## Define Documentation

#define memAvail 1

Definition at line 36 of file vmm.h.

Referenced by adjustCowCounter(), freePage(), vmmFindFreePage(), vmmFreeProcessPages(), and vmmMemMapInit().

#define memNotavail 2

Definition at line 37 of file vmm.h.

Referenced by vmmFindFreePage(), and vmmMemMapInit().

#define vmmID -3

Definition at line 38 of file vmm.h.

Referenced by adjustCowCounter(), vmmFreeProcessPages(), and vmmMemMapInit().

#define vmmMemoryMapAddr 0xE6667000

Definition at line 39 of file vmm.h.

Referenced by vmm_pagingInit().

## Function Documentation

int adjustCowCounter | ( | uInt32 | baseAddr,
|  | int | adjustment |
| ) |  |  |

Definition at line 266 of file vmm_memory.c.

References assert, mMap::cowCounter, freePages, vitalsStruct::freePages, memAvail, mMap::pid, spinLock(), spinUnlock(), mMap::status, systemVitals, vmmCowSpinLock, vmmID, and vmmMemoryMap.

Referenced by freePage(), vmm_pageFault(), vmmCopyVirtualSpace(), and vmmFreeProcessPages().

Here is the call graph for this function:

int countMemory | ( |  | ) |

Definition at line 104 of file vmm_memory.c.

References cr0, inportByte(), and outportByte().

Referenced by vmmMemMapInit().

Here is the call graph for this function:

int freePage | ( | uInt32 | pageAddr | ) |

Definition at line 228 of file vmm_memory.c.

References adjustCowCounter(), assert, mMap::cowCounter, freePages, vitalsStruct::freePages, memAvail, mMap::pid, spinLock(), spinUnlock(), mMap::status, systemVitals, vmmMemoryMap, and vmmSpinLock.

Referenced by vmm_remapPage().

Here is the call graph for this function:

int vmm_init | ( |  | ) |

Function: int vmm_init()

Description: Initializes the vmm subsystem

Notes:

Definition at line 41 of file vmm_init.c.

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

Here is the call graph for this function:

u_int32_t vmmFindFreePage | ( | pidType | pid | ) |

Definition at line 186 of file vmm_memory.c.

References freePages, vitalsStruct::freePages, kpanic(), memAvail, memNotavail, numPages, mMap::pid, spinLock(), spinUnlock(), status, sysID, systemVitals, vmmMemoryMap, and vmmSpinLock.

Referenced by elf_loadfile(), execFile(), kmod_load(), ldEnable(), obreak(), sys_exec(), sysExec(), vmm_getFreeMallocPage(), vmm_pageFault(), vmm_pagingInit(), vmm_remapPage(), vmmGetFreeKernelPage(), vmmGetFreePage(), and vmmGetFreeVirtualPage().

Here is the call graph for this function:

void vmmFreeProcessPages | ( | pidType | pid | ) |

Definition at line 296 of file vmm_memory.c.

References adjustCowCounter(), mMap::cowCounter, freePages, vitalsStruct::freePages, memAvail, numPages, PAGE_COW, pageEntries, parentPageDirAddr, mMap::pid, spinLock(), spinUnlock(), status, systemVitals, tablesBaseAddress, vmmID, vmmMemoryMap, vmmSpinLock, and x1000.

Referenced by systemTask().

Here is the call graph for this function:

int vmmMemMapInit | ( |  | ) |

Definition at line 57 of file vmm_memory.c.

References countMemory(), freePages, kprintf(), memAvail, memNotavail, numPages, mMap::pageAddr, mMap::pid, mMap::status, status, vmmID, vmmMemoryMap, and x1000.

Referenced by vmm_init().

Here is the call graph for this function:

## Variable Documentation

int numPages

Definition at line 44 of file vmm_memory.c.

Referenced by vmm_pagingInit(), vmmFindFreePage(), vmmFreeProcessPages(), and vmmMemMapInit().

mMap* vmmMemoryMap

Definition at line 45 of file vmm_memory.c.

Referenced by adjustCowCounter(), freePage(), kmain(), vmm_pagingInit(), vmmFindFreePage(), vmmFreeProcessPages(), and vmmMemMapInit().