1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/lpc1768/include/cpu.h
René Kijewski 677d690e2b core: introduce thread_yield_higher(), yield less
Fixes #1708.

Currently involuntary preemption causes the current thread not only to
yield for a higher prioritized thread, but all other threads of its own
priority class, too.

This PR adds the function `thread_yield_higher()`, which will yield the
current thread in favor of higher prioritized functions, but not for
threads of its own priority class.

Boards now need to implement `thread_yield_higher()` instead of
`thread_yield()`, but `COREIF_NG` boards are not affected in any way.

`thread_yield()` retains its old meaning: yield for every thread that
has the same or a higher priority.

This PR does not touch the occurrences of `thread_yield()` in the periph
drivers, because the author of this PR did not look into the logic of
the various driver implementations.
2014-10-24 00:09:56 +02:00

45 lines
814 B
C

/**
* Copyright (C) 2014 Oliver Hahm <oliver.hahm@inria.fr>
*
* 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.
*/
#ifndef CPU_H
#define CPU_H
/**
* @defgroup lpc1768 NXP LPC1768
* @brief NXP LPC1768 specific code
* @ingroup cpu
* @{
* @author Oliver Hahm <oliver.hahm@inria.fr>
*/
#include "LPC17xx.h"
#include "core_cm3.h"
#include "core_cmFunc.h"
extern void dINT(void);
extern void eINT(void);
/**
* @brief Save the thread's context
*/
void save_context(void);
/**
* @brief Restores the before saved context of a thread
*/
void restore_context(void);
/**
* @brief Let the scheduler yield
*/
void thread_yield_higher(void);
/** @} */
#endif /* CPU_H */