aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/templates
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 09:59:21 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 09:59:21 +0000
commit641f2c372605cf405f0dda8536b45a78e0e5e2e2 (patch)
treef120afff37ef959b367a6023749700d5b618beff /os/nil/templates
parent5e24a813bef8d7ac5ca79fe9079db0fc2d2bb8b2 (diff)
downloadChibiOS-641f2c372605cf405f0dda8536b45a78e0e5e2e2.tar.gz
ChibiOS-641f2c372605cf405f0dda8536b45a78e0e5e2e2.tar.bz2
ChibiOS-641f2c372605cf405f0dda8536b45a78e0e5e2e2.zip
Tree reorganization.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8899 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/nil/templates')
-rw-r--r--os/nil/templates/chconf.h (renamed from os/nil/templates/nilconf.h)137
-rw-r--r--os/nil/templates/nilcore.c54
-rw-r--r--os/nil/templates/nilcore.h379
-rw-r--r--os/nil/templates/nilcore_timer.h120
-rw-r--r--os/nil/templates/niltypes.h96
5 files changed, 116 insertions, 670 deletions
diff --git a/os/nil/templates/nilconf.h b/os/nil/templates/chconf.h
index c89fd61aa..234705f7e 100644
--- a/os/nil/templates/nilconf.h
+++ b/os/nil/templates/chconf.h
@@ -15,18 +15,20 @@
*/
/**
- * @file nilconf.h
+ * @file chconf.h
* @brief Configuration file template.
* @details A copy of this file must be placed in each project directory, it
* contains the application specific kernel settings.
*
- * @addtogroup NIL_CONFIG
+ * @addtogroup config
* @details Kernel related settings and hooks.
* @{
*/
-#ifndef _NILCONF_H_
-#define _NILCONF_H_
+#ifndef _CHCONF_H_
+#define _CHCONF_H_
+
+#define _CHIBIOS_NIL_CONF_
/*===========================================================================*/
/**
@@ -40,7 +42,7 @@
* @note This number is not inclusive of the idle thread which is
* Implicitly handled.
*/
-#define NIL_CFG_NUM_THREADS 1
+#define CH_CFG_NUM_THREADS 3
/** @} */
@@ -55,15 +57,15 @@
* @brief System time counter resolution.
* @note Allowed values are 16 or 32 bits.
*/
-#define NIL_CFG_ST_RESOLUTION 32
+#define CH_CFG_ST_RESOLUTION 32
/**
* @brief System tick frequency.
- * @note This value together with the @p NIL_CFG_ST_RESOLUTION
+ * @note This value together with the @p CH_CFG_ST_RESOLUTION
* option defines the maximum amount of time allowed for
* timeouts.
*/
-#define NIL_CFG_ST_FREQUENCY 50000
+#define CH_CFG_ST_FREQUENCY 1000
/**
* @brief Time delta constant for the tick-less mode.
@@ -73,7 +75,7 @@
* The value one is not valid, timeouts are rounded up to
* this value.
*/
-#define NIL_CFG_ST_TIMEDELTA 2
+#define CH_CFG_ST_TIMEDELTA 0
/** @} */
@@ -85,12 +87,79 @@
/*===========================================================================*/
/**
+ * @brief Semaphores APIs.
+ * @details If enabled then the Semaphores APIs are included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_SEMAPHORES TRUE
+
+/**
+ * @brief Mutexes APIs.
+ * @details If enabled then the mutexes APIs are included in the kernel.
+ *
+ * @note Feature not currently implemented.
+ * @note The default is @p FALSE.
+ */
+#define CH_CFG_USE_MUTEXES FALSE
+
+/**
* @brief Events Flags APIs.
* @details If enabled then the event flags APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
-#define NIL_CFG_USE_EVENTS TRUE
+#define CH_CFG_USE_EVENTS TRUE
+
+/**
+ * @brief Mailboxes APIs.
+ * @details If enabled then the asynchronous messages (mailboxes) APIs are
+ * included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ * @note Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_MAILBOXES TRUE
+
+/**
+ * @brief Core Memory Manager APIs.
+ * @details If enabled then the core memory manager APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMCORE TRUE
+
+/**
+ * @brief Heap Allocator APIs.
+ * @details If enabled then the memory heap allocator APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_HEAP TRUE
+
+/**
+ * @brief Memory Pools Allocator APIs.
+ * @details If enabled then the memory pools allocator APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMPOOLS TRUE
+
+/**
+ * @brief Managed RAM size.
+ * @details Size of the RAM area to be managed by the OS. If set to zero
+ * then the whole available RAM is used. The core memory is made
+ * available to the heap allocator and/or can be used directly through
+ * the simplified core memory allocator.
+ *
+ * @note In order to let the OS manage the whole RAM the linker script must
+ * provide the @p __heap_base__ and @p __heap_end__ symbols.
+ * @note Requires @p CH_CFG_USE_MEMCORE.
+ */
+#define CH_CFG_MEMCORE_SIZE 0
/** @} */
@@ -102,14 +171,40 @@
/*===========================================================================*/
/**
+ * @brief Debug option, kernel statistics.
+ *
+ * @note Feature not currently implemented.
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_STATISTICS FALSE
+
+/**
+ * @brief Debug option, system state check.
+ *
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_SYSTEM_STATE_CHECK TRUE
+
+/**
+ * @brief Debug option, parameters checks.
+ *
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_CHECKS TRUE
+
+/**
* @brief System assertions.
+ *
+ * @note The default is @p FALSE.
*/
-#define NIL_CFG_ENABLE_ASSERTS FALSE
+#define CH_DBG_ENABLE_ASSERTS TRUE
/**
* @brief Stack check.
+ *
+ * @note The default is @p FALSE.
*/
-#define NIL_CFG_ENABLE_STACK_CHECK FALSE
+#define CH_DBG_ENABLE_STACK_CHECK TRUE
/** @} */
@@ -123,8 +218,8 @@
/**
* @brief System initialization hook.
*/
-#if !defined(NIL_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__)
-#define NIL_CFG_SYSTEM_INIT_HOOK() { \
+#if !defined(CH_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__)
+#define CH_CFG_SYSTEM_INIT_HOOK() { \
}
#endif
@@ -132,13 +227,13 @@
* @brief Threads descriptor structure extension.
* @details User fields added to the end of the @p thread_t structure.
*/
-#define NIL_CFG_THREAD_EXT_FIELDS \
+#define CH_CFG_THREAD_EXT_FIELDS \
/* Add threads custom fields here.*/
/**
* @brief Threads initialization hook.
*/
-#define NIL_CFG_THREAD_EXT_INIT_HOOK(tr) { \
+#define CH_CFG_THREAD_EXT_INIT_HOOK(tr) { \
/* Add custom threads initialization code here.*/ \
}
@@ -148,7 +243,7 @@
* should be invoked from here.
* @note This macro can be used to activate a power saving mode.
*/
-#define NIL_CFG_IDLE_ENTER_HOOK() { \
+#define CH_CFG_IDLE_ENTER_HOOK() { \
}
/**
@@ -157,14 +252,14 @@
* should be invoked from here.
* @note This macro can be used to deactivate a power saving mode.
*/
-#define NIL_CFG_IDLE_LEAVE_HOOK() { \
+#define CH_CFG_IDLE_LEAVE_HOOK() { \
}
/**
* @brief System halt hook.
*/
-#if !defined(NIL_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
-#define NIL_CFG_SYSTEM_HALT_HOOK(reason) { \
+#if !defined(CH_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
+#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
}
#endif
@@ -174,6 +269,6 @@
/* Port-specific settings (override port settings defaulted in nilcore.h). */
/*===========================================================================*/
-#endif /* _NILCONF_H_ */
+#endif /* _CHCONF_H_ */
/** @} */
diff --git a/os/nil/templates/nilcore.c b/os/nil/templates/nilcore.c
deleted file mode 100644
index 7bbb020fa..000000000
--- a/os/nil/templates/nilcore.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
-
- This file is part of ChibiOS.
-
- ChibiOS 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 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 templates/nilcore.c
- * @brief Port code.
- *
- * @addtogroup NIL_CORE
- * @{
- */
-
-#include "nil.h"
-
-/*===========================================================================*/
-/* Module local definitions. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module exported variables. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module local types. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module local variables. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module local functions. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module exported functions. */
-/*===========================================================================*/
-
-/** @} */
diff --git a/os/nil/templates/nilcore.h b/os/nil/templates/nilcore.h
deleted file mode 100644
index 1aad42ddc..000000000
--- a/os/nil/templates/nilcore.h
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
-
- This file is part of ChibiOS.
-
- ChibiOS 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 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 templates/nilcore.h
- * @brief Port macros and structures.
- *
- * @addtogroup NIL_CORE
- * @{
- */
-
-#ifndef _NILCORE_H_
-#define _NILCORE_H_
-
-/*===========================================================================*/
-/* Module constants. */
-/*===========================================================================*/
-
-/**
- * @name Architecture and Compiler
- * @{
- */
-/**
- * @brief Macro defining the port architecture.
- */
-#define PORT_ARCHITECTURE_XXX
-
-/**
- * @brief Name of the implemented architecture.
- */
-#define PORT_ARCHITECTURE_NAME "XXX"
-
-/**
- * @brief Name of the architecture variant.
- */
-#define PORT_CORE_VARIANT_NAME "XXXX-Y"
-
-/**
- * @brief Compiler name and version.
- */
-#if defined(__GNUC__) || defined(__DOXYGEN__)
-#define PORT_COMPILER_NAME "GCC " __VERSION__
-
-#else
-#error "unsupported compiler"
-#endif
-
-/**
- * @brief Port-specific information string.
- */
-#define PORT_INFO "port description"
-
-/**
- * @brief This port supports a realtime counter.
- */
-#define PORT_SUPPORTS_RT FALSE
-/** @} */
-
-/*===========================================================================*/
-/* Module pre-compile time settings. */
-/*===========================================================================*/
-
-/**
- * @brief Per-thread stack overhead for interrupts servicing.
- * @details This constant is used in the calculation of the correct working
- * area size.
- */
-#if !defined(PORT_INT_REQUIRED_STACK) || defined(__DOXYGEN__)
-#define PORT_INT_REQUIRED_STACK 32
-#endif
-
-/**
- * @brief Enables an alternative timer implementation.
- * @details Usually the port uses a timer interface defined in the file
- * @p nilcore_timer.h, if this option is enabled then the file
- * @p nilcore_timer_alt.h is included instead.
- */
-#if !defined(PORT_USE_ALT_TIMER)
-#define PORT_USE_ALT_TIMER FALSE
-#endif
-
-/*===========================================================================*/
-/* Derived constants and error checks. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module data structures and types. */
-/*===========================================================================*/
-
-/* The following code is not processed when the file is included from an
- asm module.*/
-#if !defined(_FROM_ASM_)
-
-/**
- * @brief Type of stack and memory alignment enforcement.
- */
-typedef uint64_t stkalign_t;
-
-/**
- * @brief Interrupt saved context.
- * @details This structure represents the stack frame saved during a
- * preemption-capable interrupt handler.
- */
-struct port_extctx {
- uint32_t reg1;
- uint32_t reg2;
-};
-
-/**
- * @brief System saved context.
- * @details This structure represents the inner stack frame during a context
- * switch.
- */
-struct port_intctx {
- uint32_t reg3;
- uint32_t reg4;
-};
-
-#endif /* !defined(_FROM_ASM_) */
-
-/*===========================================================================*/
-/* Module macros. */
-/*===========================================================================*/
-
-/**
- * @brief Platform dependent thread stack setup.
- * @details This code usually setup the context switching frame represented
- * by an @p port_intctx structure.
- */
-#define PORT_SETUP_CONTEXT(tp, wend, pf, arg) do { \
- (void)(tp); \
- (void)(wend); \
- (void)(pf); \
- (void)(arg); \
-} while (false)
-
-/**
- * @brief Computes the thread working area global size.
- * @note There is no need to perform alignments in this macro.
- */
-#define PORT_WA_SIZE(n) (sizeof(struct port_intctx) + \
- sizeof(struct port_extctx) + \
- (size_t)(n) + \
- (size_t)(PORT_INT_REQUIRED_STACK))
-
-/**
- * @brief Priority level verification macro.
- */
-#define PORT_IRQ_IS_VALID_PRIORITY(n) false
-
-/**
- * @brief Priority level verification macro.
- */
-#define PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) false
-
-/**
- * @brief IRQ prologue code.
- * @details This macro must be inserted at the start of all IRQ handlers
- * enabled to invoke system APIs.
- */
-#define PORT_IRQ_PROLOGUE()
-
-/**
- * @brief IRQ epilogue code.
- * @details This macro must be inserted at the end of all IRQ handlers
- * enabled to invoke system APIs.
- */
-#define PORT_IRQ_EPILOGUE() _port_irq_epilogue()
-
-/**
- * @brief IRQ handler function declaration.
- * @note @p id can be a function name or a vector number depending on the
- * port implementation.
- */
-#define PORT_IRQ_HANDLER(id) void id(void)
-
-/**
- * @brief Fast IRQ handler function declaration.
- * @note @p id can be a function name or a vector number depending on the
- * port implementation.
- */
-#define PORT_FAST_IRQ_HANDLER(id) void id(void)
-
-/**
- * @brief Performs a context switch between two threads.
- * @details This is the most critical code in any port, this function
- * is responsible for the context switch between 2 threads.
- * @note The implementation of this code affects <b>directly</b> the context
- * switch performance so optimize here as much as you can.
- *
- * @param[in] ntp the thread to be switched in
- * @param[in] otp the thread to be switched out
- */
-#define port_switch(ntp, otp) do { \
- (void)ntp; \
- (void)otp; \
- /*_port_switch(ntp, otp)*/ \
-} while (false)
-
-/*===========================================================================*/
-/* External declarations. */
-/*===========================================================================*/
-
-/* The following code is not processed when the file is included from an
- asm module.*/
-#if !defined(_FROM_ASM_)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
- void _port_irq_epilogue(void);
- void _port_switch(thread_t *ntp, thread_t *otp);
- void _port_thread_start(void);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(_FROM_ASM_) */
-
-/*===========================================================================*/
-/* Module inline functions. */
-/*===========================================================================*/
-
-/* The following code is not processed when the file is included from an
- asm module.*/
-#if !defined(_FROM_ASM_)
-
-/**
- * @brief Port-related initialization code.
- */
-static inline void port_init(void) {
-
-}
-
-/**
- * @brief Returns a word encoding the current interrupts status.
- *
- * @return The interrupts status.
- */
-static inline syssts_t port_get_irq_status(void) {
-
- return (syssts_t)0;
-}
-
-/**
- * @brief Checks the interrupt status.
- *
- * @param[in] sts the interrupt status word
- *
- * @return The interrupt status.
- * @retval false the word specified a disabled interrupts status.
- * @retval true the word specified an enabled interrupts status.
- */
-static inline bool port_irq_enabled(syssts_t sts) {
-
- (void)sts;
-
- return false;
-}
-
-/**
- * @brief Determines the current execution context.
- *
- * @return The execution context.
- * @retval false not running in ISR mode.
- * @retval true running in ISR mode.
- */
-static inline bool port_is_isr_context(void) {
-
- return false;
-}
-
-/**
- * @brief Kernel-lock action.
- */
-static inline void port_lock(void) {
-
-}
-
-/**
- * @brief Kernel-unlock action.
- */
-static inline void port_unlock(void) {
-
-}
-
-/**
- * @brief Kernel-lock action from an interrupt handler.
- */
-static inline void port_lock_from_isr(void) {
-
-}
-
-/**
- * @brief Kernel-unlock action from an interrupt handler.
- */
-static inline void port_unlock_from_isr(void) {
-
-}
-
-/**
- * @brief Disables all the interrupt sources.
- */
-static inline void port_disable(void) {
-
-}
-
-/**
- * @brief Disables the interrupt sources below kernel-level priority.
- */
-static inline void port_suspend(void) {
-
-}
-
-/**
- * @brief Enables all the interrupt sources.
- */
-static inline void port_enable(void) {
-
-}
-
-/**
- * @brief Enters an architecture-dependent IRQ-waiting mode.
- * @details The function is meant to return when an interrupt becomes pending.
- * The simplest implementation is an empty function or macro but this
- * would not take advantage of architecture-specific power saving
- * modes.
- */
-static inline void port_wait_for_interrupt(void) {
-
-}
-
-/**
- * @brief Returns the current value of the realtime counter.
- *
- * @return The realtime counter value.
- */
-static inline rtcnt_t port_rt_get_counter_value(void) {
-
- return (rtcnt_t)0;
-}
-
-#endif /* !defined(_FROM_ASM_) */
-
-/*===========================================================================*/
-/* Module late inclusions. */
-/*===========================================================================*/
-
-#if !defined(_FROM_ASM_)
-
-#if NIL_CFG_ST_TIMEDELTA > 0
-#if PORT_USE_ALT_TIMER == FALSE
-#include "nilcore_timer.h"
-#else
-#include "nilcore_timer_alt.h"
-#endif
-#endif /* NIL_CFG_ST_TIMEDELTA > 0 */
-
-#endif /* !defined(_FROM_ASM_) */
-
-#endif /* _NILCORE_H_ */
-
-/** @} */
diff --git a/os/nil/templates/nilcore_timer.h b/os/nil/templates/nilcore_timer.h
deleted file mode 100644
index 6eab4dd40..000000000
--- a/os/nil/templates/nilcore_timer.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
-
- This file is part of ChibiOS.
-
- ChibiOS 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 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 templates/nilcore_timer.h
- * @brief System timer header file.
- *
- * @addtogroup NIL_TIMER
- * @{
- */
-
-#ifndef _NILCORE_TIMER_H_
-#define _NILCORE_TIMER_H_
-
-/*===========================================================================*/
-/* Module constants. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module pre-compile time settings. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Derived constants and error checks. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module data structures and types. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module macros. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* External declarations. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module inline functions. */
-/*===========================================================================*/
-
-/**
- * @brief Starts the alarm.
- * @note Makes sure that no spurious alarms are triggered after
- * this call.
- *
- * @param[in] abstime the time to be set for the first alarm
- *
- * @notapi
- */
-static inline void port_timer_start_alarm(systime_t abstime) {
-
- (void)abstime;
-}
-
-/**
- * @brief Stops the alarm interrupt.
- *
- * @notapi
- */
-static inline void port_timer_stop_alarm(void) {
-
-}
-
-/**
- * @brief Sets the alarm time.
- *
- * @param[in] abstime the time to be set for the next alarm
- *
- * @notapi
- */
-static inline void port_timer_set_alarm(systime_t abstime) {
-
- (void)abstime;
-}
-
-/**
- * @brief Returns the system time.
- *
- * @return The system time.
- *
- * @notapi
- */
-static inline systime_t port_timer_get_time(void) {
-
- return (systime_t)0;
-}
-
-/**
- * @brief Returns the current alarm time.
- *
- * @return The currently set alarm time.
- *
- * @notapi
- */
-static inline systime_t port_timer_get_alarm(void) {
-
- return (systime_t)0;
-}
-
-#endif /* _NILCORE_TIMER_H_ */
-
-/** @} */
diff --git a/os/nil/templates/niltypes.h b/os/nil/templates/niltypes.h
deleted file mode 100644
index 16043831b..000000000
--- a/os/nil/templates/niltypes.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
-
- This file is part of ChibiOS.
-
- ChibiOS 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 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 templates/niltypes.h
- * @brief Port system types.
- *
- * @addtogroup NIL_TYPES
- * @{
- */
-
-#ifndef _NILTYPES_H_
-#define _NILTYPES_H_
-
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
-
-/**
- * @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 1
-#endif
-/** @} */
-
-typedef uint32_t syssts_t; /**< System status word. */
-typedef uint32_t rtcnt_t; /**< Realtime counter. */
-typedef uint8_t tstate_t; /**< Thread state. */
-typedef int32_t msg_t; /**< Inter-thread message. */
-typedef uint32_t eventmask_t; /**< Mask of event identifiers. */
-typedef int32_t cnt_t; /**< Generic signed counter. */
-typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
-
-/**
- * @brief Type of system time.
- */
-#if (NIL_CFG_ST_RESOLUTION == 32) || defined(__DOXYGEN__)
-typedef uint32_t systime_t;
-#else
-typedef uint16_t systime_t;
-#endif
-
-/**
- * @brief ROM constant modifier.
- * @note It is set to use the "const" keyword in this port.
- */
-#define ROMCONST const
-
-/**
- * @brief Makes functions not inlineable.
- * @note If the compiler does not support such attribute then the
- * realtime counter precision could be degraded.
- */
-#define NOINLINE __attribute__((noinline))
-
-/**
- * @brief Optimized thread function declaration macro.
- */
-#define PORT_THD_FUNCTION(tname, arg) \
- __attribute__((noreturn)) void tname(void *arg)
-
-/**
- * @brief Packed variable specifier.
- */
-#define PACKED_VAR __attribute__((packed))
-
-#endif /* _NILTYPES_H_ */
-
-/** @} */