git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14467 27425a3e-05d8-49a3-a47f-9c15f0e5edd8

This commit is contained in:
Giovanni Di Sirio 2021-06-04 14:10:54 +00:00
parent 16c999235d
commit be70523cc5
15 changed files with 206 additions and 195 deletions

View File

@ -213,12 +213,6 @@
asm module.*/ asm module.*/
#if !defined(_FROM_ASM_) #if !defined(_FROM_ASM_)
/**
* @brief Type of stack and memory alignment enforcement.
* @note In this architecture the stack alignment is enforced to 64 bits.
*/
typedef uint64_t stkalign_t;
/** /**
* @brief Generic ARM register. * @brief Generic ARM register.
*/ */
@ -283,6 +277,11 @@ struct port_context {
*/ */
#define PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) false #define PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) false
/**
* @brief Optimized thread function declaration macro.
*/
#define PORT_THD_FUNCTION(tname, arg) void tname(void *arg)
/** /**
* @brief Platform dependent part of the @p chThdCreateI() API. * @brief Platform dependent part of the @p chThdCreateI() API.
* @details This code usually setup the context switching frame represented * @details This code usually setup the context switching frame represented

View File

@ -21,7 +21,7 @@
* @file ARM/compilers/GCC/chcoreasm.S * @file ARM/compilers/GCC/chcoreasm.S
* @brief ARM architecture port low level code. * @brief ARM architecture port low level code.
* *
* @addtogroup ARM_CORE * @addtogroup ARM_GCC_CORE
* @{ * @{
*/ */

View File

@ -32,83 +32,74 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
/** #include "ccportab.h"
* @name Common constants
*/
/**
* @brief Generic 'false' boolean constant.
*/
#if !defined(FALSE) || defined(__DOXYGEN__)
#define FALSE 0
#endif
/** /**
* @brief Generic 'true' boolean constant. * @name Architecture data constraints
*/ */
#if !defined(TRUE) || defined(__DOXYGEN__) #define PORT_ARCH_SIZEOF_DATA_PTR 4
#define TRUE 1 #define PORT_ARCH_SIZEOF_CODE_PTR 4
#endif #define PORT_ARCH_REGISTERS_WIDTH 32
#define PORT_ARCH_REVERSE_ORDER 1
/** @} */ /** @} */
/** /**
* @name Kernel types * @name Port types
* @{ * @{
*/ */
typedef uint32_t rtcnt_t; /**< Realtime counter. */ /**
typedef uint64_t rttime_t; /**< Realtime accumulator. */ * @brief Realtime counter.
typedef uint32_t syssts_t; /**< System status word. */ */
typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint32_t port_rtcnt_t;
typedef uint8_t tstate_t; /**< Thread state. */
typedef uint8_t trefs_t; /**< Thread references counter. */ /**
typedef uint8_t tslices_t; /**< Thread time slices counter.*/ * @brief Realtime accumulator.
typedef uint32_t tprio_t; /**< Thread priority. */ */
typedef int32_t msg_t; /**< Inter-thread message. */ typedef uint64_t port_rttime_t;
typedef int32_t eventid_t; /**< Numeric event identifier. */
typedef uint32_t eventmask_t; /**< Mask of event identifiers. */ /**
typedef uint32_t eventflags_t; /**< Mask of event flags. */ * @brief System status word.
typedef int32_t cnt_t; /**< Generic signed counter. */ */
typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ typedef uint32_t port_syssts_t;
/**
* @brief Type of stack and memory alignment enforcement.
* @note In this architecture the stack alignment is enforced to 64 bits,
* 32 bits alignment is supported by hardware but deprecated by ARM,
* the implementation choice is to not offer the option.
*/
typedef uint64_t port_stkalign_t;
/** @} */ /** @} */
/**
* @brief This port does not define OS-related types.
*/
#define PORT_DOES_NOT_PROVIDE_TYPES
/** /**
* @brief ROM constant modifier. * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port. * @note It is set to use the "const" keyword in this port.
*/ */
#define ROMCONST const #define ROMCONST CC_ROMCONST
/** /**
* @brief Makes functions not inlineable. * @brief Makes functions not inlineable.
* @note If the compiler does not support such attribute then some * @note If the compiler does not support such attribute then some
* time-dependent services could be degraded. * time-dependent services could be degraded.
*/ */
#define NOINLINE __attribute__((noinline)) #define NOINLINE CC_NO_INLINE
/**
* @brief Optimized thread function declaration macro.
*/
#define PORT_THD_FUNCTION(tname, arg) void tname(void *arg)
/**
* @brief Packed variable specifier.
*/
#define PACKED_VAR __attribute__((packed))
/** /**
* @brief Memory alignment enforcement for variables. * @brief Memory alignment enforcement for variables.
*/ */
#define ALIGNED_VAR(n) __attribute__((aligned(n))) #define ALIGNED_VAR(n) CC_ALIGN_DATA(n)
/** /**
* @brief Size of a pointer. * @brief Size of a pointer.
* @note To be used where the sizeof operator cannot be used, preprocessor * @note To be used where the sizeof operator cannot be used, preprocessor
* expressions for example. * expressions for example.
*/ */
#define SIZEOF_PTR 4 #define SIZEOF_PTR PORT_ARCH_SIZEOF_DATA_PTR
/**
* @brief True if alignment is low-high in current architecture.
*/
#define REVERSE_ORDER 1
#endif /* CHTYPES_H */ #endif /* CHTYPES_H */

View File

@ -18,8 +18,8 @@
*/ */
/** /**
* @file ARMv6-M/chcore.c * @file ARMv6-M-RP2/chcore.c
* @brief ARMv6-M port code. * @brief ARMv6-M-RP2 port code.
* *
* @addtogroup ARMv6_M_RP2_CORE * @addtogroup ARMv6_M_RP2_CORE
* @{ * @{

View File

@ -18,8 +18,8 @@
*/ */
/** /**
* @file ARMv6-M/chcore.h * @file ARMv6-M-RP2/chcore.h
* @brief ARMv6-M port macros and structures. * @brief ARMv6-M-RP2 port macros and structures.
* *
* @addtogroup ARMv6_M_RP2_CORE * @addtogroup ARMv6_M_RP2_CORE
* @{ * @{
@ -295,14 +295,6 @@
asm module.*/ asm module.*/
#if !defined(_FROM_ASM_) #if !defined(_FROM_ASM_)
/**
* @brief Type of stack and memory alignment enforcement.
* @note In this architecture the stack alignment is enforced to 64 bits,
* 32 bits alignment is supported by hardware but deprecated by ARM,
* the implementation choice is to not offer the option.
*/
typedef uint64_t stkalign_t;
/** /**
* @brief Interrupt saved context. * @brief Interrupt saved context.
* @details This structure represents the stack frame saved during a * @details This structure represents the stack frame saved during a
@ -363,6 +355,11 @@ struct port_context {
#define PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) \ #define PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) \
(((n) >= CORTEX_MAX_KERNEL_PRIORITY) && ((n) < CORTEX_PRIORITY_LEVELS)) (((n) >= CORTEX_MAX_KERNEL_PRIORITY) && ((n) < CORTEX_PRIORITY_LEVELS))
/**
* @brief Optimized thread function declaration macro.
*/
#define PORT_THD_FUNCTION(tname, arg) void tname(void *arg)
/** /**
* @brief Platform dependent part of the @p chThdCreateI() API. * @brief Platform dependent part of the @p chThdCreateI() API.
* @details This code usually setup the context switching frame represented * @details This code usually setup the context switching frame represented

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* @file chcore_timer.h * @file ARMv6-M-RP2/chcore_timer.h
* @brief System timer header file. * @brief System timer header file.
* *
* @addtogroup ARMv6_M_RP2_TIMER * @addtogroup ARMv6_M_RP2_TIMER

View File

@ -18,10 +18,10 @@
*/ */
/** /**
* @file ARMv6-M/compilers/GCC/chcoreasm.S * @file ARMv6-M-RP2/compilers/GCC/chcoreasm.S
* @brief ARMv6-M port low level code. * @brief ARMv6-M-RP2 port low level code.
* *
* @addtogroup ARMv6_M_GCC_CORE * @addtogroup ARMv6_M_RP2_GCC_CORE
* @{ * @{
*/ */

View File

@ -18,8 +18,8 @@
*/ */
/** /**
* @file ARMCMx/compilers/GCC/chtypes.h * @file ARMv6-M-RP2/compilers/GCC/chtypes.h
* @brief ARM Cortex-Mx port system types. * @brief ARMv6-M port system types.
* *
* @addtogroup ARMv6_M_RP2_GCC_CORE * @addtogroup ARMv6_M_RP2_GCC_CORE
* @{ * @{
@ -32,65 +32,74 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "ccportab.h"
/** /**
* @name Kernel types * @name Architecture data constraints
*/
#define PORT_ARCH_SIZEOF_DATA_PTR 4
#define PORT_ARCH_SIZEOF_CODE_PTR 4
#define PORT_ARCH_REGISTERS_WIDTH 32
#define PORT_ARCH_REVERSE_ORDER 1
/** @} */
/**
* @name Port types
* @{ * @{
*/ */
typedef uint32_t rtcnt_t; /**< Realtime counter. */ /**
typedef uint64_t rttime_t; /**< Realtime accumulator. */ * @brief Realtime counter.
typedef uint32_t syssts_t; /**< System status word. */ */
typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint32_t port_rtcnt_t;
typedef uint8_t tstate_t; /**< Thread state. */
typedef uint8_t trefs_t; /**< Thread references counter. */ /**
typedef uint8_t tslices_t; /**< Thread time slices counter.*/ * @brief Realtime accumulator.
typedef uint32_t tprio_t; /**< Thread priority. */ */
typedef int32_t msg_t; /**< Inter-thread message. */ typedef uint64_t port_rttime_t;
typedef int32_t eventid_t; /**< Numeric event identifier. */
typedef uint32_t eventmask_t; /**< Mask of event identifiers. */ /**
typedef uint32_t eventflags_t; /**< Mask of event flags. */ * @brief System status word.
typedef int32_t cnt_t; /**< Generic signed counter. */ */
typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ typedef uint32_t port_syssts_t;
/**
* @brief Type of stack and memory alignment enforcement.
* @note In this architecture the stack alignment is enforced to 64 bits,
* 32 bits alignment is supported by hardware but deprecated by ARM,
* the implementation choice is to not offer the option.
*/
typedef uint64_t port_stkalign_t;
/** @} */ /** @} */
/**
* @brief This port does not define OS-related types.
*/
#define PORT_DOES_NOT_PROVIDE_TYPES
/** /**
* @brief ROM constant modifier. * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port. * @note It is set to use the "const" keyword in this port.
*/ */
#define ROMCONST const #define ROMCONST CC_ROMCONST
/** /**
* @brief Makes functions not inlineable. * @brief Makes functions not inlineable.
* @note If the compiler does not support such attribute then some * @note If the compiler does not support such attribute then some
* time-dependent services could be degraded. * time-dependent services could be degraded.
*/ */
#define NOINLINE __attribute__((noinline)) #define NOINLINE CC_NO_INLINE
/**
* @brief Optimized thread function declaration macro.
*/
#define PORT_THD_FUNCTION(tname, arg) void tname(void *arg)
/**
* @brief Packed variable specifier.
*/
#define PACKED_VAR __attribute__((packed))
/** /**
* @brief Memory alignment enforcement for variables. * @brief Memory alignment enforcement for variables.
*/ */
#define ALIGNED_VAR(n) __attribute__((aligned(n))) #define ALIGNED_VAR(n) CC_ALIGN_DATA(n)
/** /**
* @brief Size of a pointer. * @brief Size of a pointer.
* @note To be used where the sizeof operator cannot be used, preprocessor * @note To be used where the sizeof operator cannot be used, preprocessor
* expressions for example. * expressions for example.
*/ */
#define SIZEOF_PTR 4 #define SIZEOF_PTR PORT_ARCH_SIZEOF_DATA_PTR
/**
* @brief True if alignment is low-high in current architecture.
*/
#define REVERSE_ORDER 1
#endif /* CHTYPES_H */ #endif /* CHTYPES_H */

View File

@ -268,14 +268,6 @@
asm module.*/ asm module.*/
#if !defined(_FROM_ASM_) #if !defined(_FROM_ASM_)
/**
* @brief Type of stack and memory alignment enforcement.
* @note In this architecture the stack alignment is enforced to 64 bits,
* 32 bits alignment is supported by hardware but deprecated by ARM,
* the implementation choice is to not offer the option.
*/
typedef uint64_t stkalign_t;
/** /**
* @brief Interrupt saved context. * @brief Interrupt saved context.
* @details This structure represents the stack frame saved during a * @details This structure represents the stack frame saved during a
@ -336,6 +328,11 @@ struct port_context {
#define PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) \ #define PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) \
(((n) >= CORTEX_MAX_KERNEL_PRIORITY) && ((n) < CORTEX_PRIORITY_LEVELS)) (((n) >= CORTEX_MAX_KERNEL_PRIORITY) && ((n) < CORTEX_PRIORITY_LEVELS))
/**
* @brief Optimized thread function declaration macro.
*/
#define PORT_THD_FUNCTION(tname, arg) void tname(void *arg)
/** /**
* @brief Platform dependent part of the @p chThdCreateI() API. * @brief Platform dependent part of the @p chThdCreateI() API.
* @details This code usually setup the context switching frame represented * @details This code usually setup the context switching frame represented

View File

@ -18,8 +18,8 @@
*/ */
/** /**
* @file ARMCMx/compilers/GCC/chtypes.h * @file ARMv6-M/compilers/GCC/chtypes.h
* @brief ARM Cortex-Mx port system types. * @brief ARMv6-M port system types.
* *
* @addtogroup ARMv6_M_GCC_CORE * @addtogroup ARMv6_M_GCC_CORE
* @{ * @{
@ -32,65 +32,74 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "ccportab.h"
/** /**
* @name Kernel types * @name Architecture data constraints
*/
#define PORT_ARCH_SIZEOF_DATA_PTR 4
#define PORT_ARCH_SIZEOF_CODE_PTR 4
#define PORT_ARCH_REGISTERS_WIDTH 32
#define PORT_ARCH_REVERSE_ORDER 1
/** @} */
/**
* @name Port types
* @{ * @{
*/ */
typedef uint32_t rtcnt_t; /**< Realtime counter. */ /**
typedef uint64_t rttime_t; /**< Realtime accumulator. */ * @brief Realtime counter.
typedef uint32_t syssts_t; /**< System status word. */ */
typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint32_t port_rtcnt_t;
typedef uint8_t tstate_t; /**< Thread state. */
typedef uint8_t trefs_t; /**< Thread references counter. */ /**
typedef uint8_t tslices_t; /**< Thread time slices counter.*/ * @brief Realtime accumulator.
typedef uint32_t tprio_t; /**< Thread priority. */ */
typedef int32_t msg_t; /**< Inter-thread message. */ typedef uint64_t port_rttime_t;
typedef int32_t eventid_t; /**< Numeric event identifier. */
typedef uint32_t eventmask_t; /**< Mask of event identifiers. */ /**
typedef uint32_t eventflags_t; /**< Mask of event flags. */ * @brief System status word.
typedef int32_t cnt_t; /**< Generic signed counter. */ */
typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ typedef uint32_t port_syssts_t;
/**
* @brief Type of stack and memory alignment enforcement.
* @note In this architecture the stack alignment is enforced to 64 bits,
* 32 bits alignment is supported by hardware but deprecated by ARM,
* the implementation choice is to not offer the option.
*/
typedef uint64_t port_stkalign_t;
/** @} */ /** @} */
/**
* @brief This port does not define OS-related types.
*/
#define PORT_DOES_NOT_PROVIDE_TYPES
/** /**
* @brief ROM constant modifier. * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port. * @note It is set to use the "const" keyword in this port.
*/ */
#define ROMCONST const #define ROMCONST CC_ROMCONST
/** /**
* @brief Makes functions not inlineable. * @brief Makes functions not inlineable.
* @note If the compiler does not support such attribute then some * @note If the compiler does not support such attribute then some
* time-dependent services could be degraded. * time-dependent services could be degraded.
*/ */
#define NOINLINE __attribute__((noinline)) #define NOINLINE CC_NO_INLINE
/**
* @brief Optimized thread function declaration macro.
*/
#define PORT_THD_FUNCTION(tname, arg) void tname(void *arg)
/**
* @brief Packed variable specifier.
*/
#define PACKED_VAR __attribute__((packed))
/** /**
* @brief Memory alignment enforcement for variables. * @brief Memory alignment enforcement for variables.
*/ */
#define ALIGNED_VAR(n) __attribute__((aligned(n))) #define ALIGNED_VAR(n) CC_ALIGN_DATA(n)
/** /**
* @brief Size of a pointer. * @brief Size of a pointer.
* @note To be used where the sizeof operator cannot be used, preprocessor * @note To be used where the sizeof operator cannot be used, preprocessor
* expressions for example. * expressions for example.
*/ */
#define SIZEOF_PTR 4 #define SIZEOF_PTR PORT_ARCH_SIZEOF_DATA_PTR
/**
* @brief True if alignment is low-high in current architecture.
*/
#define REVERSE_ORDER 1
#endif /* CHTYPES_H */ #endif /* CHTYPES_H */

View File

@ -18,10 +18,10 @@
*/ */
/** /**
* @file chcore_timer.h * @file ARMv7-M/chcore_timer.h
* @brief System timer header file. * @brief System timer header file.
* *
* @addtogroup ARMCMx_TIMER * @addtogroup ARMv7_M_TIMER
* @{ * @{
*/ */

View File

@ -18,8 +18,8 @@
*/ */
/** /**
* @file ARMCMx/compilers/GCC/chtypes.h * @file ARMv7-M/compilers/GCC/chtypes.h
* @brief ARM Cortex-Mx port system types. * @brief ARMv7-M port system types.
* *
* @addtogroup ARMv7_M_GCC_CORE * @addtogroup ARMv7_M_GCC_CORE
* @{ * @{

View File

@ -15,10 +15,10 @@
*/ */
/** /**
* @file common/ARMCMx/mpu.h * @file ARMv7-M/mpu.h
* @brief Cortex-Mx MPU support macros and structures. * @brief ARMv7-M MPU support macros and structures.
* *
* @addtogroup COMMON_ARMCMx_MPU * @addtogroup ARMv7_M_MPU
* @{ * @{
*/ */

View File

@ -21,7 +21,7 @@
* @file chcore_timer.h * @file chcore_timer.h
* @brief System timer header file. * @brief System timer header file.
* *
* @addtogroup ARMCMx_TIMER * @addtogroup ARMv8_M_ML_TIMER
* @{ * @{
*/ */

View File

@ -18,10 +18,10 @@
*/ */
/** /**
* @file ARMCMx/compilers/GCC/chtypes.h * @file ARMv8-M-ML/compilers/GCC/chtypes.h
* @brief ARM Cortex-Mx port system types. * @brief ARMv8-M-ML port system types.
* *
* @addtogroup ARMCMx_GCC_CORE * @addtogroup ARMv8_M_ML_GCC_CORE
* @{ * @{
*/ */
@ -32,65 +32,74 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "ccportab.h"
/** /**
* @name Kernel types * @name Architecture data constraints
*/
#define PORT_ARCH_SIZEOF_DATA_PTR 4
#define PORT_ARCH_SIZEOF_CODE_PTR 4
#define PORT_ARCH_REGISTERS_WIDTH 32
#define PORT_ARCH_REVERSE_ORDER 1
/** @} */
/**
* @name Port types
* @{ * @{
*/ */
typedef uint32_t rtcnt_t; /**< Realtime counter. */ /**
typedef uint64_t rttime_t; /**< Realtime accumulator. */ * @brief Realtime counter.
typedef uint32_t syssts_t; /**< System status word. */ */
typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint32_t port_rtcnt_t;
typedef uint8_t tstate_t; /**< Thread state. */
typedef uint8_t trefs_t; /**< Thread references counter. */ /**
typedef uint8_t tslices_t; /**< Thread time slices counter.*/ * @brief Realtime accumulator.
typedef uint32_t tprio_t; /**< Thread priority. */ */
typedef int32_t msg_t; /**< Inter-thread message. */ typedef uint64_t port_rttime_t;
typedef int32_t eventid_t; /**< Numeric event identifier. */
typedef uint32_t eventmask_t; /**< Mask of event identifiers. */ /**
typedef uint32_t eventflags_t; /**< Mask of event flags. */ * @brief System status word.
typedef int32_t cnt_t; /**< Generic signed counter. */ */
typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ typedef uint32_t port_syssts_t;
/**
* @brief Type of stack and memory alignment enforcement.
* @note In this architecture the stack alignment is enforced to 64 bits,
* 32 bits alignment is supported by hardware but deprecated by ARM,
* the implementation choice is to not offer the option.
*/
typedef uint64_t port_stkalign_t;
/** @} */ /** @} */
/**
* @brief This port does not define OS-related types.
*/
#define PORT_DOES_NOT_PROVIDE_TYPES
/** /**
* @brief ROM constant modifier. * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port. * @note It is set to use the "const" keyword in this port.
*/ */
#define ROMCONST const #define ROMCONST CC_ROMCONST
/** /**
* @brief Makes functions not inlineable. * @brief Makes functions not inlineable.
* @note If the compiler does not support such attribute then some * @note If the compiler does not support such attribute then some
* time-dependent services could be degraded. * time-dependent services could be degraded.
*/ */
#define NOINLINE __attribute__((noinline)) #define NOINLINE CC_NO_INLINE
/**
* @brief Optimized thread function declaration macro.
*/
#define PORT_THD_FUNCTION(tname, arg) void tname(void *arg)
/**
* @brief Packed variable specifier.
*/
#define PACKED_VAR __attribute__((packed))
/** /**
* @brief Memory alignment enforcement for variables. * @brief Memory alignment enforcement for variables.
*/ */
#define ALIGNED_VAR(n) __attribute__((aligned(n))) #define ALIGNED_VAR(n) CC_ALIGN_DATA(n)
/** /**
* @brief Size of a pointer. * @brief Size of a pointer.
* @note To be used where the sizeof operator cannot be used, preprocessor * @note To be used where the sizeof operator cannot be used, preprocessor
* expressions for example. * expressions for example.
*/ */
#define SIZEOF_PTR 4 #define SIZEOF_PTR PORT_ARCH_SIZEOF_DATA_PTR
/**
* @brief True if alignment is low-high in current architecture.
*/
#define REVERSE_ORDER 1
#endif /* CHTYPES_H */ #endif /* CHTYPES_H */