SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
stk_newlib.h
Go to the documentation of this file.
1/*
2 * SuperTinyKernel(TM) RTOS: Lightweight High-Performance Deterministic C++ RTOS for Embedded Systems.
3 *
4 * Source: https://github.com/SuperTinyKernel-RTOS
5 *
6 * Copyright (c) 2022-2026 Neutron Code Limited <stk@neutroncode.com>. All Rights Reserved.
7 * License: MIT License, see LICENSE for a full text.
8 */
9
10#ifndef STK_NEWLIB_H_
11#define STK_NEWLIB_H_
12
13#include <sys/lock.h>
14
44
45#ifndef _RETARGETABLE_LOCKING
46 #error "stk_newlib.h: Newlib must be built with _RETARGETABLE_LOCKING (sys/lock.h does not expose _LOCK_T)"
47#endif
48
53#ifndef STK_NEWLIB_STATIC_LOCKS
54 #define STK_NEWLIB_STATIC_LOCKS 1
55#endif
56
64#ifndef STK_NEWLIB_MAX_LOCKS
65 #define STK_NEWLIB_MAX_LOCKS 8U
66#endif
67
68#ifdef __cplusplus
69extern "C" {
70#endif
71
75void __retarget_lock_init(_LOCK_T *lock);
76
80void __retarget_lock_init_recursive(_LOCK_T *lock);
81
85void __retarget_lock_close(_LOCK_T lock);
86
90void __retarget_lock_close_recursive(_LOCK_T lock);
91
95void __retarget_lock_acquire(_LOCK_T lock);
96
100void __retarget_lock_acquire_recursive(_LOCK_T lock);
101
106int __retarget_lock_try_acquire(_LOCK_T lock);
107
113
117void __retarget_lock_release(_LOCK_T lock);
118
122void __retarget_lock_release_recursive(_LOCK_T lock);
123
124#ifdef __cplusplus
125}
126#endif
127
128#endif /* STK_NEWLIB_H_ */
void __retarget_lock_acquire(_LOCK_T lock)
Acquire lock immediately after the lock object is available.
int __retarget_lock_try_acquire_recursive(_LOCK_T lock)
Acquire recursive lock if the lock object is available.
void __retarget_lock_release_recursive(_LOCK_T lock)
Relinquish the recursive lock ownership.
void __retarget_lock_acquire_recursive(_LOCK_T lock)
Acquire recursive lock immediately after the lock object is available.
void __retarget_lock_init_recursive(_LOCK_T *lock)
Allocate recursive lock related resources.
void __retarget_lock_close(_LOCK_T lock)
Free lock related resources.
void __retarget_lock_init(_LOCK_T *lock)
Allocate lock related resources.
void __retarget_lock_release(_LOCK_T lock)
Relinquish the lock ownership.
int __retarget_lock_try_acquire(_LOCK_T lock)
Acquire lock if the lock object is available.
void __retarget_lock_close_recursive(_LOCK_T lock)
Free recursive lock related resources.