kernel: POSIX: Compatibility layer for scheduler APIs.

This patch provides scheduler APIs for POSIX 1003.1 PSE52 standard.

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
This commit is contained in:
Youvedeep Singh 2018-01-13 18:51:15 +05:30 committed by Anas Nashif
commit 7eabf1025c
6 changed files with 103 additions and 10 deletions

View file

@ -10,22 +10,34 @@
extern "C" {
#endif
#include_next <sched.h>
/* Cooperative scheduling policy */
#ifndef SCHED_FIFO
#define SCHED_FIFO 0
#endif /* SCHED_FIFO */
/* Priority based prempetive scheduling policy */
/* Priority based preemptive scheduling policy */
#ifndef SCHED_RR
#define SCHED_RR 1
#endif /* SCHED_RR */
struct sched_param {
int priority; /* Thread execution priority */
int priority;
};
/**
* @brief Yield the processor
*
* See IEEE 1003.1
*/
static inline int sched_yield(void)
{
k_yield();
return 0;
}
int sched_get_priority_min(int policy);
int sched_get_priority_max(int policy);
#ifdef __cplusplus
}
#endif

View file

@ -21,7 +21,7 @@ struct timespec {
#endif /* CONFIG_NEWLIB_LIBC */
#include "sys/types.h"
#include "sched.h"
#include "posix_sched.h"
enum pthread_state {
/* The thread is running and joinable. */