2023-08-28 12:31:18 +02:00
|
|
|
/* Linux specific real-time optimizations
|
2018-08-22 11:29:39 +02:00
|
|
|
*
|
|
|
|
* @see: https://wiki.linuxfoundation.org/realtime/documentation/howto/applications/application_base
|
|
|
|
* @file
|
2022-12-14 17:39:07 +01:00
|
|
|
* @author Steffen Vogel <post@steffenvogel.de>
|
2022-03-15 09:05:42 -04:00
|
|
|
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
2022-05-19 17:40:10 +02:00
|
|
|
* @license Apache License 2.0
|
2023-08-28 12:31:18 +02:00
|
|
|
*/
|
2018-08-22 11:29:39 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-09-13 08:35:27 +02:00
|
|
|
#include <pthread.h>
|
|
|
|
|
2018-08-27 11:12:40 +02:00
|
|
|
namespace villas {
|
|
|
|
namespace kernel {
|
|
|
|
namespace rt {
|
2018-08-22 11:29:39 +02:00
|
|
|
|
2019-02-12 17:28:37 +01:00
|
|
|
void init(int priority, int affinity);
|
2018-08-22 11:29:39 +02:00
|
|
|
|
2020-09-13 08:35:27 +02:00
|
|
|
void setProcessAffinity(int affinity);
|
|
|
|
void setThreadAffinity(pthread_t thread, int affinity);
|
2018-08-22 11:29:39 +02:00
|
|
|
|
2019-02-12 17:28:37 +01:00
|
|
|
void setPriority(int priority);
|
2018-08-22 11:29:39 +02:00
|
|
|
|
2022-12-21 09:56:04 +01:00
|
|
|
// Checks for realtime (PREEMPT_RT) patched kernel.
|
|
|
|
//
|
|
|
|
// See https://rt.wiki.kernel.org
|
|
|
|
//
|
|
|
|
// @retval true Kernel is patched.
|
|
|
|
// @retval false Kernel is not patched.
|
2019-02-12 17:28:37 +01:00
|
|
|
bool isPreemptible();
|
2018-08-22 11:29:39 +02:00
|
|
|
|
2022-12-02 17:16:44 +01:00
|
|
|
} // namespace villas
|
|
|
|
} // namespace kernel
|
|
|
|
} // namespace rt
|