C factory interface to create objects, see L4::Factory for the C++ interface.
More...
|
l4_msgtag_t | l4_factory_create_task (l4_cap_idx_t factory, l4_cap_idx_t target_cap, l4_fpage_t utcb_area) L4_NOTHROW |
| Create a new task.
|
|
l4_msgtag_t | l4_factory_create_thread (l4_cap_idx_t factory, l4_cap_idx_t target_cap) L4_NOTHROW |
| Create a new thread.
|
|
l4_msgtag_t | l4_factory_create_factory (l4_cap_idx_t factory, l4_cap_idx_t target_cap, unsigned long limit) L4_NOTHROW |
| Create a new factory.
|
|
l4_msgtag_t | l4_factory_create_gate (l4_cap_idx_t factory, l4_cap_idx_t target_cap, l4_cap_idx_t thread_cap, l4_umword_t label) L4_NOTHROW |
| Create a new IPC gate.
|
|
l4_msgtag_t | l4_factory_create_irq (l4_cap_idx_t factory, l4_cap_idx_t target_cap) L4_NOTHROW |
| Create a new IRQ sender.
|
|
l4_msgtag_t | l4_factory_create_vm (l4_cap_idx_t factory, l4_cap_idx_t target_cap) L4_NOTHROW |
| Create a new virtual machine.
|
|
l4_msgtag_t | l4_factory_create (l4_cap_idx_t factory, long obj, l4_cap_idx_t target) L4_NOTHROW |
| Create a new object.
|
|
C factory interface to create objects, see L4::Factory for the C++ interface.
A factory is used to create all kinds of kernel objects:
To create a new kernel object the caller has to specify the factory to use for creation. The caller has to allocate a capability slot where the kernel stores the new object's capability.
The factory is equipped with a limit that limits the amount of kernel memory available for that factory.
- Note
- The limit does not give any guarantee for the amount of available kernel memory.
- Include File
Common factory related definitions.
For the C++ interface refer to L4::Factory.
◆ l4_factory_create()
Create a new object.
- Parameters
-
| factory | Factory to use for creation. |
| obj | Protocol ID to describe the type of the object to create. |
[out] | target | The kernel stores the new objects's capability into this slot. |
- Return values
-
L4_EOK | No error occurred. |
-L4_EPERM | The factory instance requires L4_CAP_FPAGE_S rights on factory and L4_CAP_FPAGE_S is not present. |
<0 | Error code. |
Definition at line 591 of file factory.h.
References l4_utcb().
◆ l4_factory_create_factory()
Create a new factory.
- Parameters
-
| factory | Capability selector for factory to use for creation. |
[out] | target_cap | The kernel stores the new factory's capability into this slot. |
| limit | Limit for the new factory in bytes. |
- Returns
- Syscall return tag
- Return values
-
L4_EOK | No error occurred. |
-L4_EPERM | The factory instance requires L4_CAP_FPAGE_S rights on factory and L4_CAP_FPAGE_S is not present. |
<0 | Error code. |
- Note
- The limit of the new factory is subtracted from the available amount of the factory used for creation.
-
This method is only guaranteed to work with the Kernel Factory. For other services, use the generic L4::Factory::create() method and consult the service documentation for information on the arguments that need to be passed to the create stream.
Definition at line 445 of file factory.h.
References l4_utcb().
◆ l4_factory_create_gate()
Create a new IPC gate.
- Parameters
-
| factory | Capability selector for factory to use for creation. |
[out] | target_cap | The kernel stores the new IPC gate's capability into this slot. |
| thread_cap | Optional capability selector of a thread to bind the gate to. Use L4_INVALID_CAP to create an unbound IPC gate. |
| label | Optional label of the gate (precisely used if thread_cap is valid). If thread_cap is valid, label must be present. |
- Returns
- Syscall return tag containing one of the following return codes.
- Return values
-
L4_EOK | No error occurred. |
-L4_ENOMEM | Out-of-memory during allocation of the Ipc_gate object. |
-L4_EINVAL | thread_cap is void or points to something that is not a thread. |
-L4_EPERM | No L4_CAP_FPAGE_S rights on factory or thread_cap . |
An unbound IPC gate can be bound to a thread using l4_rcv_ep_bind_thread().
- See also
- IPC-Gate API
Definition at line 453 of file factory.h.
References l4_utcb().
◆ l4_factory_create_irq()
Create a new IRQ sender.
- Parameters
-
| factory | Factory to use for creation. |
[out] | target_cap | The kernel stores the new IRQ's capability into this slot. |
- Return values
-
L4_EOK | No error occurred. |
-L4_EPERM | The factory instance requires L4_CAP_FPAGE_S rights on factory and L4_CAP_FPAGE_S is not present. |
<0 | Error code. |
- See also
- IRQs
- Examples
- examples/sys/isr/main.c.
Definition at line 461 of file factory.h.
References l4_utcb().
◆ l4_factory_create_task()
Create a new task.
- Parameters
-
| factory | Capability selector for factory to use for creation. |
[out] | target_cap | The kernel stores the new task's capability into this slot. |
| utcb_area | Flexpage that describes an area of kernel-user memory that can be used for UTCBs and vCPU state-save-areas of the new task. |
- Returns
- Syscall return tag.
- Return values
-
L4_EOK | No error occurred. |
-L4_EPERM | The factory instance requires L4_CAP_FPAGE_S rights on factory and L4_CAP_FPAGE_S is not present. |
<0 | Error code. |
- Note
- The size of the UTCB area specifies indirectly the number of UTCBs available for this task. Refer to l4_task_add_ku_mem() for adding more of this type of memory.
- See also
- Task
Definition at line 431 of file factory.h.
References l4_utcb().
◆ l4_factory_create_thread()
◆ l4_factory_create_vm()
Create a new virtual machine.
- Parameters
-
| factory | Capability selector for factory to use for creation. |
[out] | target_cap | The kernel stores the new VM's capability into this slot. |
- Returns
- Syscall return tag
- Return values
-
L4_EOK | No error occurred. |
-L4_EPERM | The factory instance requires L4_CAP_FPAGE_S rights on factory and L4_CAP_FPAGE_S is not present. |
<0 | Error code. |
- See also
- Virtual Machines
Definition at line 468 of file factory.h.
References l4_utcb().