native_sched.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 HAW Hamburg
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
23 #ifndef NATIVE_SCHED_H
24 #define NATIVE_SCHED_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #ifdef BOARD_NATIVE
31 #include <stdio.h>
32 
33 /*
34  * Required to use some C++11 headers with g++ on the native board.
35  */
36 #define __CPU_SETSIZE 1024
37 #define __NCPUBITS (8 * sizeof(__cpu_mask))
38 typedef unsigned long int __cpu_mask;
39 typedef struct {
40  __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
41 } cpu_set_t;
42 
46 inline int sched_yield(void)
47 {
48  puts("[ERROR] sched_yield called (defined in sched.h)\n");
49  return 0;
50 }
51 #else
52 
58 extern int sched_yield(void);
59 #endif /* BOARD_NATIVE */
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif /* NATIVE_SCHED_H */
66 
sched_yield
int sched_yield(void)
Compilation with g++ may require the declaration of this function.