The Pedigree Project  0.1
Classes | Public Member Functions | Private Attributes | List of all members
Translations Class Reference

#include <Translation.h>

+ Collaboration diagram for Translations:

Classes

struct  Translation
 

Public Member Functions

Translation getTranslation (size_t n)
 
size_t getNumTranslations ()
 
void addTranslation (uint32_t virt, uint32_t phys, uint32_t size, uint32_t mode)
 
uint32_t findFreePhysicalMemory (uint32_t size, uint32_t align=0x100000)
 
void removeRange (uintptr_t start, uintptr_t end)
 

Private Attributes

Translation m_pTranslations [NUM_TRANSLATIONS]
 
size_t m_nTranslations
 

Detailed Description

Representation of a translation entry as given by OpenFirmware.

Definition at line 30 of file Translation.h.

Member Function Documentation

void Translations::addTranslation ( uint32_t  virt,
uint32_t  phys,
uint32_t  size,
uint32_t  mode 
)

Adds a translation to the end of our array.

Definition at line 67 of file Translation.cc.

References panic().

Referenced by HashedPageTable::initialise(), and PPC32VirtualAddressSpace::initialise().

+ Here is the caller graph for this function:

uint32_t Translations::findFreePhysicalMemory ( uint32_t  size,
uint32_t  align = 0x100000 
)

Attempts to find a free section of physical memory.

Parameters
sizeThe size of memory to look for, in bytes.
Returns
0 on failure.
Todo:
Buggy, I think.

Definition at line 80 of file Translation.cc.

Referenced by HashedPageTable::initialise(), and PPC32VirtualAddressSpace::initialise().

+ Here is the caller graph for this function:

size_t Translations::getNumTranslations ( )

Returns the number of valid translations.

Definition at line 62 of file Translation.cc.

Referenced by HashedPageTable::initialise(), PPC32VirtualAddressSpace::initialRoster(), and PpcCommonPhysicalMemoryManager::~PpcCommonPhysicalMemoryManager().

+ Here is the caller graph for this function:

Translations::Translation Translations::getTranslation ( size_t  n)

Obtains the n'th translation.

Definition at line 57 of file Translation.cc.

Referenced by HashedPageTable::initialise(), PPC32VirtualAddressSpace::initialRoster(), and PpcCommonPhysicalMemoryManager::~PpcCommonPhysicalMemoryManager().

+ Here is the caller graph for this function:

void Translations::removeRange ( uintptr_t  start,
uintptr_t  end 
)

Removes any translations with virtual addresses in the range of start..end.

Definition at line 122 of file Translation.cc.

Member Data Documentation

size_t Translations::m_nTranslations
private

The current number of valid translations.

Definition at line 68 of file Translation.h.

Translation Translations::m_pTranslations[NUM_TRANSLATIONS]
private

The main translations array

Definition at line 65 of file Translation.h.


The documentation for this class was generated from the following files: