The registry is a simple yet powerful mechanism for sharing real-time objects between kernel-based and user-space tasks, or between tasks belonging to different user-space processes. Once the binding has been done, an exported object can be controlled through the regular API using the ubiquitous descriptor returned by the registry.
All high-level real-time objects created by the RTAI skin can be registered. The name parameter passed to the various object creation routines is used to have the new object indexed by the RTAI registry. Such registration is always optional though, and can be avoided by passing a null or empty name string.
Files | |
file | registry.c |
This file is part of the RTAI project. | |
Functions | |
int | rt_registry_enter (const char *key, void *objaddr, rt_handle_t *phandle) |
Register a real-time object. | |
int | rt_registry_bind (const char *key, RTIME timeout, rt_handle_t *phandle) |
Bind to a real-time object. | |
int | rt_registry_remove (rt_handle_t handle) |
Forcibly unregister a real-time object. | |
int | rt_registry_remove_safe (rt_handle_t handle, RTIME timeout) |
Unregister an idle real-time object. | |
void * | rt_registry_get (rt_handle_t handle) |
Find and lock a real-time object into the registry. | |
u_long | rt_registry_put (rt_handle_t handle) |
Unlock a real-time object from the registry. | |
void * | rt_registry_fetch (rt_handle_t handle) |
Find a real-time object into the registry. |
|
Bind to a real-time object. This service retrieves the registry handle of a given object identified by its key. Unless otherwise specified, this service will block the caller if the object is not registered yet, waiting for such registration to occur.
Environments: This service can be called from:
Rescheduling: always unless the request is immediately satisfied or timeout specifies a non-blocking operation.
|
|
Register a real-time object. This service allocates a new registry slot for an associated object, and indexes it by an alphanumeric key for later retrieval.
Environments: This service can be called from:
Rescheduling: possible. |
|
Find a real-time object into the registry. This service retrieves an object from its handle into the registry and returns the memory address of its descriptor.
This service can be called from:
Rescheduling: never. |
|
Find and lock a real-time object into the registry. This service retrieves an object from its handle into the registry and prevents it deletion atomically. A locking count is tracked, so that rt_registry_get() and rt_registry_put() must be used in pair.
This service can be called from:
Rescheduling: never. |
|
Unlock a real-time object from the registry. This service decrements the lock count of a registered object previously locked by a call to rt_registry_get(). The object is actually unlocked from the registry when the locking count falls down to zero, thus waking up any task currently waiting inside rt_registry_remove() for unregistering it.
This service can be called from:
Rescheduling: possible if the lock count falls down to zero and some task is currently waiting for the object to be unlocked. |
|
Forcibly unregister a real-time object. This service forcibly removes an object from the registry. The removal is performed regardless of the current object's locking status.
Environments: This service can be called from:
Rescheduling: never. |
|
Unregister an idle real-time object. This service removes an object from the registry. The caller might sleep as a result of waiting for the target object to be unlocked prior to the removal (see rt_registry_put()).
Environments: This service can be called from:
Rescheduling: possible if the object to remove is currently locked and the calling context can sleep.
|