aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include/chdynamic.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-11-12 18:47:41 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-11-12 18:47:41 +0000
commite889040710fe8e5ee4454b01803d0c8522f489f0 (patch)
tree0ab29def1ed6bd4cf57ba901649a425c46586c4e /os/kernel/include/chdynamic.h
parent630bc516bf10c219d98d1c04466ce79de400d2ba (diff)
downloadChibiOS-e889040710fe8e5ee4454b01803d0c8522f489f0.tar.gz
ChibiOS-e889040710fe8e5ee4454b01803d0c8522f489f0.tar.bz2
ChibiOS-e889040710fe8e5ee4454b01803d0c8522f489f0.zip
Separated the dynamic threads code from the static threads code.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2349 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include/chdynamic.h')
-rw-r--r--os/kernel/include/chdynamic.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/os/kernel/include/chdynamic.h b/os/kernel/include/chdynamic.h
new file mode 100644
index 000000000..76de4ae09
--- /dev/null
+++ b/os/kernel/include/chdynamic.h
@@ -0,0 +1,67 @@
+/*
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+
+ This file is part of ChibiOS/RT.
+
+ ChibiOS/RT is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS/RT is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file chdynamic.h
+ * @brief Dynamic threads macros and structures.
+ *
+ * @addtogroup dynamic_threads
+ * @{
+ */
+
+#ifndef _CHDYNAMIC_H_
+#define _CHDYNAMIC_H_
+
+#if CH_USE_DYNAMIC || defined(__DOXYGEN__)
+
+/*
+ * Module dependencies check.
+ */
+#if CH_USE_DYNAMIC && !CH_USE_WAITEXIT
+#error "CH_USE_DYNAMIC requires CH_USE_WAITEXIT"
+#endif
+#if CH_USE_DYNAMIC && !CH_USE_HEAP && !CH_USE_MEMPOOLS
+#error "CH_USE_DYNAMIC requires CH_USE_HEAP and/or CH_USE_MEMPOOLS"
+#endif
+
+/*
+ * Dynamic threads APIs.
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+ Thread *chThdAddRef(Thread *tp);
+ void chThdRelease(Thread *tp);
+#if CH_USE_HEAP
+ Thread *chThdCreateFromHeap(MemoryHeap *heapp, size_t size,
+ tprio_t prio, tfunc_t pf, void *arg);
+#endif
+#if CH_USE_MEMPOOLS
+ Thread *chThdCreateFromMemoryPool(MemoryPool *mp, tprio_t prio,
+ tfunc_t pf, void *arg);
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CH_USE_DYNAMIC */
+
+#endif /* _CHDYNAMIC_H_ */
+
+/** @} */