Introduction   Client Library API Reference   Demo1   Demo2   Demo3   File List   Index  

client-library API

Functions the client uses to communicate with the server. More...

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

Functions the client uses to communicate with the server.


Function Documentation

L4_CV int l4events_init ( void   ) 

Initializes the event server.

Returns:
1 if event server was found; 0 otherwise

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.

Parameters:
event_ch specifies the channel
priority specifies the priority (0 is lowest ... 15 is highest) If bit 7 is set the client is assumed as untrusted, that is if the client is not ready to receive an event immediately, the event is assumed as successfully delivered.
Returns:
indicates a successful opration, please see return-makros for possible return values

L4_CV long l4events_unregister ( const l4events_ch_t  event_ch  ) 

Unregisters a task for an channel.

Parameters:
event_ch specifies the channel
Returns:
indicates a successful operation, please see return-makros for possible return values

L4_CV long l4events_unregister_all ( void   ) 

Unregisters a task for all previous registered channels.

Returns:
indicates a successful operation, please see return-makros for possible return values

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.

Parameters:
event_ch specifies the channel
event event to send
opt options for send
See also:
L4EVENTS_ASYNC and L4EVENTS_ACK
Returns:
indicates a successful operation, please see return-makros for possible return values

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.

Parameters:
event_ch channel to receive (specify L4EVENTS_NO_ID for all)
Return values:
event_ch returns the received channel
event returns the received event
event_nr returns the unique event-number of the event
Parameters:
timeout specifies the IPC timeout
opt options for receive
See also:
L4EVENTS_RECV_ACK
Returns:
indicates a successful operation, please see return-makros for possible return values

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.

Parameters:
event_ch channel to receive (specify L4EVENTS_NO_ID for all)
Return values:
event_ch returns the received channel
event returns the received short event
Parameters:
event_nr event-number for the event to acknowledge
Return values:
event_nr returns the unique event-number of the event
Parameters:
timeout specifies the IPC timeout
opt options for receive
See also:
L4EVENTS_RECV_ACK
Returns:
indicates a successful operation, please see return-makros for possible return values

L4_CV int l4events_dump ( void   ) 

Dumps some information about the event server.

This displays the current state of the data structures. If the option debug_malloc is switched on, then also memory usage is shown.

Returns:
indicates a successful opration, please see return-makros for possible return values

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.

Parameters:
threadno the threadno of the wait-thread
event_ch the channel to be waited for
function callback function which is responsible for processing the received event

L4_CV long l4events_get_ack ( l4events_nr_t event_nr,
l4_timeout_t  timeout 
)

Tries to get acknowledge after sending an event.

Parameters:
event_nr event_nr for which to get acknowledge
timeout specifies the IPC timeout
Returns:
indicates a successful operation, please see return-makros for possible return values

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.

Parameters:
event_nr event_nr for whicch to get acknowledge
timeout specifies the IPC timeout
Return values:
sender contains id of sender if timeout than L4_INVALID_ID
w1 value of dword1 if sender was not events
w2 value of dword2 if sender was not events
Returns:
indicates a successful operation, please see return-makros for possible return values

L4_CV long l4events_give_ack ( l4events_nr_t  event_nr  ) 

Tries to set acknowledge after receiving an event.

Parameters:
event_ch event_nr for whicch to give acknowledge after receiving
Returns:
indicates a successful operation, please see return-makros for possible return values


Events Reference Manual, written by Torsten Frenzel  © 2003