9#ifndef MAXOS_PROCESSES_RESOURCES_SERVICE_RESOURCES_H
10#define MAXOS_PROCESSES_RESOURCES_SERVICE_RESOURCES_H
17#include <libkpi/resource.h>
26namespace MaxOS::processes::resources {
36 common::Spinlock m_lock;
38 uintptr_t m_shared_region;
39 KPI::service_message_ring_t* m_message_ring;
40 uintptr_t m_data_region;
42 size_t store_data(
const void* buffer,
size_t size,
bool reserve_only);
43 KPI::service_resource_message_t* aquire_slot();
53 int64_t
send_to_bridge(
size_t id, KPI::ServiceResourceCommand command,
const void* buffer,
size_t size,
size_t flags);
70 void open(
size_t flags)
final;
71 void close(
size_t flags)
final;
73 int read(
void* buffer,
size_t size,
size_t flags)
final;
74 int write(
const void* buffer,
size_t size,
size_t flags)
final;
Basic doubly linked list bump memory allocator.
A process that can be scheduled by the Scheduler, wraps & manages threads as well as its own address ...
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.
A generic wrapper for a registry of resources that exist on a userspace server.
Resource * get_resource(const string &name) final
Gets a resource from the registry by name.
Resource * create_resource(const string &name, size_t flags, uintptr_t data) final
Create a new resource on the bridge.
A generic wrapper for a Resource that exists on a userspace server which exposes its operations as Re...
void close(size_t flags) final
Closes the resource.
void create_on_bridge()
Passes the creation of a resource to the bridge.
int write(const void *buffer, size_t size, size_t flags) final
write a certain amount of bytes to a resource
void open(size_t flags) final
Opens the resource.
int read(void *buffer, size_t size, size_t flags) final
Reads data from the resource.
bool get_on_bridge()
Attempt to get a resource on a bridge endpoint that may not be registered yet.
A resource registry for a specific resource type.
Defines a InterruptManager and InterruptHandler for managing hardware and software interrupts.
Defines inter-process communication (IPC) methods such as shared memory and message endpoints.
Defines a MemoryManager class for handling memory allocation and deallocation.
Defines Process and Thread classes for managing processes and their execution contexts.
Defines classes for managing process resources such as files and devices.
KPI::Resource Resource
Alias to make the libsyscore Resource accessible here.
KPI::ResourceType resource_type_t
Alias to make the libsyscore ResourceType accessible here.
Defines a GlobalScheduler and Scheduler for managing processes and threads.