15using namespace MaxOS::processes;
16using namespace MaxOS::common;
17using namespace MaxOS::memory;
37SharedMemory::~SharedMemory() =
default;
51 if(
it == m_mappings.
end())
64 return m_physical_address;
86 if(
it != m_mappings.
end())
140 return -1 * (
int)resource_error_base_t::SHOULD_BLOCK;
160 m_message_lock.
lock();
Wrapper class for a region of bytes in memor in an attempt to add some memory safety....
iterator find(Key)
Finds an element in the map based on the key.
iterator end()
Returns the end of the map.
void insert(Key, Value)
Updates the value of an element, or adds a new element if it does not exist.
Stores the left, top, width and height of a rectangle.
void lock()
Lock the spinlock once it is available.
void unlock()
Unlock the spinlock.
static PhysicalMemoryManager * s_current_manager
The current physical memory manager in use.
static Process * current_process()
Gets the process on the currently executing core.
Represents a generic resource that can be opened, closed, read from and written to.
size_t size() const
Gets the size of the shared memory block.
int read(void *buffer, size_t size, size_t flags) final
Get the address that the current process has this shared memory mapped to.
void close(size_t flags) final
Frees the page containing the shared memory.
uintptr_t physical_address() const
Gets the physical address of the shared memory block.
SharedMemory(const string &name, size_t size, 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.
int write(const void *buffer, size_t size, size_t flags) final
Handles writing to the message endpoint resource by writing the buffer as a message.
int read(void *buffer, size_t size, size_t flags) final
Reads the first message from the endpoint or will yield until a message has been written.
SharedMessageEndpoint(const string &name, size_t size, resource_type_t type)
Creates a new shared message endpoint.
~SharedMessageEndpoint() final
Destroys the shared message endpoint and frees all messages.
Defines inter-process communication (IPC) methods such as shared memory and message endpoints.
Defines a Logger class for logging messages with different severity levels to multiple output streams...
void * memcpy(void *destination, const void *source, uint64_t num)
Copies a block of memory from one location to another.
::syscore::ResourceType resource_type_t
Alias to make the libsyscore ResourceType accessible here.
Defines a GlobalScheduler and Scheduler for managing processes and threads.