NAME | SYNOPSIS | API RESTRICTIONS | PARAMETERS | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES
#include <sysevent.h>sysevent_t * sysevent_alloc(char * class, char * subclass, char * publisher, int flag);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
Event class name.
Event subclass name
Name of event publisher
Specify memory allocation policy, either KM_SLEEP or KM_NOSLEEP
Identifier of the queue to which the event must be posted
Handle pointing to event to be destroyed
The sysevent_alloc() and _sysevent_alloc() functions allocate memory for a system event buffer. The system event buffer is allocated in the memory pool associated with the queue to which the event will be posted. The class , subclass and publisher strings are included in the event buffer header.
The sysevent_free() function de-allocates memory associated with an event buffer, including any attribute data.
The first two calls only differ by the additional parameter of _sysevent_alloc() , which specifies to which pool the event must be allocated.
A dedicated memory pool is associated with each valid event queue. At least four event queues are available:
Used by the microkernel to publish events
Used by the device drivers to publish events
Suitable for the C_OS to publish events
Used by user-level applications to publish events
In addition to these predefined queues, a number of extra optional event queues may be configured at the core system event level. These optional queues are identified by an index number that starts at 0 for the first extra queue .
The sysevent_alloc() function allocates system events in the memory pool associated with the SE_OS queue.
The sysevent_alloc() and _sysevent_alloc() functions can be called from the C_OS interrupt context only if the KM_NOSLEEP flag is set. They can be called from a normal context with any valid flag . The sysevent_free() function can be called from either the normal or the interrupt context.
The sysevent_alloc() and _sysevent_alloc() functions return an event handle upon success, while NULL is returned on failure. The reason for failure is always inability to get memory from the specified pool and it can only occur if KM_NOSLEEP is specified.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | PARAMETERS | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES