Crate axns

Source
Expand description

ArceOS namespaces module.

Namespaces are used to control system resource sharing between threads. This module provides a unified interface to access system resources in different scenarios.

For a unikernel, there is only one global namespace, so all threads share the same system resources, such as virtual address space, working directory, and file descriptors, etc.

For a monolithic kernel, each process corresponds to a namespace, all threads in the same process share the same system resources. Different processes have different namespaces and isolated resources.

For further container support, some global system resources can also be grouped into a namespace.

See the examples of def_resource! for more usage.

Modules§

link
Module for defining static resources in the axns_resource section under different operating systems.

Macros§

def_resource
Defines a resource that managed by AxNamespace.
def_static_resource
Defines a static resource of the specified type and default value, placing it in the custom linker section axns_resource.

Structs§

AxNamespace
A namespace that contains all user-defined resources.
ResArc
A helper type to easily manage shared resources.

Traits§

AxNamespaceIf
The interfaces need to be implemented when enable thread-local namespaces.

Functions§

current_namespace_base
Returns the pointer to the current namespace.