EM-ODP 4.4.0
Event Machine on ODP
Loading...
Searching...
No Matches
em_internal_event.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <odp_api.h>
#include <event_machine.h>
#include <event_machine/platform/env/environment.h>
#include "em_atomic_group.h"
#include "em_atomic_group_types.h"
#include "em_core.h"
#include "em_eo.h"
#include "em_eo_types.h"
#include "em_error.h"
#include "em_event.h"
#include "em_event_group.h"
#include "em_event_group_types.h"
#include "em_event_inline.h"
#include "em_event_state.h"
#include "em_event_types.h"
#include "em_internal_event.h"
#include "em_internal_event_types.h"
#include "em_mem.h"
#include "em_queue.h"
#include "em_queue_group.h"
#include "em_queue_group_types.h"
#include "em_queue_inline.h"
#include "em_queue_types.h"
Include dependency graph for em_internal_event.c:

Go to the source code of this file.

Functions

em_status_t create_shared_ctrl_queue (void)
 Create EM's internal shared unscheduled control queue at startup.
 
em_status_t create_ctrl_queue (void)
 Create EM's internal unscheduled control queues at startup - one per core.
 
em_status_t delete_ctrl_queues (void)
 Delete EM's internal unscheduled control queues at teardown.
 
int send_core_ctrl_events (const odp_thrmask_t *const thr_mask, em_event_t ctrl_event, void(*f_done_callback)(void *arg_ptr), void *f_done_arg_ptr, int num_notif, const em_notif_t notif_tbl[], bool sync_operation)
 Sends an internal control event to each thread set in 'mask'.
 
em_event_group_t internal_done_w_notif_req (int event_group_count, void(*f_done_callback)(void *arg_ptr), void *f_done_arg_ptr, int num_notif, const em_notif_t notif_tbl[], bool sync_operation)
 Helper func: Allocate & set up the internal 'done' event with function callbacks and notification events. Creates the needed event group and applies the event group count. A successful setup returns the event group ready for use with em_send_group().
 
void evgrp_abort_delete (em_event_group_t event_group)
 internal_done_w_notif_req() 'companion' to abort and delete the event group created by the mentioned function.
 
em_status_t send_notifs (const int num_notif, const em_notif_t notif_tbl[])
 Helper func to send notifications events.
 
em_status_t check_notif (const em_notif_t *const notif)
 Check that the usage of a notification is valid.
 
em_status_t check_notif_tbl (const int num_notif, const em_notif_t notif_tbl[])
 Check that the usage of a table of notifications is valid.
 
void poll_unsched_ctrl_queue (void)
 Poll EM's internal unscheduled control queues during dispatch.
 

Detailed Description

EM Internal Control

Definition in file em_internal_event.c.

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 39 of file em_internal_event.c.

Function Documentation

◆ check_notif()

em_status_t check_notif ( const em_notif_t *const  notif)

Check that the usage of a notification is valid.

Definition at line 515 of file em_internal_event.c.

◆ check_notif_tbl()

em_status_t check_notif_tbl ( const int  num_notif,
const em_notif_t  notif_tbl[] 
)

Check that the usage of a table of notifications is valid.

Definition at line 542 of file em_internal_event.c.

◆ create_ctrl_queue()

em_status_t create_ctrl_queue ( void  )

Create EM's internal unscheduled control queues at startup - one per core.

Definition at line 104 of file em_internal_event.c.

◆ create_shared_ctrl_queue()

em_status_t create_shared_ctrl_queue ( void  )

Create EM's internal shared unscheduled control queue at startup.

Definition at line 76 of file em_internal_event.c.

◆ delete_ctrl_queues()

em_status_t delete_ctrl_queues ( void  )

Delete EM's internal unscheduled control queues at teardown.

Definition at line 155 of file em_internal_event.c.

◆ evgrp_abort_delete()

void evgrp_abort_delete ( em_event_group_t  event_group)

internal_done_w_notif_req() 'companion' to abort and delete the event group created by the mentioned function.

Definition at line 471 of file em_internal_event.c.

◆ internal_done_w_notif_req()

em_event_group_t internal_done_w_notif_req ( int  event_group_count,
void(*)(void *arg_ptr)  f_done_callback,
void *  f_done_arg_ptr,
int  num_notif,
const em_notif_t  notif_tbl[],
bool  sync_operation 
)

Helper func: Allocate & set up the internal 'done' event with function callbacks and notification events. Creates the needed event group and applies the event group count. A successful setup returns the event group ready for use with em_send_group().

Returns
An event group successfully 'applied' with count and notifications.
Return values
EM_EVENT_GROUP_UNDEFon error
See also
evgrp_abort_delete() below for deleting the event group returned by this function.

Definition at line 403 of file em_internal_event.c.

◆ poll_unsched_ctrl_queue()

void poll_unsched_ctrl_queue ( void  )

Poll EM's internal unscheduled control queues during dispatch.

Definition at line 607 of file em_internal_event.c.

◆ send_core_ctrl_events()

int send_core_ctrl_events ( const odp_thrmask_t *const  mask,
em_event_t  ctrl_event,
void(*)(void *arg_ptr)  f_done_callback,
void *  f_done_arg_ptr,
int  num_notif,
const em_notif_t  notif_tbl[],
bool  sync_operation 
)

Sends an internal control event to each thread set in 'mask'.

When all threads set in 'mask' have processed the event an additional internal 'done' msg is sent to synchronize - this done-event can then trigger any notifications for the user that the operation was completed. Processing of the 'done' event will also call the 'f_done_callback' function if given.

Returns
0 on success, otherwise return the number of ctrl events that could not be sent due to error

Definition at line 198 of file em_internal_event.c.

◆ send_notifs()

em_status_t send_notifs ( const int  num_notif,
const em_notif_t  notif_tbl[] 
)

Helper func to send notifications events.

Definition at line 488 of file em_internal_event.c.