![]() |
Max OS 0.3
|
Manages the creation, retention and destruction of resources representing processes. More...
#include <scheduler_resources.h>
Public Member Functions | |
| Resource * | get_resource (const string &name) final |
| The. | |
| Resource * | create_resource (const string &name, size_t flags, uintptr_t data) final |
| Opens an executable. | |
Public Member Functions inherited from MaxOS::processes::resources::ResourceRegistry< ProcessResource > | |
| ResourceRegistry (resource_type_t type) | |
| Constructor for ResourceRegistry of a specific type. | |
| Resource * | create_resource (const string &name, size_t flags, uintptr_t data) override |
| Create a new resource of the specific type. | |
Public Member Functions inherited from MaxOS::processes::resources::BaseResourceRegistry | |
| BaseResourceRegistry (resource_type_t type) | |
| Constructs a new BaseResourceRegistry object and registers it globally. | |
| ~BaseResourceRegistry () | |
| Destructor for BaseResourceRegistry, removes it from the global list. | |
| resource_type_t | type () |
| Gets the type of resources this registry handles. | |
| bool | register_resource (Resource *resource) |
| Registers a resource in the registry. | |
| void | close_resource (Resource *resource, size_t flags) |
| Close the resource provided, if it exists in this registry. | |
Additional Inherited Members | |
Protected Attributes inherited from MaxOS::processes::resources::BaseResourceRegistry | |
| common::Map< string, Resource * > | m_resources |
| The map of resource names to resource instances. | |
| common::Map< string, uint64_t > | m_resource_uses |
| The map of resource names to how many processes are using them. | |
| common::Spinlock | m_lock |
| The lock to make the registry threadsafe. | |
| resource_type_t | m_type |
| The resource type that this registry manages. | |
Manages the creation, retention and destruction of resources representing processes.
Definition at line 93 of file scheduler_resources.h.
| ProcessResourceRegistry::ProcessResourceRegistry | ( | ) |
Definition at line 347 of file scheduler_resources.cpp.
|
finalvirtual |
Opens an executable.
| name | The path to the executable to open |
| flags | td |
Reimplemented from MaxOS::processes::resources::BaseResourceRegistry.
Definition at line 362 of file scheduler_resources.cpp.
References MaxOS::processes::GlobalScheduler::current_process(), MaxOS::memory::MemoryManager::kmalloc(), and MaxOS::processes::GlobalScheduler::system_scheduler().
|
finalvirtual |
The.
| name |
Reimplemented from MaxOS::processes::resources::BaseResourceRegistry.
Definition at line 417 of file scheduler_resources.cpp.
References MaxOS::processes::GlobalScheduler::current_process(), MaxOS::processes::GlobalScheduler::get_process(), MaxOS::processes::resources::BaseResourceRegistry::get_resource(), and MaxOS::processes::resources::BaseResourceRegistry::register_resource().