Modules | |
| Toy Segment Manager | |
| Toy Memory Swap Manager | |
Functions | |
| int | TMM_PagingEnabled (ToyMM *tmm) |
| Checks if paging is enabled. Returns 0 on yes, -1 on no. | |
| int | TMM_GetRealAddress (ToyMM *tmm, int process, int vaddr) |
| Turns a virtual address into a real address. | |
| int | TMM_GetNumPages (ToyMM *tmm) |
| Returns the number of pages in paging mode, or -1 in legacy mode. | |
| int | TMM_GetFramedSize (ToyMM *tmm, int size) |
| Pads a segment size to the size of the minimum # of frames. | |
| int | TMM_VirtualToReal (ToyMM *tmm, Process *proc, int vaddr) |
| Converts a virtual address to a real address. | |
| int | TMM_GetNumFrames (ToyMM *tmm, int length) |
| Counts the minimum # of frames needed for a size of mem. | |
| void | TMM_AssignFrame (ToyMM *tmm, int process, int frame, int page) |
| Assigns passed frame to passed page in passsed process. | |
| void | TMM_EmptyFrame (ToyMM *tmm, int frame) |
| Marks every memory element in a frame as empty. | |
| void | TMM_FreeFrame (ToyMM *tmm, int process, int page) |
| Removes passed frame from passed process, marking it as free. | |
| int | TMM_FindFreeFrame (ToyMM *tmm) |
| Finds the first available frame, if any. | |
| int | TMM_FrameFree (ToyMM *tmm, int frame) |
| Returns 0 if the frame is unused, -1 otherwise. | |
| InvPageTable * | TMM_GetFrame (ToyMM *tmm, int frame) |
| Returns specified element of frame table, or NULL if nonexistent. | |
| PageTable * | TMM_GetPage (ToyMM *tmm, int process, int page) |
| Returns specified element of page table, or NULL if nonexistent. | |
| int | TMM_PageFree (ToyMM *tmm, int process, int page) |
| Returns 0 if specified page of process is unused, -1 otherwise. | |
| int | TMM_CountFreePages (ToyMM *tmm, int process) |
| Returns the # of free pages in specified process. | |
| void | TMM_IncrementLinearScan (ToyMM *tmm) |
| Increments the linear scanning pointer. | |
| int | TMM_PageSwappedOut (ToyMM *tmm, int process, int page) |
| Returns 0 if page is swapped out, -1 if not. | |
| int | TMM_PageSwappedIn (ToyMM *tmm, int process, int page) |
| Returns 0 if page is swapped in, -1 if not. | |
| void | TMM_MarkPageSwappedOut (ToyMM *tmm, int process, int page) |
| Marks a page as swapped out. | |
| void | TMM_ClearFrameStatus (ToyMM *tmm, int frame) |
| Marks a frame as not recently used. | |
| void | TMM_SetFrameStatus (ToyMM *tmm, int frame) |
| Marks a frame as recently used. | |
|
||||||||||||||||||||
|
Assigns passed frame to passed page in passsed process.
Definition at line 275 of file ToyVirtualMem.c. References PageTable::frame, InvPageTable::ID, ToyMM::invPageTable, InvPageTable::page, PageTable::paged, Process::pagetable, InvPageTable::status, and TMM_EmptyFrame(). Referenced by TMM_SwapIn(). |
|
||||||||||||
|
Marks a frame as not recently used.
Definition at line 34 of file ToyVirtualMem.c. References InvPageTable::status, and TMM_GetFrame(). Referenced by TMM_FindFreeFrame(). |
|
||||||||||||
|
Returns the # of free pages in specified process.
Definition at line 90 of file ToyVirtualMem.c. References TMM_GetNumPages(), TMM_PageFree(), and TMM_PagingEnabled(). |
|
||||||||||||
|
Marks every memory element in a frame as empty.
Definition at line 262 of file ToyVirtualMem.c. References ToyMM::mem, ToyMM::pageSize, and ToyMem::type. Referenced by TMM_AssignFrame(), and TMM_FreeFrame(). |
|
|
Finds the first available frame, if any.
Definition at line 159 of file ToyVirtualMem.c. References ToyMM::invPageTable, ToyMM::page, TMM_ClearFrameStatus(), TMM_FrameFree(), TMM_GetNumPages(), TMM_IncrementLinearScan(), and TMM_SwapOut(). Referenced by TMM_GetRealAddress(). |
|
||||||||||||
|
Returns 0 if the frame is unused, -1 otherwise.
Definition at line 115 of file ToyVirtualMem.c. References InvPageTable::ID, ToyMM::invPageTable, TMM_GetNumPages(), and TMM_PagingEnabled(). Referenced by TMM_FindFreeFrame(), and TMM_SwapIn(). |
|
||||||||||||||||
|
Removes passed frame from passed process, marking it as free.
Definition at line 293 of file ToyVirtualMem.c. References PageTable::frame, ToyMM::invPageTable, PageTable::paged, Process::pagetable, and TMM_EmptyFrame(). Referenced by TMM_PagedTerminateProcess(), TMM_SwapIn(), and TMM_SwapOut(). |
|
||||||||||||
|
Returns specified element of frame table, or NULL if nonexistent.
Definition at line 106 of file ToyVirtualMem.c. References ToyMM::invPageTable, TMM_GetNumPages(), and TMM_PagingEnabled(). Referenced by TMM_ClearFrameStatus(), and TMM_SetFrameStatus(). |
|
||||||||||||
|
Pads a segment size to the size of the minimum # of frames.
Definition at line 213 of file ToyVirtualMem.c. References ToyMM::pageSize, and TMM_GetNumFrames(). |
|
||||||||||||
|
Counts the minimum # of frames needed for a size of mem.
Definition at line 202 of file ToyVirtualMem.c. References ToyMM::pageSize, and TMM_PagingEnabled(). Referenced by TMM_GetFramedSize(). |
|
|
Returns the number of pages in paging mode, or -1 in legacy mode.
Definition at line 145 of file ToyVirtualMem.c. References ToyMM::memSize, ToyMM::pageSize, and TMM_PagingEnabled(). Referenced by TMM_CountFreePages(), TMM_EnablePaging(), TMM_FindFreeFrame(), TMM_FrameFree(), TMM_GetFrame(), TMM_GetPage(), TMM_IncrementLinearScan(), TMM_PagedAllocateProcess(), TMM_PagedTerminateProcess(), TMM_PrintFrames(), TMM_PrintInvertedPageTable(), TMM_PrintPages(), and TMM_PrintPageTable(). |
|
||||||||||||||||
|
Returns specified element of page table, or NULL if nonexistent.
Definition at line 125 of file ToyVirtualMem.c. References Process::pagetable, TMM_GetNumPages(), and TMM_PagingEnabled(). Referenced by TMM_PageFree(), TMM_PageSwappedIn(), and TMM_PageSwappedOut(). |
|
||||||||||||||||
|
Turns a virtual address into a real address.
Definition at line 232 of file ToyVirtualMem.c. References ToyMM::pageSize, TMM_FindFreeFrame(), TMM_PageSwappedOut(), TMM_PagingEnabled(), TMM_SetFrameStatus(), and TMM_SwapIn(). Referenced by TMM_AllocateHeap(), TMM_StoreHeapInteger(), TMM_StoreHeapString(), TMM_StoreInteger(), and TMM_StoreString(). |
|
|
Increments the linear scanning pointer.
Definition at line 51 of file ToyVirtualMem.c. References ToyMM::page, TMM_GetNumPages(), and TMM_PagingEnabled(). Referenced by TMM_FindFreeFrame(). |
|
||||||||||||||||
|
Marks a page as swapped out.
Definition at line 66 of file ToyVirtualMem.c. References PageTable::frame, PageTable::paged, Process::pagetable, and ToyMM::processList. Referenced by TMM_SwapOut(). |
|
||||||||||||||||
|
Returns 0 if specified page of process is unused, -1 otherwise.
Definition at line 136 of file ToyVirtualMem.c. References PageTable::frame, PageTable::paged, and TMM_GetPage(). Referenced by TMM_CountFreePages(), TMM_PrintPages(), and TMM_SwapOut(). |
|
||||||||||||||||
|
Returns 0 if page is swapped in, -1 if not.
Definition at line 72 of file ToyVirtualMem.c. References PageTable::frame, PageTable::paged, and TMM_GetPage(). Referenced by TMM_SwapIn(). |
|
||||||||||||||||
|
Returns 0 if page is swapped out, -1 if not.
Definition at line 81 of file ToyVirtualMem.c. References PageTable::frame, PageTable::paged, and TMM_GetPage(). Referenced by TMM_GetRealAddress(), TMM_PrintPages(), TMM_SwapIn(), and TMM_SwapOut(). |
|
|
Checks if paging is enabled. Returns 0 on yes, -1 on no.
Definition at line 22 of file ToyVirtualMem.c. References ToyMM::invPageTable, and ToyMM::pageSize. Referenced by TMM_CountFreePages(), TMM_FrameFree(), TMM_Free(), TMM_GetFrame(), TMM_GetNumFrames(), TMM_GetNumPages(), TMM_GetPage(), TMM_GetRealAddress(), TMM_IncrementLinearScan(), TMM_PrintFrames(), TMM_PrintPages(), TMM_SwapCreate(), and TMM_TerminateProcess(). |
|
||||||||||||
|
Marks a frame as recently used.
Definition at line 42 of file ToyVirtualMem.c. References InvPageTable::status, and TMM_GetFrame(). Referenced by TMM_GetRealAddress(). |
|
||||||||||||||||
|
Converts a virtual address to a real address.
|
1.3-rc3