MOS Source Code
Loading...
Searching...
No Matches
scheduler.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
6
7typedef struct _scheduler_ops scheduler_ops_t;
8typedef struct _scheduler scheduler_t;
9
10typedef struct _scheduler_ops
11{
12 void (*init)(scheduler_t *instance);
13
18 thread_t *(*select_next)(scheduler_t *instance);
19 void (*add_thread)(scheduler_t *instance, thread_t *thread);
20 void (*remove_thread)(scheduler_t *instance, thread_t *thread);
22
23typedef struct _scheduler
24{
27
28typedef struct _scheduler_info
29{
30 const char *const name;
33
34#define MOS_SCHEDULER(_name, _i) MOS_PUT_IN_SECTION(".mos.schedulers", scheduler_info_t, MOS_CONCAT(_name, __COUNTER__), { .name = #_name, .scheduler = &_i })
MOSAPI void(1, 2) fatal_abort(const char *fmt
struct _scheduler_ops scheduler_ops_t
Definition scheduler.h:7
struct _scheduler scheduler_t
Definition scheduler.h:8
scheduler_t *const scheduler
Definition scheduler.h:31
const char *const name
Definition scheduler.h:30
const scheduler_ops_t * ops
Definition scheduler.h:25