#include <memory_manager.hpp>


Public Types | |
|
typedef memory_space< l4_gpa_t, mmio_handler > | gpa_space |
| typedef gpa_space::region_type | mmio_region |
|
typedef memory_space< l4_hpa_t, mmio_handler > | hpa_space |
Public Member Functions | |
| memory_manager (const machine_config &config) | |
| virtual int | check_mmio_request (const mmio_handler *handler, l4_gpa_t base, l4_gpa_t size=1, bool verbose=VERBOSE_ALLOCATION) const |
| virtual const mmio_region * | search_mmio_region (const l4_gpa_t base, const l4_gpa_t size=1) |
| virtual int | register_mmio_handler (mmio_handler *handler, l4_gpa_t base, l4_gpa_t size=1, bool verbose=VERBOSE_ALLOCATION) |
| virtual int | unregister_mmio_handler (const mmio_handler *handler, l4_gpa_t base, l4_gpa_t size=1, bool verbose=VERBOSE_ALLOCATION) |
| virtual l4_hva_t | request_mmio_region (mmio_handler *handler, int l4io_flags, l4_hpa_t base, l4_hpa_t size=1, bool verbose=VERBOSE_ALLOCATION) |
| virtual int | release_mmio_region (const mmio_handler *handler, l4_hpa_t base, l4_hpa_t size=1, bool verbose=VERBOSE_ALLOCATION) |
| virtual int | release_mmio_regions (const mmio_handler *handler=nullptr, bool verbose=VERBOSE_ALLOCATION) |
| l4_hva_t | phys2virt (const l4_gpa_t phys) |
| l4_hva_t | phys2virt_cached (const l4_gpa_t phys) |
| virtual void | print_gpa_state (const char *header=nullptr) |
| virtual void | print_hpa_state (const char *header=nullptr) |
Static Public Attributes | |
| static const bool | VERBOSE_ALLOCATION = false |
Protected Member Functions | |
| virtual int | init_memory (void) |
Protected Attributes | |
| const machine_config & | config |
| The machine's configuration struct. | |
| lock | gpa_lock |
| Locks to lock critical sections in register/unregister & request/release routines. | |
| lock | hpa_lock |
| gpa_space | gpa_map |
| Memory map storing which device handles which (guest) physical memory region. | |
| hpa_space | hpa_map |
| Memory map storing which device allocated which (host) physical memory region. | |
| semaphore | frame2page_lock |
| Lock to lock critical sections in phys-to-virt lookup routines. | |
| map< l4_gpa_t, l4_hva_t > | frame2page_cache |
| Cache for (guest) physical to (host) virtual address lookups (stores frame-to-page mappings). | |
Private Member Functions | |
| template<typename SpaceT, typename LockT> | |
| void | print_memory_state (const SpaceT &map, LockT &lock, const char *header=nullptr) |
const machine_config& memory_manager::config [protected] |