The friendly Operating System for the Internet of Things
sched.h File Reference

Scheduler API definition. More...

Detailed Description

Kaspar Schleiser

Definition in file sched.h.

#include <stddef.h>
#include "kernel_defines.h"
#include "bitarithm.h"
#include "kernel_types.h"
#include "native_sched.h"
#include "clist.h"
+ Include dependency graph for sched.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define SCHED_PRIO_LEVELS   16
 The number of thread priority levels.


typedef struct _thread thread_t
 forward declaration for thread_t, defined in thread.h


int sched_run (void)
 Triggers the scheduler to schedule the next thread. More...
void sched_set_status (thread_t *process, unsigned int status)
 Set the status of the specified process. More...
void sched_switch (uint16_t other_prio)
 Yield if approriate. More...
NORETURN void cpu_switch_context_exit (void)
 Call context switching at thread exit.
NORETURN void sched_task_exit (void)
 Removes thread from scheduler and set status to STATUS_STOPPED.


volatile unsigned int sched_context_switch_request
 Flag indicating whether a context switch is necessary after handling an interrupt. More...
volatile thread_tsched_threads [KERNEL_PID_LAST+1]
 Thread table.
volatile thread_tsched_active_thread
 Currently active thread.
volatile int sched_num_threads
 Number of running (non-terminated) threads.
volatile kernel_pid_t sched_active_pid
 Process ID of active thread.
clist_node_t sched_runqueues [SCHED_PRIO_LEVELS]
 List of runqueues per priority level.