Pip
Architecture-dependent parts of Pip: MAL, IAL and boot
|
#include <stdint.h>
#include "structures.h"
#include "mmu.h"
#include "string.h"
#include "debug.h"
#include "coproc.h"
#include "mal.h"
Functions | |
void | updateMMURoot (page MMURoot) |
updates the virtual address space root page More... | |
uint32_t | readIndex (uint32_t table, uint32_t index) |
Reads the index stored into table Table, at index index, using physical addresses. More... | |
void | writeIndex (uint32_t table, uint32_t index, uint32_t idx) |
Stores the given address into the given indirection table, at the given index, with physical addresses. More... | |
uint32_t | toAddr (uint32_t input) |
Dummy function to convert a given integer to an address. More... | |
void | cleanPage (uint32_t paddr) |
Cleans a given page, filling it with zeroes. More... | |
void | writePhysicalWithLotsOfFlags (uint32_t table, uint32_t index, uint32_t addr, uint32_t present, uint32_t user, uint32_t read, uint32_t write, uint32_t execute) |
Applies the given rights on the given entry. More... | |
uint32_t | dereferenceVirtual (uint32_t addr) |
void cleanPage | ( | uint32_t | paddr | ) |
Cleans a given page, filling it with zeroes.
Cleans a given page, filling it with zero.
paddr | The page's physical address |
uint32_t dereferenceVirtual | ( | uint32_t | addr | ) |
addr | The virtual address to dereference |
uint32_t readIndex | ( | uint32_t | table, |
uint32_t | index | ||
) |
Reads the index stored into table Table, at index index, using physical addresses.
FETCH index stored in indirection table, physical version.
table | The table to read from |
index | The index in the table |
uintptr_t toAddr | ( | uint32_t | input | ) |
Dummy function to convert a given integer to an address.
Converts a given uint32_t to an address (only for Haskell FFI purposes)
input | The given integer |
void updateMMURoot | ( | page | MMURoot | ) |
updates the virtual address space root page
dir | a page directory |
void writeIndex | ( | uint32_t | table, |
uint32_t | index, | ||
uint32_t | idx | ||
) |
Stores the given address into the given indirection table, at the given index, with physical addresses.
STORE an index in an indirection table, physical version.
table | The table to store into |
index | The index in the table |
addr | The index to store |
void writePhysicalWithLotsOfFlags | ( | uint32_t | table, |
uint32_t | index, | ||
uint32_t | addr, | ||
uint32_t | present, | ||
uint32_t | user, | ||
uint32_t | read, | ||
uint32_t | write, | ||
uint32_t | execute | ||
) |
Applies the given rights on the given entry.
Write a physical entry with all the possible flags we might need.
table | The indirection table in which we find the entry |
index | The index in this table, targeting the specified entry |
addr | The target address |
present | 1 if the page is mapped, 0 else |
user | 1 if the page is accessible in userland, 0 else |
read | The read right |
write | The write right |
execute | The execute right |