![]() |
Max OS 0.3
|
A block memory that is mapped into multiple processes. More...
#include <ipc.h>
Public Member Functions | |
| SharedMemory (const string &name, size_t size, resources::resource_type_t type) | |
| Creates a new shared memory block. | |
| void | open (size_t flags) final |
| Map the shared memory into the address space of the owning process. | |
| void | close (size_t flags) final |
| Frees the page containing the shared memory. | |
| int | read (void *buffer, size_t size, size_t flags) final |
| Get the address that the current process has this shared memory mapped to. | |
| uintptr_t | physical_address () const |
| Gets the physical address of the shared memory block. | |
| size_t | size () const |
| Gets the size of the shared memory block. | |
| SharedMemory::SharedMemory | ( | const string & | name, |
| size_t | size, | ||
| resources::resource_type_t | type | ||
| ) |
Creates a new shared memory block.
| name | The name of the block |
| size | The size of the shared memory region |
| type | The type of resource |
Definition at line 30 of file ipc.cpp.
References MaxOS::memory::PhysicalMemoryManager::s_current_manager, and size().
|
final |
Frees the page containing the shared memory.
| flags | Not used for this resource |
Definition at line 99 of file ipc.cpp.
References MaxOS::memory::PhysicalMemoryManager::free_area(), and MaxOS::memory::PhysicalMemoryManager::s_current_manager.
|
final |
Map the shared memory into the address space of the owning process.
| flags | Not used for this resource |
Definition at line 82 of file ipc.cpp.
References MaxOS::processes::GlobalScheduler::current_process(), MaxOS::memory::VirtualMemoryManager::load_shared_memory(), MaxOS::processes::Process::memory_manager, MaxOS::processes::Process::pid(), and MaxOS::memory::BumpMemoryManager::vmm().
| uintptr_t SharedMemory::physical_address | ( | ) | const |
|
final |
Get the address that the current process has this shared memory mapped to.
| buffer | Not used |
| size | Not used |
| flags | Not used |
Definition at line 47 of file ipc.cpp.
References MaxOS::processes::GlobalScheduler::current_process().
| size_t SharedMemory::size | ( | ) | const |
Gets the size of the shared memory block.
Definition at line 72 of file ipc.cpp.
Referenced by SharedMemory().