#include <mapdb.h>
Public Member Functions | |
Mapdb (Address start, Address end) | |
Constructor. | |
~Mapdb () | |
Destructor. | |
Mapping * | lookup (unsigned space, Address va, Address phys) |
Lookup a mapping and lock the corresponding mapping tree. | |
void | free (Mapping *mapping_of_tree) |
Unlock the mapping tree to which the mapping belongs. | |
void | grant (Mapping *m, unsigned new_space, Address va) |
Change ownership of a mapping. | |
Static Public Member Functions | |
static Mapping * | insert (Mapping *parent, unsigned space, Address va, size_t size, Mapping_type type) |
Insert a new mapping entry with the given values as child of "parent". | |
static void | flush (Mapping *m, bool me_too) |
Delete mappings from a tree. | |
static bool | valid_address (Address phys) |
Private Attributes | |
Physframe * | physframe |
Address | _start |
Friends | |
class | Jdb_mapdb |
|
Constructor.
|
|
Destructor.
|
|
Delete mappings from a tree. This function deleted mappings recusively.
|
|
Unlock the mapping tree to which the mapping belongs. Once a tree has been unlocked, all Mapping instances pointing into it become invalid. A mapping tree is locked during lookup(). When the tree is locked, the tree may be traversed (using member functions of Mapping, which serves as an iterator over the tree) or manipulated (using insert(), free(), flush(), grant()). Note that only one insert() is allowed during each locking cycle.
|
|
Change ownership of a mapping.
|
|
Insert a new mapping entry with the given values as child of "parent". We assume that there is at least one free entry at the end of the array so that at least one insert() operation can succeed between a lookup()/free() pair of calls. This is guaranteed by the free() operation which allocates a larger tree if the current one becomes to small.
|
|
Lookup a mapping and lock the corresponding mapping tree. The returned mapping pointer, and all other mapping pointers derived from it, remain valid until free() is called on one of them. We guarantee that at most one insert() operation succeeds between one lookup()/free() pair of calls (it succeeds unless the mapping tree is full).
|
|
|
|
|
|
|
|
|