From a1435e018bfc9919cb76b1356509ecc883767fb4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 10 Aug 2013 14:51:16 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6123 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/ch.h | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 os/rt/include/ch.h (limited to 'os/rt/include/ch.h') diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h new file mode 100644 index 000000000..6af6b8d4d --- /dev/null +++ b/os/rt/include/ch.h @@ -0,0 +1,137 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 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 . +*/ + +/** + * @file ch.h + * @brief ChibiOS/RT main include file. + * @details This header includes all the required kernel headers so it is the + * only kernel header you usually want to include in your application. + * + * @addtogroup kernel_info + * @details Kernel related info. + * @{ + */ + +#ifndef _CH_H_ +#define _CH_H_ + +/** + * @brief ChibiOS/RT identification macro. + */ +#define _CHIBIOS_RT_ + +/** + * @brief Kernel version string. + */ +#define CH_KERNEL_VERSION "3.0.0dev" + +/** + * @name Kernel version + * @{ + */ +/** + * @brief Kernel version major number. + */ +#define CH_KERNEL_MAJOR 3 + +/** + * @brief Kernel version minor number. + */ +#define CH_KERNEL_MINOR 0 + +/** + * @brief Kernel version patch number. + */ +#define CH_KERNEL_PATCH 0 +/** @} */ + +/** + * @name Common constants + */ +/** + * @brief Generic 'false' boolean constant. + */ +#if !defined(FALSE) || defined(__DOXYGEN__) +#define FALSE 0 +#endif + +/** + * @brief Generic 'true' boolean constant. + */ +#if !defined(TRUE) || defined(__DOXYGEN__) +#define TRUE (!FALSE) +#endif + +/** + * @brief Generic success constant. + * @details This constant is functionally equivalent to @p false but more + * readable, it can be used as return value of all those functions + * returning a @p bool as a status indicator. + */ +#if !defined(CH_SUCCESS) || defined(__DOXYGEN__) +#define CH_SUCCESS false +#endif + +/** + * @brief Generic failure constant. + * @details This constant is functionally equivalent to @p true but more + * readable, it can be used as return value of all those functions + * returning a @p bool as a status indicator. + */ +#if !defined(CH_FAILED) || defined(__DOXYGEN__) +#define CH_FAILED true +#endif +/** @} */ + +/* Forward declarations.*/ +typedef struct thread thread_t; +typedef struct virtual_timer virtual_timer_t; + +/* Inclusion of all the kernel sub-headers.*/ +#include "chconf.h" +#include "chtypes.h" +#include "chdebug.h" +#include "chcore.h" +#include "chtm.h" +#include "chstats.h" +#include "chsys.h" +#include "chglobal.h" +#include "chvt.h" +#include "chthreads.h" +#include "chlists.h" +#include "chschd.h" +#include "chregistry.h" +#include "chsem.h" +#include "chbsem.h" +#include "chmtx.h" +#include "chcond.h" +#include "chevents.h" +#include "chmsg.h" +#include "chmboxes.h" +#include "chmemcore.h" +#include "chheap.h" +#include "chmempools.h" +#include "chdynamic.h" +#include "chqueues.h" +#include "chstreams.h" + +#endif /* _CH_H_ */ + +/** @} */ -- cgit v1.2.3 From bfa3ba9f00d263a15d6d6b2dec2aa0b81058df27 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 16 Aug 2013 17:41:56 +0000 Subject: Turned more macros in inline functions. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6166 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/ch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/rt/include/ch.h') diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h index 6af6b8d4d..3e3b90983 100644 --- a/os/rt/include/ch.h +++ b/os/rt/include/ch.h @@ -114,9 +114,9 @@ typedef struct virtual_timer virtual_timer_t; #include "chsys.h" #include "chglobal.h" #include "chvt.h" -#include "chthreads.h" #include "chlists.h" #include "chschd.h" +#include "chthreads.h" #include "chregistry.h" #include "chsem.h" #include "chbsem.h" -- cgit v1.2.3 From 52e34df5767ed023955d295cc118d92bb42cff46 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 19 Aug 2013 14:26:38 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6181 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/ch.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'os/rt/include/ch.h') diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h index 3e3b90983..c2c486c0f 100644 --- a/os/rt/include/ch.h +++ b/os/rt/include/ch.h @@ -104,6 +104,15 @@ typedef struct thread thread_t; typedef struct virtual_timer virtual_timer_t; +/* This function is special, it must be accessible from all modules.*/ +#ifdef __cplusplus +extern "C" { +#endif + void chSysHalt(const char *reason); +#ifdef __cplusplus +} +#endif + /* Inclusion of all the kernel sub-headers.*/ #include "chconf.h" #include "chtypes.h" -- cgit v1.2.3 From 9d0c6fb8bf7bf63c137d7c19fdefc7760d2f133a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 3 Sep 2013 08:48:20 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6250 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/ch.h | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) (limited to 'os/rt/include/ch.h') diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h index c2c486c0f..21c172ec9 100644 --- a/os/rt/include/ch.h +++ b/os/rt/include/ch.h @@ -62,44 +62,6 @@ #define CH_KERNEL_PATCH 0 /** @} */ -/** - * @name Common constants - */ -/** - * @brief Generic 'false' boolean constant. - */ -#if !defined(FALSE) || defined(__DOXYGEN__) -#define FALSE 0 -#endif - -/** - * @brief Generic 'true' boolean constant. - */ -#if !defined(TRUE) || defined(__DOXYGEN__) -#define TRUE (!FALSE) -#endif - -/** - * @brief Generic success constant. - * @details This constant is functionally equivalent to @p false but more - * readable, it can be used as return value of all those functions - * returning a @p bool as a status indicator. - */ -#if !defined(CH_SUCCESS) || defined(__DOXYGEN__) -#define CH_SUCCESS false -#endif - -/** - * @brief Generic failure constant. - * @details This constant is functionally equivalent to @p true but more - * readable, it can be used as return value of all those functions - * returning a @p bool as a status indicator. - */ -#if !defined(CH_FAILED) || defined(__DOXYGEN__) -#define CH_FAILED true -#endif -/** @} */ - /* Forward declarations.*/ typedef struct thread thread_t; typedef struct virtual_timer virtual_timer_t; @@ -114,10 +76,10 @@ extern "C" { #endif /* Inclusion of all the kernel sub-headers.*/ -#include "chconf.h" #include "chtypes.h" -#include "chdebug.h" +#include "chconf.h" #include "chcore.h" +#include "chdebug.h" #include "chtm.h" #include "chstats.h" #include "chsys.h" -- cgit v1.2.3 From 5a70ffdbf38323a58d2e1fa6289ad7caea1fe12a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 12 Nov 2013 11:05:57 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6464 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/ch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/rt/include/ch.h') diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h index 21c172ec9..e96bc797c 100644 --- a/os/rt/include/ch.h +++ b/os/rt/include/ch.h @@ -82,8 +82,8 @@ extern "C" { #include "chdebug.h" #include "chtm.h" #include "chstats.h" -#include "chsys.h" #include "chglobal.h" +#include "chsys.h" #include "chvt.h" #include "chlists.h" #include "chschd.h" -- cgit v1.2.3 From e86fc6ad21d12a2f87239fa953b2bb6ac3da28b5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 14 Nov 2013 10:22:19 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6472 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/ch.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'os/rt/include/ch.h') diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h index e96bc797c..c1360d4c4 100644 --- a/os/rt/include/ch.h +++ b/os/rt/include/ch.h @@ -66,15 +66,6 @@ typedef struct thread thread_t; typedef struct virtual_timer virtual_timer_t; -/* This function is special, it must be accessible from all modules.*/ -#ifdef __cplusplus -extern "C" { -#endif - void chSysHalt(const char *reason); -#ifdef __cplusplus -} -#endif - /* Inclusion of all the kernel sub-headers.*/ #include "chtypes.h" #include "chconf.h" @@ -82,11 +73,9 @@ extern "C" { #include "chdebug.h" #include "chtm.h" #include "chstats.h" -#include "chglobal.h" +#include "chschd.h" #include "chsys.h" #include "chvt.h" -#include "chlists.h" -#include "chschd.h" #include "chthreads.h" #include "chregistry.h" #include "chsem.h" -- cgit v1.2.3 From 1b6619e5ccd8ee5a28968c5e703b334ce3738d7a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 14 Nov 2013 11:01:51 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6474 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/ch.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'os/rt/include/ch.h') diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h index c1360d4c4..11c75c407 100644 --- a/os/rt/include/ch.h +++ b/os/rt/include/ch.h @@ -66,7 +66,7 @@ typedef struct thread thread_t; typedef struct virtual_timer virtual_timer_t; -/* Inclusion of all the kernel sub-headers.*/ +/* Core headers.*/ #include "chtypes.h" #include "chconf.h" #include "chcore.h" @@ -77,6 +77,8 @@ typedef struct virtual_timer virtual_timer_t; #include "chsys.h" #include "chvt.h" #include "chthreads.h" + +/* Optional subsystems headers.*/ #include "chregistry.h" #include "chsem.h" #include "chbsem.h" -- cgit v1.2.3 From cf957f9d4a54d49f66d9af4ee7c7b4bb90660409 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 6 Feb 2014 10:37:50 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6668 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/ch.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'os/rt/include/ch.h') diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h index 11c75c407..a8cc7ac81 100644 --- a/os/rt/include/ch.h +++ b/os/rt/include/ch.h @@ -62,10 +62,6 @@ #define CH_KERNEL_PATCH 0 /** @} */ -/* Forward declarations.*/ -typedef struct thread thread_t; -typedef struct virtual_timer virtual_timer_t; - /* Core headers.*/ #include "chtypes.h" #include "chconf.h" -- cgit v1.2.3 From 1d9041f77bc376c92b663bc69fb57ec855531039 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 8 Feb 2014 09:34:43 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6671 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/ch.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'os/rt/include/ch.h') diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h index a8cc7ac81..bd8fe92d3 100644 --- a/os/rt/include/ch.h +++ b/os/rt/include/ch.h @@ -62,6 +62,10 @@ #define CH_KERNEL_PATCH 0 /** @} */ +/* Required forward declaration, knowledge of this type is required by all + modules.*/ +typedef struct thread thread_t; + /* Core headers.*/ #include "chtypes.h" #include "chconf.h" -- cgit v1.2.3