1 /* 2 * Copyright (c) 2018 Intel Corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #ifndef ZEPHYR_INCLUDE_POSIX_POSIX_SCHED_H_ 7 #define ZEPHYR_INCLUDE_POSIX_POSIX_SCHED_H_ 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /* Cooperative scheduling policy */ 14 #ifndef SCHED_FIFO 15 #define SCHED_FIFO 0 16 #endif /* SCHED_FIFO */ 17 18 /* Priority based preemptive scheduling policy */ 19 #ifndef SCHED_RR 20 #define SCHED_RR 1 21 #endif /* SCHED_RR */ 22 23 struct sched_param { 24 int sched_priority; 25 }; 26 27 /** 28 * @brief Yield the processor 29 * 30 * See IEEE 1003.1 31 */ sched_yield(void)32static inline int sched_yield(void) 33 { 34 k_yield(); 35 return 0; 36 } 37 38 int sched_get_priority_min(int policy); 39 int sched_get_priority_max(int policy); 40 41 #ifdef __cplusplus 42 } 43 #endif 44 45 #endif /* ZEPHYR_INCLUDE_POSIX_POSIX_SCHED_H_ */ 46