2015-03-03 19:34:12 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 HAW Hamburg
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2019-07-06 22:42:41 +02:00
|
|
|
* @defgroup core_sched_native Scheduler for native
|
|
|
|
* @ingroup core_sched
|
|
|
|
* @brief The RIOT scheduler for the native platform
|
2015-03-03 19:34:12 +01:00
|
|
|
* @details
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*
|
2015-05-22 07:34:41 +02:00
|
|
|
* @file
|
2015-03-03 19:34:12 +01:00
|
|
|
* @brief Add definitions required on the native board
|
|
|
|
*
|
|
|
|
* @author Raphael Hiesgen <raphael.hiesgen@haw-hamburg.de>
|
|
|
|
*/
|
|
|
|
|
2017-05-23 18:19:52 +02:00
|
|
|
#ifndef NATIVE_SCHED_H
|
|
|
|
#define NATIVE_SCHED_H
|
2015-03-03 19:34:12 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef BOARD_NATIVE
|
|
|
|
#include <stdio.h>
|
2015-12-02 11:11:00 +01:00
|
|
|
|
2015-03-03 19:34:12 +01:00
|
|
|
/*
|
|
|
|
* Required to use some C++11 headers with g++ on the native board.
|
|
|
|
*/
|
|
|
|
#define __CPU_SETSIZE 1024
|
2020-03-30 17:02:08 +02:00
|
|
|
#define __NCPUBITS (8 * sizeof(__cpu_mask))
|
2015-03-03 19:34:12 +01:00
|
|
|
typedef unsigned long int __cpu_mask;
|
|
|
|
typedef struct {
|
|
|
|
__cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
|
|
|
|
} cpu_set_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief In all test the function has never been called, hence it is empty for now.
|
|
|
|
*/
|
|
|
|
inline int sched_yield(void)
|
|
|
|
{
|
|
|
|
puts("[ERROR] sched_yield called (defined in sched.h)\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2018-07-10 02:19:55 +02:00
|
|
|
#else
|
|
|
|
/**
|
|
|
|
* @brief Compilation with g++ may require the declaration of this function.
|
|
|
|
*
|
|
|
|
* If implementation of this function is required, it can be realized in
|
|
|
|
* thread_arch.c.
|
|
|
|
*/
|
|
|
|
extern int sched_yield(void);
|
2015-12-02 11:11:00 +01:00
|
|
|
#endif /* BOARD_NATIVE */
|
2015-03-03 19:34:12 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-05-23 18:19:52 +02:00
|
|
|
#endif /* NATIVE_SCHED_H */
|
2015-12-02 11:11:00 +01:00
|
|
|
/** @} */
|