![]() |
Max OS 0.3
|
A handler to manage resource commands over shared memory. More...
#include <resource_bridge.h>
Public Member Functions | |
| BridgeHandler (string const &shared_name, Process *owner_process) | |
| Constructs a handler to manage resource commands over shared memory. | |
| size_t | allocate_id () |
| Allocates an ID to identify a resource on the bridge. | |
| int64_t | send_to_bridge (size_t id, KPI::ServiceResourceCommand command, const void *buffer, size_t size, size_t flags) |
| Send a command and its associated data to the endpoint associated with this resource. | |
Public Member Functions inherited from MaxOS::memory::allocator::BumpAllocator | |
| BumpAllocator () | |
| Creates a new bump memory allocator. | |
| virtual | ~BumpAllocator () |
| Destructs a Bump memory allocator. | |
| void | setup_region (uintptr_t address, size_t length) final |
| Setup a region to be bump memory managed, creates a free chunk represent the whole region. | |
| void * | allocate (size_t size) final |
| Allocates a block of memory. | |
| void | unallocate (void *pointer) final |
| Frees a block of memory. | |
| size_t | amount_used () final |
| Returns the amount of memory used. | |
| size_t | align (size_t size) final |
| Aligns the size to the chunk alignment. | |
Public Member Functions inherited from MaxOS::memory::allocator::MemoryAllocator | |
| MemoryAllocator () | |
| virtual | ~MemoryAllocator () |
A handler to manage resource commands over shared memory.
Definition at line 32 of file resource_bridge.h.
| BridgeHandler::BridgeHandler | ( | string const & | shared_name, |
| Process * | owner_process | ||
| ) |
Constructs a handler to manage resource commands over shared memory.
Definition at line 21 of file resource_bridge.cpp.
References MaxOS::processes::resources::GlobalResourceRegistry::get_registry(), MaxOS::processes::resources::BaseResourceRegistry::get_resource(), MaxOS::memory::VirtualMemoryManager::load_shared_memory(), MaxOS::memory::MemoryManager::s_kernel_memory_manager, MaxOS::memory::allocator::BumpAllocator::setup_region(), and MaxOS::memory::BumpMemoryManager::vmm().
| size_t BridgeHandler::allocate_id | ( | ) |
Allocates an ID to identify a resource on the bridge.
Definition at line 122 of file resource_bridge.cpp.
| int64_t BridgeHandler::send_to_bridge | ( | size_t | id, |
| KPI::ServiceResourceCommand | command, | ||
| const void * | buffer, | ||
| size_t | size, | ||
| size_t | flags | ||
| ) |
Send a command and its associated data to the endpoint associated with this resource.
| id | The id of the resource |
| command | The command to execute |
| buffer | The data to pass along with the command |
| size | The size of the data buffer |
| flags | Flags associated with the command |
Definition at line 139 of file resource_bridge.cpp.
References MaxOS::processes::GlobalScheduler::current_process(), MaxOS::processes::GlobalScheduler::current_thread(), MaxOS::processes::Process::memory_manager, MaxOS::processes::Process::pid(), MaxOS::memory::allocator::BumpAllocator::unallocate(), MaxOS::memory::VirtualMemoryManager::unload_range_from_process(), MaxOS::memory::BumpMemoryManager::vmm(), and MaxOS::processes::Thread::yield().