You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.1 KiB

* @ingroup kernel
* @{
* @file sched.h
* @author Freie Universität Berlin, Computer Systems & Telematics
* @author Kaspar Schleiser <>
#ifndef _SCHEDULER_H
#define _SCHEDULER_H
#include <stddef.h>
#include <bitarithm.h>
#include "tcb.h"
#define MAXTHREADS 32
#if ARCH_32_BIT
void sched_init(void);
void sched_run(void);
void sched_set_status(tcb_t *process, unsigned int status);
void sched_switch(uint16_t current_prio, uint16_t other_prio, int in_isr);
void cpu_switch_context_exit(void);
extern volatile unsigned int sched_context_switch_request;
extern volatile tcb_t *sched_threads[MAXTHREADS];
extern volatile tcb_t *active_thread;
extern volatile int num_tasks;
extern volatile int thread_pid;
typedef struct {
unsigned int laststart;
unsigned int schedules;
unsigned int runtime;
} schedstat;
extern schedstat pidlist[MAXTHREADS];
void sched_register_cb(void (*callback)(uint32_t, uint32_t));
/** @} */
#endif // _SCHEDULER_H