aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/abstractions
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-03-08 08:38:54 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-03-08 08:38:54 +0000
commit742a1d93c841fc87fd91ae4feca78a736e812388 (patch)
tree74f613fcca72475a65d2f0d2c83d3787e6d767b7 /os/common/abstractions
parentc3e44eb92936293097f1503e42ba6ccafaffac3d (diff)
downloadChibiOS-742a1d93c841fc87fd91ae4feca78a736e812388.tar.gz
ChibiOS-742a1d93c841fc87fd91ae4feca78a736e812388.tar.bz2
ChibiOS-742a1d93c841fc87fd91ae4feca78a736e812388.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9053 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/common/abstractions')
-rw-r--r--os/common/abstractions/nasa_osal/include/osapi-os-custom.h66
-rw-r--r--os/common/abstractions/nasa_osal/include/osapi.h1
-rw-r--r--os/common/abstractions/nasa_osal/src/osapi.c18
3 files changed, 84 insertions, 1 deletions
diff --git a/os/common/abstractions/nasa_osal/include/osapi-os-custom.h b/os/common/abstractions/nasa_osal/include/osapi-os-custom.h
new file mode 100644
index 000000000..f14c4fd33
--- /dev/null
+++ b/os/common/abstractions/nasa_osal/include/osapi-os-custom.h
@@ -0,0 +1,66 @@
+/*
+ ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+/**
+ * @file osapi-os-custom.h
+ * @brief Custom OSAPI extensions header.
+ *
+ * @addtogroup osapi-custom
+ * @{
+ */
+
+#ifndef _OSAPI_CUSTOM_H_
+#define _OSAPI_CUSTOM_H_
+
+/*===========================================================================*/
+/* Module constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module data structures and types. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ boolean OS_TaskDeleteCheck(void);
+#ifdef __cplusplus
+}
+#endif
+
+/*===========================================================================*/
+/* Module inline functions. */
+/*===========================================================================*/
+
+#endif /* _OSAPI_CUSTOM_H_ */
+
+/** @} */
diff --git a/os/common/abstractions/nasa_osal/include/osapi.h b/os/common/abstractions/nasa_osal/include/osapi.h
index 46f6dc031..72a7c340a 100644
--- a/os/common/abstractions/nasa_osal/include/osapi.h
+++ b/os/common/abstractions/nasa_osal/include/osapi.h
@@ -133,6 +133,7 @@
//#include "osapi-os-net.h"
//#include "osapi-os-loader.h"
#include "osapi-os-timer.h"
+#include "osapi-os-custom.h"
#ifdef __cplusplus
}
diff --git a/os/common/abstractions/nasa_osal/src/osapi.c b/os/common/abstractions/nasa_osal/src/osapi.c
index c68154be3..aac0cf4bd 100644
--- a/os/common/abstractions/nasa_osal/src/osapi.c
+++ b/os/common/abstractions/nasa_osal/src/osapi.c
@@ -1778,9 +1778,25 @@ int32 OS_TaskInstallDeleteHandler(void *function_pointer) {
}
/**
+ * @brief Check for task termination request.
+ * @note This is a ChibiOS/RT extension, direct task delete is not
+ * allowed in RT.
+ *
+ * @return The termination request flag.
+ * @retval false if termination has not been requested.
+ * @retval true if termination has been requested.
+ *
+ * @api
+ */
+boolean OS_TaskDeleteCheck(void) {
+
+ return (boolean)chThdShouldTerminateX();
+}
+
+/**
* @brief Task delete.
* @note Limitation, it does not actually kill the thread, it just sets a
- * flag in the thread that has then to terminate volountarly. The
+ * flag in the thread that has then to terminate voluntarily. The
* flag can be checked using @p chThdShouldTerminateX().
*
* @param[in] task_id the task id