Introduction   Client Library API Reference   Demo1   Demo2   Demo3   File List   Index  

events.h File Reference

constants and client-library API More...

Go to the source code of this file.

Data Structures

struct  l4events_event_t
 definition of messge (event) More...

Defines

#define L4EVENTS_OK   0
 Ok.
#define L4EVENTS_WARNING_TASK_REGISTERED   0xf1
 Task is already registered.
#define L4EVENTS_WARNING_TASK_NOT_REGISTERED   0xf2
 Task is not registered.
#define L4EVENTS_WARNING_EVENTS_DELETED   0xf3
 Task lost pending events deleted during unregister.
#define L4EVENTS_WARNING_EVENTTYP_NOT_REGISTERED   0xf4
 There is no registered task for this channel.
#define L4EVENTS_WARNING_NO_EVENT_TO_RECEIVE   0xf5
 The task has no event to receive.
#define L4EVENTS_WARNING_EVENT_PENDING   0xf6
 Some registered task has not received this event.
#define L4EVENTS_WARNING_INVALID_EVENTNR   0xf7
 The event-number the task want to be acknowledged doesn't exist.
#define L4EVENTS_ERROR_INTERNAL   0xf8
 Internal server error occured.
#define L4EVENTS_ERROR_IPC   0xf9
 IPC error occured.
#define L4EVENTS_ERROR_TIMEOUT   0xfa
 IPC timeout occured.
#define L4EVENTS_ERROR_INVALID_COMMAND   0xfb
 Unknown command was sent.
#define L4EVENTS_ERROR_OTHER   0xfc
 Undefined error occured.
#define L4EVENTS_RECV_OTHER   0xfd
 another server replied to an open wait call.
#define L4EVENTS_ERROR_NOT_EXISTS   0xfe
 thread does not exists or we are not allowed to communicate
#define L4EVENTS_ASYNC   1
 non-blocking send
#define L4EVENTS_SEND_ACK   2
 acknowledge after sending
#define L4EVENTS_RECV_ACK   4
 give acknowledge after receive
#define L4EVENTS_GIVE_ACK   8
 give acknowledge and receive
#define L4EVENTS_RECV_SHORT   16
 receive a short event
#define L4EVENTS_NO_CHANNEL   0
 event_ch 0 is reserved
#define L4EVENTS_EXIT_CHANNEL   1
 event_ch for task exit
#define L4EVENTS_MAX_BUFFER_SIZE   60
 definition of the maximum length of an event
#define L4EVENTS_MAX_PRIORITY   15
 maximum priority
#define L4EVENTS_NO_NR   0
 event-nr 0 is reserved

Typedefs

typedef l4_uint16_t l4events_ch_t
 definition of a channel
typedef l4_umword_t l4events_nr_t
 definition of an event-nr
typedef L4_CV void(* l4events_recv_function_t )(l4events_ch_t, l4events_event_t *)
 callback function type definition

Functions

L4_CV int l4events_init (void)
 Initializes the event server.
L4_CV long l4events_register (const l4events_ch_t event_ch, const l4events_pr_t priority)
 Registers a task with its task id for an channel.
L4_CV long l4events_unregister (const l4events_ch_t event_ch)
 Unregisters a task for an channel.
L4_CV long l4events_unregister_all (void)
 Unregisters a task for all previous registered channels.
L4_CV long l4events_send (const l4events_ch_t event_ch, l4events_event_t *event, l4events_nr_t *event_nr, const int opt)
 Sends an event to all registered tasks.
L4_CV long l4events_receive (l4events_ch_t *event_ch, l4events_event_t *event, l4events_nr_t *event_nr, l4_timeout_t timeout, const int opt)
 Receives an event.
L4_CV long l4events_give_ack_and_receive (l4events_ch_t *event_ch, l4events_event_t *event, l4events_nr_t *event_nr, l4_timeout_t timeout, const int opt)
 Acknowledges and receives an event.
L4_CV int l4events_dump (void)
 Dumps some information about the event server.
L4_CV void l4events_wait (int threadno, l4events_ch_t event_ch, l4events_recv_function_t function)
 Starts a thread that waits for an event.
L4_CV long l4events_get_ack (l4events_nr_t *event_nr, l4_timeout_t timeout)
 Tries to get acknowledge after sending an event.
L4_CV long l4events_get_ack_open (l4events_nr_t *event_nr, l4_threadid_t *id, l4_umword_t *w1, l4_umword_t *w2, l4_timeout_t timeout)
 Tries to get acknowledge after sending an event with an open wait.
L4_CV long l4events_give_ack (l4events_nr_t event_nr)
 Tries to set acknowledge after receiving an event.


Detailed Description

constants and client-library API

Date:
09/14/2003
Author:
Torsten Frenzel <frenzel@os.inf.tu-dresden.de>

Definition in file events.h.


Define Documentation

#define L4EVENTS_OK   0

Ok.

constants for the warnings and errors returned by the events server and the library

The request was processed successful by the server.

Definition at line 40 of file events.h.

#define L4EVENTS_WARNING_TASK_REGISTERED   0xf1

Task is already registered.

The task tries itself to register twice for the same channel. The request was ignored by the server.

See also:
l4events_register

Definition at line 49 of file events.h.

#define L4EVENTS_WARNING_TASK_NOT_REGISTERED   0xf2

Task is not registered.

The task is not registered for this channel, but tries to unregister. The request is ignoered by the server.

See also:
l4events_unregister

Definition at line 58 of file events.h.

#define L4EVENTS_WARNING_EVENTS_DELETED   0xf3

Task lost pending events deleted during unregister.

The has itself unregistered for an channel. During the operation the server removed some pending events from the wait-queue of this task. This may cause serious information loss.

See also:
l4events_unregister

Definition at line 68 of file events.h.

#define L4EVENTS_WARNING_EVENTTYP_NOT_REGISTERED   0xf4

There is no registered task for this channel.

The task has send an event. During the operation the server hasn't found any registered task for this channel. The event was thrown away. This may cause serious information loss.

See also:
l4events_send

Definition at line 78 of file events.h.

#define L4EVENTS_WARNING_NO_EVENT_TO_RECEIVE   0xf5

The task has no event to receive.

The thread tries to receive some event. During the operation the server hasn't found any event suitable for this receive.

See also:
l4events_receive, l4events_receive_short

Definition at line 87 of file events.h.

#define L4EVENTS_WARNING_EVENT_PENDING   0xf6

Some registered task has not received this event.

The thread tries to send some event. During the operation the server has found some registered tasks, but wasn't able send the event. The event was appended to the wait queue for this task.

Definition at line 96 of file events.h.

#define L4EVENTS_WARNING_INVALID_EVENTNR   0xf7

The event-number the task want to be acknowledged doesn't exist.

The task want to be acknowledged of the completion of sending an event, but the corresponding event-number specified is invalid.

Definition at line 104 of file events.h.

#define L4EVENTS_ERROR_INTERNAL   0xf8

Internal server error occured.

The datastructures the server maintained are corrupted. If the problem persists contact the maintainer.

Definition at line 112 of file events.h.

#define L4EVENTS_ERROR_IPC   0xf9

IPC error occured.

The reply sent by the server wasn't successful. The problem may be caused by some errors in the client-library or the server-library. Contact the maintainer.

Definition at line 121 of file events.h.

#define L4EVENTS_ERROR_TIMEOUT   0xfa

IPC timeout occured.

The client-library detected an IPC timeout. This could normally only happen during a receive operation with timeout set. The error should be handled by client.

See also:
l4events_receive, l4events_receive_short

Definition at line 131 of file events.h.

#define L4EVENTS_ERROR_INVALID_COMMAND   0xfb

Unknown command was sent.

The server-library can't interpret the command sent. This error normally shouldn't happen with using client-library for making requests to the server.

Definition at line 139 of file events.h.

#define L4EVENTS_ERROR_OTHER   0xfc

Undefined error occured.

Definition at line 143 of file events.h.

#define L4EVENTS_RECV_OTHER   0xfd

another server replied to an open wait call.

Definition at line 147 of file events.h.

#define L4EVENTS_ERROR_NOT_EXISTS   0xfe

thread does not exists or we are not allowed to communicate

Definition at line 151 of file events.h.

#define L4EVENTS_ASYNC   1

non-blocking send

The sender is not blocked while the server tries to send the event to all registered tasks. The default is that the sender is blocked while the server tries to send the event to all registered tasks.

See also:
l4events_send

Definition at line 196 of file events.h.

#define L4EVENTS_SEND_ACK   2

acknowledge after sending

The sender can get acknowledged after all registered tasks for the channel have received the event. The acknowledge can be requested with l4events_get_ack. The default is to get no acknowledge.

See also:
l4events_send and

l4events_get_ack

Definition at line 208 of file events.h.

#define L4EVENTS_RECV_ACK   4

give acknowledge after receive

The receiver can give acknowledged after processing the received event. The acknowledge can be given with l4events_give_ack or combined with l4events_give_ack_and_receive. The default is to get no acknowledge.

See also:
l4events_receive and

l4events_give_ack

Definition at line 221 of file events.h.

#define L4EVENTS_GIVE_ACK   8

give acknowledge and receive

Use the API function l4events_give_ack_and_receive.

Definition at line 229 of file events.h.

#define L4EVENTS_RECV_SHORT   16

receive a short event

The receiver wants to receive a short event. The size of the event depends on the implementation.

Definition at line 237 of file events.h.

#define L4EVENTS_NO_CHANNEL   0

event_ch 0 is reserved

Definition at line 243 of file events.h.

#define L4EVENTS_EXIT_CHANNEL   1

event_ch for task exit

Definition at line 246 of file events.h.

#define L4EVENTS_MAX_BUFFER_SIZE   60

definition of the maximum length of an event

Definition at line 249 of file events.h.

#define L4EVENTS_MAX_PRIORITY   15

maximum priority

Definition at line 252 of file events.h.

#define L4EVENTS_NO_NR   0

event-nr 0 is reserved

Definition at line 269 of file events.h.


Typedef Documentation

typedef l4_uint16_t l4events_ch_t

definition of a channel

Definition at line 240 of file events.h.

typedef l4_umword_t l4events_nr_t

definition of an event-nr

Definition at line 264 of file events.h.

callback function type definition

Return values:
1 received channel
2 received event

Definition at line 413 of file events.h.


Events Reference Manual, written by Torsten Frenzel  © 2003