Loading...
Searching...
No Matches
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
27extern "C" {
28#endif
29
30#ifdef CPU_NATIVE
31#include <stdio.h>
32
33#if __GLIBC__
34/*
35 * Required to use some C++11 headers with g++ on the native board.
36 */
37#define __CPU_SETSIZE 1024
38#define __NCPUBITS (8 * sizeof(__cpu_mask))
39typedef unsigned long int __cpu_mask;
40typedef struct {
41 __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
42} cpu_set_t;
43#endif
44
48inline int sched_yield(void)
49{
50 puts("[ERROR] sched_yield called (defined in sched.h)\n");
51 return 0;
52}
53#else
60extern int sched_yield(void);
61#endif /* CPU_NATIVE */
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif /* NATIVE_SCHED_H */
int sched_yield(void)
Compilation with g++ may require the declaration of this function.
stdio wrapper to extend the C libs stdio