|
The Pedigree Project 0.1
|
#include <RangeList.h>
Inheritance diagram for RangeList< T, Reversed >:
Collaboration diagram for RangeList< T, Reversed >:Classes | |
| struct | Range |
Public Member Functions | |
| RangeList () | |
| RangeList (bool preferUsed) | |
| RangeList (T Address, T Length, bool XXX, bool preferUsed=false) | |
| ~RangeList () | |
| RangeList (const RangeList &) | |
| RangeList & | operator= (const RangeList &l) |
| void | free (T address, T length, bool merge=true) |
| bool | tryFree (T address, T length, bool merge=true) |
| bool | freeWithoutAllocation (T address, T length) |
| bool | allocateWithoutAllocation (T length, T &address) |
| bool | allocateSpecificWithoutAllocation (T address, T length) |
| bool | allocate (T length, T &address) |
| bool | allocateSpecific (T address, T length) |
| void | clear () |
| void | swap (RangeList &other) noexcept |
| size_t | size () const |
| bool | getRange (size_t index, Range &range) const |
| void | sweep () |
| void | dump (void(*emit_line)(const char *s)) const |
Private Types | |
| typedef decltype(m_List) ::Iterator | Iterator |
| typedef decltype(m_List) ::ConstIterator | ConstIterator |
| typedef decltype(m_List) ::ReverseIterator | ReverseIterator |
| typedef decltype(m_List) ::ConstReverseIterator | ConstReverseIterator |
Private Attributes | |
| Vector< Range > | m_List |
| bool | m_bPreferUsed |
This class manages a List of ranges. It automatically merges adjacent entries in the list.
| [in] | T | the integer type the range address and length is encoded in |
Definition at line 35 of file RangeList.h.
|
private |
Definition at line 124 of file RangeList.h.
|
private |
Definition at line 126 of file RangeList.h.
|
private |
Definition at line 123 of file RangeList.h.
|
private |
Definition at line 125 of file RangeList.h.
|
inline |
Default constructor does nothing
Definition at line 38 of file RangeList.h.
|
inline |
Construct with reverse order, without an initial allocation.
Definition at line 40 of file RangeList.h.
|
inline |
Construct with a preexisting range
| [in] | Address | beginning of the range |
| [in] | Length | length of the range |
Definition at line 44 of file RangeList.h.
Destructor frees the list
Definition at line 429 of file RangeList.h.
| RangeList< T, Reversed >::RangeList | ( | const RangeList< T, Reversed > & | other | ) |
Copy constructor - performs deep copy.
Definition at line 133 of file RangeList.h.
References RangeList< T, Reversed >::m_List.
| bool RangeList< T, Reversed >::allocate | ( | T | length, |
| T & | address | ||
| ) |
Allocate a range of a specific size
| [in] | length | the requested length |
| [in,out] | address | the beginning address of the allocated range |
Definition at line 318 of file RangeList.h.
References RangeList< T, Reversed >::Range::address, and RangeList< T, Reversed >::Range::length.
Referenced by HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), Cache::insert(), Cache::insert(), and KernelElf::prepareRuntimeModules().
Here is the caller graph for this function:| bool RangeList< T, Reversed >::allocateSpecific | ( | T | address, |
| T | length | ||
| ) |
Allocate a range of specific size and beginning address
| [in] | address | the beginning address |
| [in] | length | the length |
Definition at line 363 of file RangeList.h.
References RangeList< T, Reversed >::Range::address, and RangeList< T, Reversed >::Range::length.
Referenced by IoPortManager::allocate(), HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), HostedPhysicalMemoryManager::initialise(), X86CommonPhysicalMemoryManager::initialise(), and X86CommonPhysicalMemoryManager::initialise64().
Here is the caller graph for this function:| bool RangeList< T, Reversed >::allocateSpecificWithoutAllocation | ( | T | address, |
| T | length | ||
| ) |
Definition at line 280 of file RangeList.h.
| bool RangeList< T, Reversed >::allocateWithoutAllocation | ( | T | length, |
| T & | address | ||
| ) |
Definition at line 260 of file RangeList.h.
| void RangeList< T, Reversed >::clear | ( | ) |
Definition at line 434 of file RangeList.h.
| void RangeList< T, Reversed >::dump | ( | void(*)(const char *s) | emit_line | ) | const |
Render the RangeList, emitting each range using the given callback.
Definition at line 467 of file RangeList.h.
References RangeList< T, Reversed >::Range::address, and RangeList< T, Reversed >::Range::length.
| void RangeList< T, Reversed >::free | ( | T | address, |
| T | length, | ||
| bool | merge = true |
||
| ) |
Free a range
| [in] | address | beginning address of the range |
| [in] | length | length of the range |
| [in] | merge | set to force creation of a new range rather than merging with an existing one |
Definition at line 157 of file RangeList.h.
Referenced by HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), Cache::finishRetirement(), IoPortManager::free(), X86CommonPhysicalMemoryManager::initialisationDone(), HostedPhysicalMemoryManager::initialise(), X86CommonPhysicalMemoryManager::initialise(), IoPortManager::initialise(), X86CommonPhysicalMemoryManager::initialise64(), KernelElf::loadModule(), KernelElf::prepareRuntimeModules(), HostedPhysicalMemoryManager::unmapRegion(), and X86CommonPhysicalMemoryManager::unmapRegion().
Here is the caller graph for this function:| bool RangeList< T, Reversed >::freeWithoutAllocation | ( | T | address, |
| T | length | ||
| ) |
Retain exhausted entries as reusable storage; these never allocate.
Definition at line 228 of file RangeList.h.
References RangeList< T, Reversed >::Range::address, and RangeList< T, Reversed >::Range::length.
| bool RangeList< T, Reversed >::getRange | ( | size_t | index, |
| Range & | range | ||
| ) | const |
Get a range at a specific index.
Definition at line 419 of file RangeList.h.
Referenced by HostedPhysicalMemoryManager::initialise(), X86CommonPhysicalMemoryManager::initialise(), and X86CommonPhysicalMemoryManager::initialise64().
Here is the caller graph for this function:| RangeList< T, Reversed > & RangeList< T, Reversed >::operator= | ( | const RangeList< T, Reversed > & | l | ) |
Definition at line 141 of file RangeList.h.
|
inline |
Get the number of ranges in the list
Definition at line 104 of file RangeList.h.
Referenced by HostedPhysicalMemoryManager::initialise(), X86CommonPhysicalMemoryManager::initialise(), and X86CommonPhysicalMemoryManager::initialise64().
Here is the caller graph for this function:
|
inlinenoexcept |
Exchange range storage without allocating or freeing it.
Definition at line 95 of file RangeList.h.
Referenced by Process::commitUserReservations().
Here is the caller graph for this function:| void RangeList< T, Reversed >::sweep | ( | ) |
Sweep the RangeList and re-merge items.
Definition at line 439 of file RangeList.h.
References RangeList< T, Reversed >::Range::address, and RangeList< T, Reversed >::Range::length.
| bool RangeList< T, Reversed >::tryFree | ( | T | address, |
| T | length, | ||
| bool | merge = true |
||
| ) |
Definition at line 211 of file RangeList.h.
|
private |
Should we prefer previously-used ranges where possible?
Definition at line 121 of file RangeList.h.
List of ranges
Definition at line 118 of file RangeList.h.
Referenced by RangeList< T, Reversed >::RangeList().