diff options
author | Jacob Hansen <jacob.hansen@gaisler.com> | 2017-10-25 11:24:13 +0200 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2020-09-02 10:53:07 +0200 |
commit | f4032baf108ec6ad29f701917aa131470a72f23e (patch) | |
tree | e2da6f296f27a4bbe451d2e9d717bbf4d37d78ab | |
parent | 3662dc81f415a345718dc2e0c6c6bba83c8f0624 (diff) |
score: Un-constification of arguments to atomic_load
The C11 standard definition of atomic_load do not accept const pointers. This
appear to be a deficiency in the C11 standard. It looks like a fix is
underway/has applied as per:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_459.htm
While GCC do allow const pointers to atomic_load Clang does not. To
compile with Clang we therefore need to remove the const qualifiers.
-rw-r--r-- | cpukit/include/rtems/libio.h | 10 | ||||
-rw-r--r-- | cpukit/include/rtems/score/cpustdatomic.h | 6 | ||||
-rw-r--r-- | cpukit/include/rtems/score/smplockseq.h | 2 | ||||
-rw-r--r-- | cpukit/include/rtems/test.h | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/cpukit/include/rtems/libio.h b/cpukit/include/rtems/libio.h index f1c9eea51b..f5176ffb43 100644 --- a/cpukit/include/rtems/libio.h +++ b/cpukit/include/rtems/libio.h @@ -1375,7 +1375,7 @@ typedef struct { /** @} */ -static inline unsigned int rtems_libio_iop_flags( const rtems_libio_t *iop ) +static inline unsigned int rtems_libio_iop_flags( rtems_libio_t *iop ) { return _Atomic_Load_uint( &iop->flags, ATOMIC_ORDER_RELAXED ); } @@ -1385,7 +1385,7 @@ static inline unsigned int rtems_libio_iop_flags( const rtems_libio_t *iop ) * * @param[in] iop The iop. */ -static inline bool rtems_libio_iop_is_no_delay( const rtems_libio_t *iop ) +static inline bool rtems_libio_iop_is_no_delay( rtems_libio_t *iop ) { return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_NO_DELAY ) != 0; } @@ -1395,7 +1395,7 @@ static inline bool rtems_libio_iop_is_no_delay( const rtems_libio_t *iop ) * * @param[in] iop The iop. */ -static inline bool rtems_libio_iop_is_readable( const rtems_libio_t *iop ) +static inline bool rtems_libio_iop_is_readable( rtems_libio_t *iop ) { return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_READ ) != 0; } @@ -1405,7 +1405,7 @@ static inline bool rtems_libio_iop_is_readable( const rtems_libio_t *iop ) * * @param[in] iop The iop. */ -static inline bool rtems_libio_iop_is_writeable( const rtems_libio_t *iop ) +static inline bool rtems_libio_iop_is_writeable( rtems_libio_t *iop ) { return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_WRITE ) != 0; } @@ -1415,7 +1415,7 @@ static inline bool rtems_libio_iop_is_writeable( const rtems_libio_t *iop ) * * @param[in] iop The iop. */ -static inline bool rtems_libio_iop_is_append( const rtems_libio_t *iop ) +static inline bool rtems_libio_iop_is_append( rtems_libio_t *iop ) { return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_APPEND ) != 0; } diff --git a/cpukit/include/rtems/score/cpustdatomic.h b/cpukit/include/rtems/score/cpustdatomic.h index 31a17932c6..e71f0377f8 100644 --- a/cpukit/include/rtems/score/cpustdatomic.h +++ b/cpukit/include/rtems/score/cpustdatomic.h @@ -217,7 +217,7 @@ static inline void _CPU_atomic_Init_uintptr( CPU_atomic_Uintptr *obj, uintptr_t * * @return The value of @a obj considering the @a order. */ -static inline unsigned int _CPU_atomic_Load_uint( const CPU_atomic_Uint *obj, CPU_atomic_Order order ) +static inline unsigned int _CPU_atomic_Load_uint( CPU_atomic_Uint *obj, CPU_atomic_Order order ) { #if defined(_RTEMS_SCORE_CPUSTDATOMIC_USE_ATOMIC) return obj->load( order ); @@ -242,7 +242,7 @@ static inline unsigned int _CPU_atomic_Load_uint( const CPU_atomic_Uint *obj, CP * * @return The value of @a obj considering the @a order. */ -static inline unsigned long _CPU_atomic_Load_ulong( const CPU_atomic_Ulong *obj, CPU_atomic_Order order ) +static inline unsigned long _CPU_atomic_Load_ulong( CPU_atomic_Ulong *obj, CPU_atomic_Order order ) { #if defined(_RTEMS_SCORE_CPUSTDATOMIC_USE_ATOMIC) return obj->load( order ); @@ -267,7 +267,7 @@ static inline unsigned long _CPU_atomic_Load_ulong( const CPU_atomic_Ulong *obj, * * @return The value of @a obj considering the @a order. */ -static inline uintptr_t _CPU_atomic_Load_uintptr( const CPU_atomic_Uintptr *obj, CPU_atomic_Order order ) +static inline uintptr_t _CPU_atomic_Load_uintptr( CPU_atomic_Uintptr *obj, CPU_atomic_Order order ) { #if defined(_RTEMS_SCORE_CPUSTDATOMIC_USE_ATOMIC) return obj->load( order ); diff --git a/cpukit/include/rtems/score/smplockseq.h b/cpukit/include/rtems/score/smplockseq.h index ab07a04351..ddeb62f1d9 100644 --- a/cpukit/include/rtems/score/smplockseq.h +++ b/cpukit/include/rtems/score/smplockseq.h @@ -137,7 +137,7 @@ static inline void _SMP_sequence_lock_Write_end( * @return The current sequence number. */ static inline unsigned int _SMP_sequence_lock_Read_begin( - const SMP_sequence_lock_Control *lock + SMP_sequence_lock_Control *lock ) { return _Atomic_Load_uint( &lock->sequence, ATOMIC_ORDER_ACQUIRE ); diff --git a/cpukit/include/rtems/test.h b/cpukit/include/rtems/test.h index 873b8482af..46c04292cd 100644 --- a/cpukit/include/rtems/test.h +++ b/cpukit/include/rtems/test.h @@ -234,7 +234,7 @@ struct rtems_test_parallel_job { * @retval false Otherwise. */ static inline bool rtems_test_parallel_stop_job( - const rtems_test_parallel_context *ctx + rtems_test_parallel_context *ctx ) { return _Atomic_Load_ulong(&ctx->stop, ATOMIC_ORDER_RELAXED) != 0; |