Pip
Architecture-dependent parts of Pip: MAL, IAL and boot
Functions
armv7/MAL/boot_requirements.c File Reference
#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)
 

Function Documentation

◆ cleanPage()

void cleanPage ( uint32_t  paddr)

Cleans a given page, filling it with zeroes.

Cleans a given page, filling it with zero.

Parameters
paddrThe page's physical address

◆ dereferenceVirtual()

uint32_t dereferenceVirtual ( uint32_t  addr)
Parameters
addrThe virtual address to dereference
Returns
The contents of the pointer
Warning
I don't think this is still used. Anyway, it should never be. Never. Removing this soon.

◆ readIndex()

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.

Parameters
tableThe table to read from
indexThe index in the table
Returns
The index stored in the given slot

◆ toAddr()

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)

Parameters
inputThe given integer
Returns
The same integer as an address
Note
This is only for Haskell. C doesn't need this!

◆ updateMMURoot()

void updateMMURoot ( page  MMURoot)

updates the virtual address space root page

Parameters
dira page directory
Postcondition
dir is the current virtual space

◆ writeIndex()

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.

Parameters
tableThe table to store into
indexThe index in the table
addrThe index to store

◆ writePhysicalWithLotsOfFlags()

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.

Parameters
tableThe indirection table in which we find the entry
indexThe index in this table, targeting the specified entry
addrThe target address
present1 if the page is mapped, 0 else
user1 if the page is accessible in userland, 0 else
readThe read right
writeThe write right
executeThe execute right