Skip to content

Commit

Permalink
api: schedule: add scheduler config and start API
Browse files Browse the repository at this point in the history
Add API calls to configure and start scheduler subsystem.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
  • Loading branch information
Dmitry Eremin-Solenikov authored and muvarov committed Nov 30, 2018
1 parent 3b1247a commit c3e88f4
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
38 changes: 38 additions & 0 deletions include/odp/api/spec/schedule.h
Expand Up @@ -257,6 +257,44 @@ int odp_schedule_default_prio(void);
*/
int odp_schedule_num_prio(void);

/**
* Initialize schedule configuration options
*
* Initialize an odp_schedule_config_t to its default values.
*
* @param[out] config Pointer to schedule configuration structure
*/
void odp_schedule_config_init(odp_schedule_config_t *config);

/**
* Global schedule configuration
*
* Initialize and configure scheduler with global configuration options
* to schedule events across different scheduled queues.
* This function must be called before scheduler is used (any other scheduler
* function is called except odp_schedule_capability() and
* odp_schedule_config_init()) or any queues are created (by application itself
* or by other ODP modules).
* An application can pass NULL value to use default configuration. It will
* have the same result as filling the structure with
* odp_schedule_config_init() and then passing it to odp_schedule_config().
*
* The initialization sequeunce should be,
* odp_schedule_capability()
* odp_schedule_config_init()
* odp_schedule_config()
* odp_schedule()
*
* @param config Pointer to scheduler configuration structure or NULL for the
* default configuration
*
* @retval 0 on success
* @retval <0 on failure
*
* @see odp_schedule_capability(), odp_schedule_config_init()
*/
int odp_schedule_config(const odp_schedule_config_t *config);

/**
* Query scheduler capabilities
*
Expand Down
19 changes: 19 additions & 0 deletions include/odp/api/spec/schedule_types.h
Expand Up @@ -200,6 +200,25 @@ typedef struct odp_schedule_capability_t {

} odp_schedule_capability_t;

/**
* Schedule configuration
*/
typedef struct odp_schedule_config_t {
/** Maximum number of scheduled queues to be supported.
*
* @see odp_schedule_capability_t
*/
uint32_t num_queues;

/** Maximum number of events required to be stored simultaneously in
* scheduled queue. This number must not exceed 'max_queue_size'
* capability. A value of 0 configures default queue size supported by
* the implementation.
*/
uint32_t queue_size;

} odp_schedule_config_t;

/**
* @}
*/
Expand Down

0 comments on commit c3e88f4

Please sign in to comment.