<div dir="auto">This looks ok. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2024, 7:30 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The processor mask implementation uses flsl() from <strings.h> which is<br>
only BSD visible. Move the implementation to a separate header file to<br>
hide it from the API level. This fixes build errors with GCC 14.<br>
---<br>
cpukit/include/rtems/score/processormask.h | 379 +--------------<br>
.../include/rtems/score/processormaskimpl.h | 437 ++++++++++++++++++<br>
cpukit/include/rtems/score/smpimpl.h | 2 +-<br>
cpukit/score/src/processormaskcopy.c | 2 +-<br>
4 files changed, 440 insertions(+), 380 deletions(-)<br>
create mode 100644 cpukit/include/rtems/score/processormaskimpl.h<br>
<br>
diff --git a/cpukit/include/rtems/score/processormask.h b/cpukit/include/rtems/score/processormask.h<br>
index ce23f6c10d..71ed37cd0e 100644<br>
--- a/cpukit/include/rtems/score/processormask.h<br>
+++ b/cpukit/include/rtems/score/processormask.h<br>
@@ -39,9 +39,7 @@<br>
<br>
#include <rtems/score/cpu.h><br>
<br>
-#include <sys/cpuset.h><br>
-<br>
-#include <strings.h><br>
+#include <sys/_bitset.h><br>
<br>
#ifdef __cplusplus<br>
extern "C" {<br>
@@ -123,381 +121,6 @@ extern "C" {<br>
*/<br>
typedef __BITSET_DEFINE( Processor_mask, CPU_MAXIMUM_PROCESSORS ) Processor_mask;<br>
<br>
-/**<br>
- * @brief Sets the bits of the mask to zero, also considers CPU_MAXIMUM_PROCESSORS.<br>
- *<br>
- * @param[out] mask The mask to set to zero.<br>
- */<br>
-static inline void _Processor_mask_Zero( Processor_mask *mask )<br>
-{<br>
- __BIT_ZERO( CPU_MAXIMUM_PROCESSORS, mask );<br>
-}<br>
-<br>
-/**<br>
- * @brief Checks if the mask is zero, also considers CPU_MAXIMUM_PROCESSORS.<br>
- *<br>
- * @param mask The mask to check whether is is zero<br>
- *<br>
- * @retval true The mask is zero.<br>
- * @retval false The mask is not zero.<br>
- */<br>
-static inline bool _Processor_mask_Is_zero( const Processor_mask *mask )<br>
-{<br>
- return __BIT_EMPTY( CPU_MAXIMUM_PROCESSORS, mask );<br>
-}<br>
-<br>
-/**<br>
- * @brief Fills the mask, also considers CPU_MAXIMUM_PROCESSORS.<br>
- *<br>
- * @param[out] mask The mask to fill<br>
- */<br>
-static inline void _Processor_mask_Fill( Processor_mask *mask )<br>
-{<br>
- __BIT_FILL( CPU_MAXIMUM_PROCESSORS, mask );<br>
-}<br>
-<br>
-/**<br>
- * @brief Copies the mask to another mask, also considers CPU_MAXIMUM_PROCESSORS.<br>
- *<br>
- * @param[out] dst The mask to copy @a src to.<br>
- * @param src The mask to copy to @a dst.<br>
- */<br>
-static inline void _Processor_mask_Assign(<br>
- Processor_mask *dst, const Processor_mask *src<br>
-)<br>
-{<br>
- __BIT_COPY( CPU_MAXIMUM_PROCESSORS, src, dst );<br>
-}<br>
-<br>
-/**<br>
- * @brief Sets the specified index bit of the mask.<br>
- *<br>
- * @param[out] mask The mask to set the bit of.<br>
- * @param index The index of the bit that shall be set.<br>
- */<br>
-static inline void _Processor_mask_Set(<br>
- Processor_mask *mask,<br>
- uint32_t index<br>
-)<br>
-{<br>
- __BIT_SET( CPU_MAXIMUM_PROCESSORS, index, mask );<br>
-}<br>
-<br>
-/**<br>
- * @brief Clears the specified index bit of the mask.<br>
- *<br>
- * @param[out] mask The mask to clear the bit of.<br>
- * @param index The index of the bit that shall be cleared.<br>
- */<br>
-static inline void _Processor_mask_Clear(<br>
- Processor_mask *mask,<br>
- uint32_t index<br>
-)<br>
-{<br>
- __BIT_CLR( CPU_MAXIMUM_PROCESSORS, index, mask );<br>
-}<br>
-<br>
-/**<br>
- * @brief Checks if the specified index bit of the mask is set.<br>
- *<br>
- * @param mask The mask to check if the specified bit is set.<br>
- * @param index The index of the bit that is checked.<br>
- *<br>
- * @retval true The specified index bit is set.<br>
- * @retval false The specified index bit is not set.<br>
- */<br>
-static inline bool _Processor_mask_Is_set(<br>
- const Processor_mask *mask,<br>
- uint32_t index<br>
-)<br>
-{<br>
- return __BIT_ISSET( CPU_MAXIMUM_PROCESSORS, index, mask );<br>
-}<br>
-<br>
-/**<br>
- * @brief Checks if the processor sets a and b are equal.<br>
- *<br>
- * @param a The first processor set.<br>
- * @param b The seconde processor set.<br>
- *<br>
- * @retval true The processor sets a and b are equal.<br>
- * @retval false The processor sets a and b are not equal.<br>
- */<br>
-static inline bool _Processor_mask_Is_equal(<br>
- const Processor_mask *a,<br>
- const Processor_mask *b<br>
-)<br>
-{<br>
- return !__BIT_CMP( CPU_MAXIMUM_PROCESSORS, a, b );<br>
-}<br>
-<br>
-/**<br>
- * @brief Checks if the intersection of the processor sets a and b is<br>
- * non-empty.<br>
- *<br>
- * @param a The first processor set.<br>
- * @param b The second processor set.<br>
- *<br>
- * @retval true The intersection of the processor sets a and b is non-empty.<br>
- * @retval false The intersection of the processor sets a and b is empty.<br>
- */<br>
-static inline bool _Processor_mask_Has_overlap(<br>
- const Processor_mask *a,<br>
- const Processor_mask *b<br>
-)<br>
-{<br>
- return __BIT_OVERLAP( CPU_MAXIMUM_PROCESSORS, a, b );<br>
-}<br>
-<br>
-/**<br>
- * @brief Checks if the processor set small is a subset of processor set<br>
- * big.<br>
- *<br>
- * @param big The bigger processor set.<br>
- * @param small The smaller processor set.<br>
- *<br>
- * @retval true @a small is a subset of @a big.<br>
- * @retval false @a small is not a subset of @a big.<br>
- */<br>
-static inline bool _Processor_mask_Is_subset(<br>
- const Processor_mask *big,<br>
- const Processor_mask *small<br>
-)<br>
-{<br>
- return __BIT_SUBSET( CPU_MAXIMUM_PROCESSORS, big, small );<br>
-}<br>
-<br>
-/**<br>
- * @brief Performs a bitwise a = b & c.<br>
- *<br>
- * @param[out] a The processor mask that is set by this operation.<br>
- * @param b The first parameter of the AND-operation.<br>
- * @param c The second parameter of the AND-operation.<br>
- */<br>
-static inline void _Processor_mask_And(<br>
- Processor_mask *a,<br>
- const Processor_mask *b,<br>
- const Processor_mask *c<br>
-)<br>
-{<br>
- __BIT_AND2( CPU_MAXIMUM_PROCESSORS, a, b, c );<br>
-}<br>
-<br>
-/**<br>
- * @brief Performs a bitwise a = b | c.<br>
- *<br>
- * @param[out] a The processor mask that is set by this operation.<br>
- * @param b The first parameter of the OR-operation.<br>
- * @param c The second parameter of the OR-operation.<br>
- */<br>
-static inline void _Processor_mask_Or(<br>
- Processor_mask *a,<br>
- const Processor_mask *b,<br>
- const Processor_mask *c<br>
-)<br>
-{<br>
- __BIT_OR2( CPU_MAXIMUM_PROCESSORS, a, b, c );<br>
-}<br>
-<br>
-/**<br>
- * @brief Performs a bitwise a = b ^ c.<br>
- *<br>
- * @param[out] a The processor mask that is set by this operation.<br>
- * @param b The first parameter of the XOR-operation.<br>
- * @param c The second parameter of the XOR-operation.<br>
- */<br>
-static inline void _Processor_mask_Xor(<br>
- Processor_mask *a,<br>
- const Processor_mask *b,<br>
- const Processor_mask *c<br>
-)<br>
-{<br>
- __BIT_XOR2( CPU_MAXIMUM_PROCESSORS, a, b, c );<br>
-}<br>
-<br>
-/**<br>
- * @brief Gets the number of set bits in the processor mask.<br>
- *<br>
- * @param a The processor mask of which the set bits are counted.<br>
- *<br>
- * @return The number of set bits in @a a.<br>
- */<br>
-static inline uint32_t _Processor_mask_Count( const Processor_mask *a )<br>
-{<br>
- return (uint32_t) __BIT_COUNT( CPU_MAXIMUM_PROCESSORS, a );<br>
-}<br>
-<br>
-/**<br>
- * @brief Finds the last set of the processor mask.<br>
- *<br>
- * @param a The processor mask wo find the last set of.<br>
- *<br>
- * @return The last set of @a a.<br>
- */<br>
-static inline uint32_t _Processor_mask_Find_last_set( const Processor_mask *a )<br>
-{<br>
- return (uint32_t) __BIT_FLS( CPU_MAXIMUM_PROCESSORS, a );<br>
-}<br>
-<br>
-/**<br>
- * @brief Returns the subset of 32 processors containing the specified index as<br>
- * an unsigned 32-bit integer.<br>
- *<br>
- * @param mask The processor mask.<br>
- * @param index The specified index.<br>
- *<br>
- * @return The subset containing the specified index as an unsigned 32-bit integer.<br>
- */<br>
-static inline uint32_t _Processor_mask_To_uint32_t(<br>
- const Processor_mask *mask,<br>
- uint32_t index<br>
-)<br>
-{<br>
- long bits = mask->__bits[ index / _BITSET_BITS ];<br>
-<br>
- return (uint32_t) ( bits >> ( 32 * ( ( index % _BITSET_BITS ) / 32 ) ) );<br>
-}<br>
-<br>
-/**<br>
- * @brief Creates a processor set from an unsigned 32-bit integer relative to<br>
- * the specified index.<br>
- *<br>
- * @param[out] mask The mask that is created.<br>
- * @param bits The bits for creating the mask.<br>
- * @param index The index to which the mask is relative.<br>
- */<br>
-static inline void _Processor_mask_From_uint32_t(<br>
- Processor_mask *mask,<br>
- uint32_t bits,<br>
- uint32_t index<br>
-)<br>
-{<br>
- _Processor_mask_Zero( mask );<br>
- mask->__bits[ __bitset_words( index ) ] = ((long) bits) << (32 * (index % _BITSET_BITS) / 32);<br>
-}<br>
-<br>
-/**<br>
- * @brief Creates a processor set from the specified index.<br>
- *<br>
- * @param[out] The mask that is created.<br>
- * @param index The specified index.<br>
- */<br>
-static inline void _Processor_mask_From_index(<br>
- Processor_mask *mask,<br>
- uint32_t index<br>
-)<br>
-{<br>
- __BIT_SETOF( CPU_MAXIMUM_PROCESSORS, (int) index, mask );<br>
-}<br>
-<br>
-typedef enum {<br>
- PROCESSOR_MASK_COPY_LOSSLESS,<br>
- PROCESSOR_MASK_COPY_PARTIAL_LOSS,<br>
- PROCESSOR_MASK_COPY_COMPLETE_LOSS,<br>
- PROCESSOR_MASK_COPY_INVALID_SIZE<br>
-} Processor_mask_Copy_status;<br>
-<br>
-/**<br>
- * @brief Checks if the copy status guarantees at most partial loss.<br>
- *<br>
- * @param status The copy status to check.<br>
- *<br>
- * @retval true At most partial loss can be guaranteed.<br>
- * @retval false The status indicates more than partial loss.<br>
- */<br>
-static inline bool _Processor_mask_Is_at_most_partial_loss(<br>
- Processor_mask_Copy_status status<br>
-)<br>
-{<br>
- return (unsigned int) status <= PROCESSOR_MASK_COPY_PARTIAL_LOSS;<br>
-}<br>
-<br>
-/**<br>
- * @brief Copies one mask to another.<br>
- *<br>
- * @param[out] dst The destination of the copy operation.<br>
- * @param dst_size The size of @a dst.<br>
- * @param src The source of the copy operation.<br>
- * @param src_size The size of @a src.<br>
- *<br>
- * @retval PROCESSOR_MASK_COPY_LOSSLESS It is guaranteed that the copy<br>
- * operation is lossless.<br>
- * @retval PROCESSOR_MASK_COPY_PARTIAL_LOSS Partial loss happened due<br>
- * to the sizes of @a src and @a dst.<br>
- * @retval PROCESSOR_MASK_COPY_COMPLETE_LOSS Complete loss happened due<br>
- * to the sizes of @a src and @a dst.<br>
- * @retval PROCESSOR_MASK_COPY_INVALID_SIZE One of the arguments sizes<br>
- * is invalid (bigger than the size of a long).<br>
- */<br>
-Processor_mask_Copy_status _Processor_mask_Copy(<br>
- long *dst,<br>
- size_t dst_size,<br>
- const long *src,<br>
- size_t src_size<br>
-);<br>
-<br>
-/**<br>
- * @brief Copies one mask to another.<br>
- *<br>
- * @param src The source for the copy operation.<br>
- * @param dst_size The size of @a dst.<br>
- * @param[out] dst The destination for the copy operation.<br>
- *<br>
- * @retval PROCESSOR_MASK_COPY_LOSSLESS It is guaranteed that the copy<br>
- * operation is lossless.<br>
- * @retval PROCESSOR_MASK_COPY_PARTIAL_LOSS Partial loss happened due<br>
- * to the sizes of @a src and @a dst.<br>
- * @retval PROCESSOR_MASK_COPY_COMPLETE_LOSS Complete loss happened due<br>
- * to the sizes of @a src and @a dst.<br>
- * @retval PROCESSOR_MASK_COPY_INVALID_SIZE One of the arguments sizes<br>
- * is invalid (bigger than the size of a long).<br>
- */<br>
-static inline Processor_mask_Copy_status _Processor_mask_To_cpu_set_t(<br>
- const Processor_mask *src,<br>
- size_t dst_size,<br>
- cpu_set_t *dst<br>
-)<br>
-{<br>
- return _Processor_mask_Copy(<br>
- &dst->__bits[ 0 ],<br>
- dst_size,<br>
- &src->__bits[ 0 ],<br>
- sizeof( *src )<br>
- );<br>
-}<br>
-<br>
-/**<br>
- * @brief Copies one mask to another.<br>
- *<br>
- * @param src The source for the copy operation.<br>
- * @param src_size The size of @a src.<br>
- * @param[out] dst The destination for the copy operation.<br>
- *<br>
- * @retval PROCESSOR_MASK_COPY_LOSSLESS It is guaranteed that the copy<br>
- * operation is lossless.<br>
- * @retval PROCESSOR_MASK_COPY_PARTIAL_LOSS Partial loss happened due<br>
- * to the sizes of @a src and @a dst.<br>
- * @retval PROCESSOR_MASK_COPY_COMPLETE_LOSS Complete loss happened due<br>
- * to the sizes of @a src and @a dst.<br>
- * @retval PROCESSOR_MASK_COPY_INVALID_SIZE One of the arguments sizes<br>
- * is invalid (bigger than the size of a long).<br>
- */<br>
-static inline Processor_mask_Copy_status _Processor_mask_From_cpu_set_t(<br>
- Processor_mask *dst,<br>
- size_t src_size,<br>
- const cpu_set_t *src<br>
-)<br>
-{<br>
- return _Processor_mask_Copy(<br>
- &dst->__bits[ 0 ],<br>
- sizeof( *dst ),<br>
- &src->__bits[ 0 ],<br>
- src_size<br>
- );<br>
-}<br>
-<br>
-extern const Processor_mask _Processor_mask_The_one_and_only;<br>
-<br>
/** @} */<br>
<br>
#ifdef __cplusplus<br>
diff --git a/cpukit/include/rtems/score/processormaskimpl.h b/cpukit/include/rtems/score/processormaskimpl.h<br>
new file mode 100644<br>
index 0000000000..bc997edfd4<br>
--- /dev/null<br>
+++ b/cpukit/include/rtems/score/processormaskimpl.h<br>
@@ -0,0 +1,437 @@<br>
+/* SPDX-License-Identifier: BSD-2-Clause */<br>
+<br>
+/**<br>
+ * @file<br>
+ *<br>
+ * @ingroup RTEMSScoreProcessorMask<br>
+ *<br>
+ * @brief This header file provides the interfaces of the<br>
+ * @ref RTEMSScoreProcessorMask.<br>
+ */<br>
+<br>
+/*<br>
+ * Copyright (C) 2016, 2017 embedded brains GmbH & Co. KG<br>
+ *<br>
+ * Redistribution and use in source and binary forms, with or without<br>
+ * modification, are permitted provided that the following conditions<br>
+ * are met:<br>
+ * 1. Redistributions of source code must retain the above copyright<br>
+ * notice, this list of conditions and the following disclaimer.<br>
+ * 2. Redistributions in binary form must reproduce the above copyright<br>
+ * notice, this list of conditions and the following disclaimer in the<br>
+ * documentation and/or other materials provided with the distribution.<br>
+ *<br>
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
+ * POSSIBILITY OF SUCH DAMAGE.<br>
+ */<br>
+<br>
+#ifndef _RTEMS_SCORE_PROCESSORMASKIMPL_H<br>
+#define _RTEMS_SCORE_PROCESSORMASKIMPL_H<br>
+<br>
+#include <rtems/score/processormask.h><br>
+<br>
+#include <sys/cpuset.h><br>
+<br>
+#include <strings.h><br>
+<br>
+#ifdef __cplusplus<br>
+extern "C" {<br>
+#endif /* __cplusplus */<br>
+<br>
+/**<br>
+ * @addtogroup RTEMSScoreProcessorMask<br>
+ *<br>
+ * @{<br>
+ */<br>
+<br>
+/**<br>
+ * @brief Sets the bits of the mask to zero, also considers CPU_MAXIMUM_PROCESSORS.<br>
+ *<br>
+ * @param[out] mask The mask to set to zero.<br>
+ */<br>
+static inline void _Processor_mask_Zero( Processor_mask *mask )<br>
+{<br>
+ __BIT_ZERO( CPU_MAXIMUM_PROCESSORS, mask );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Checks if the mask is zero, also considers CPU_MAXIMUM_PROCESSORS.<br>
+ *<br>
+ * @param mask The mask to check whether is is zero<br>
+ *<br>
+ * @retval true The mask is zero.<br>
+ * @retval false The mask is not zero.<br>
+ */<br>
+static inline bool _Processor_mask_Is_zero( const Processor_mask *mask )<br>
+{<br>
+ return __BIT_EMPTY( CPU_MAXIMUM_PROCESSORS, mask );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Fills the mask, also considers CPU_MAXIMUM_PROCESSORS.<br>
+ *<br>
+ * @param[out] mask The mask to fill<br>
+ */<br>
+static inline void _Processor_mask_Fill( Processor_mask *mask )<br>
+{<br>
+ __BIT_FILL( CPU_MAXIMUM_PROCESSORS, mask );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Copies the mask to another mask, also considers CPU_MAXIMUM_PROCESSORS.<br>
+ *<br>
+ * @param[out] dst The mask to copy @a src to.<br>
+ * @param src The mask to copy to @a dst.<br>
+ */<br>
+static inline void _Processor_mask_Assign(<br>
+ Processor_mask *dst, const Processor_mask *src<br>
+)<br>
+{<br>
+ __BIT_COPY( CPU_MAXIMUM_PROCESSORS, src, dst );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Sets the specified index bit of the mask.<br>
+ *<br>
+ * @param[out] mask The mask to set the bit of.<br>
+ * @param index The index of the bit that shall be set.<br>
+ */<br>
+static inline void _Processor_mask_Set(<br>
+ Processor_mask *mask,<br>
+ uint32_t index<br>
+)<br>
+{<br>
+ __BIT_SET( CPU_MAXIMUM_PROCESSORS, index, mask );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Clears the specified index bit of the mask.<br>
+ *<br>
+ * @param[out] mask The mask to clear the bit of.<br>
+ * @param index The index of the bit that shall be cleared.<br>
+ */<br>
+static inline void _Processor_mask_Clear(<br>
+ Processor_mask *mask,<br>
+ uint32_t index<br>
+)<br>
+{<br>
+ __BIT_CLR( CPU_MAXIMUM_PROCESSORS, index, mask );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Checks if the specified index bit of the mask is set.<br>
+ *<br>
+ * @param mask The mask to check if the specified bit is set.<br>
+ * @param index The index of the bit that is checked.<br>
+ *<br>
+ * @retval true The specified index bit is set.<br>
+ * @retval false The specified index bit is not set.<br>
+ */<br>
+static inline bool _Processor_mask_Is_set(<br>
+ const Processor_mask *mask,<br>
+ uint32_t index<br>
+)<br>
+{<br>
+ return __BIT_ISSET( CPU_MAXIMUM_PROCESSORS, index, mask );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Checks if the processor sets a and b are equal.<br>
+ *<br>
+ * @param a The first processor set.<br>
+ * @param b The seconde processor set.<br>
+ *<br>
+ * @retval true The processor sets a and b are equal.<br>
+ * @retval false The processor sets a and b are not equal.<br>
+ */<br>
+static inline bool _Processor_mask_Is_equal(<br>
+ const Processor_mask *a,<br>
+ const Processor_mask *b<br>
+)<br>
+{<br>
+ return !__BIT_CMP( CPU_MAXIMUM_PROCESSORS, a, b );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Checks if the intersection of the processor sets a and b is<br>
+ * non-empty.<br>
+ *<br>
+ * @param a The first processor set.<br>
+ * @param b The second processor set.<br>
+ *<br>
+ * @retval true The intersection of the processor sets a and b is non-empty.<br>
+ * @retval false The intersection of the processor sets a and b is empty.<br>
+ */<br>
+static inline bool _Processor_mask_Has_overlap(<br>
+ const Processor_mask *a,<br>
+ const Processor_mask *b<br>
+)<br>
+{<br>
+ return __BIT_OVERLAP( CPU_MAXIMUM_PROCESSORS, a, b );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Checks if the processor set small is a subset of processor set<br>
+ * big.<br>
+ *<br>
+ * @param big The bigger processor set.<br>
+ * @param small The smaller processor set.<br>
+ *<br>
+ * @retval true @a small is a subset of @a big.<br>
+ * @retval false @a small is not a subset of @a big.<br>
+ */<br>
+static inline bool _Processor_mask_Is_subset(<br>
+ const Processor_mask *big,<br>
+ const Processor_mask *small<br>
+)<br>
+{<br>
+ return __BIT_SUBSET( CPU_MAXIMUM_PROCESSORS, big, small );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Performs a bitwise a = b & c.<br>
+ *<br>
+ * @param[out] a The processor mask that is set by this operation.<br>
+ * @param b The first parameter of the AND-operation.<br>
+ * @param c The second parameter of the AND-operation.<br>
+ */<br>
+static inline void _Processor_mask_And(<br>
+ Processor_mask *a,<br>
+ const Processor_mask *b,<br>
+ const Processor_mask *c<br>
+)<br>
+{<br>
+ __BIT_AND2( CPU_MAXIMUM_PROCESSORS, a, b, c );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Performs a bitwise a = b | c.<br>
+ *<br>
+ * @param[out] a The processor mask that is set by this operation.<br>
+ * @param b The first parameter of the OR-operation.<br>
+ * @param c The second parameter of the OR-operation.<br>
+ */<br>
+static inline void _Processor_mask_Or(<br>
+ Processor_mask *a,<br>
+ const Processor_mask *b,<br>
+ const Processor_mask *c<br>
+)<br>
+{<br>
+ __BIT_OR2( CPU_MAXIMUM_PROCESSORS, a, b, c );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Performs a bitwise a = b ^ c.<br>
+ *<br>
+ * @param[out] a The processor mask that is set by this operation.<br>
+ * @param b The first parameter of the XOR-operation.<br>
+ * @param c The second parameter of the XOR-operation.<br>
+ */<br>
+static inline void _Processor_mask_Xor(<br>
+ Processor_mask *a,<br>
+ const Processor_mask *b,<br>
+ const Processor_mask *c<br>
+)<br>
+{<br>
+ __BIT_XOR2( CPU_MAXIMUM_PROCESSORS, a, b, c );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Gets the number of set bits in the processor mask.<br>
+ *<br>
+ * @param a The processor mask of which the set bits are counted.<br>
+ *<br>
+ * @return The number of set bits in @a a.<br>
+ */<br>
+static inline uint32_t _Processor_mask_Count( const Processor_mask *a )<br>
+{<br>
+ return (uint32_t) __BIT_COUNT( CPU_MAXIMUM_PROCESSORS, a );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Finds the last set of the processor mask.<br>
+ *<br>
+ * @param a The processor mask wo find the last set of.<br>
+ *<br>
+ * @return The last set of @a a.<br>
+ */<br>
+static inline uint32_t _Processor_mask_Find_last_set( const Processor_mask *a )<br>
+{<br>
+ return (uint32_t) __BIT_FLS( CPU_MAXIMUM_PROCESSORS, a );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Returns the subset of 32 processors containing the specified index as<br>
+ * an unsigned 32-bit integer.<br>
+ *<br>
+ * @param mask The processor mask.<br>
+ * @param index The specified index.<br>
+ *<br>
+ * @return The subset containing the specified index as an unsigned 32-bit integer.<br>
+ */<br>
+static inline uint32_t _Processor_mask_To_uint32_t(<br>
+ const Processor_mask *mask,<br>
+ uint32_t index<br>
+)<br>
+{<br>
+ long bits = mask->__bits[ index / _BITSET_BITS ];<br>
+<br>
+ return (uint32_t) ( bits >> ( 32 * ( ( index % _BITSET_BITS ) / 32 ) ) );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Creates a processor set from an unsigned 32-bit integer relative to<br>
+ * the specified index.<br>
+ *<br>
+ * @param[out] mask The mask that is created.<br>
+ * @param bits The bits for creating the mask.<br>
+ * @param index The index to which the mask is relative.<br>
+ */<br>
+static inline void _Processor_mask_From_uint32_t(<br>
+ Processor_mask *mask,<br>
+ uint32_t bits,<br>
+ uint32_t index<br>
+)<br>
+{<br>
+ _Processor_mask_Zero( mask );<br>
+ mask->__bits[ __bitset_words( index ) ] = ((long) bits) << (32 * (index % _BITSET_BITS) / 32);<br>
+}<br>
+<br>
+/**<br>
+ * @brief Creates a processor set from the specified index.<br>
+ *<br>
+ * @param[out] The mask that is created.<br>
+ * @param index The specified index.<br>
+ */<br>
+static inline void _Processor_mask_From_index(<br>
+ Processor_mask *mask,<br>
+ uint32_t index<br>
+)<br>
+{<br>
+ __BIT_SETOF( CPU_MAXIMUM_PROCESSORS, (int) index, mask );<br>
+}<br>
+<br>
+typedef enum {<br>
+ PROCESSOR_MASK_COPY_LOSSLESS,<br>
+ PROCESSOR_MASK_COPY_PARTIAL_LOSS,<br>
+ PROCESSOR_MASK_COPY_COMPLETE_LOSS,<br>
+ PROCESSOR_MASK_COPY_INVALID_SIZE<br>
+} Processor_mask_Copy_status;<br>
+<br>
+/**<br>
+ * @brief Checks if the copy status guarantees at most partial loss.<br>
+ *<br>
+ * @param status The copy status to check.<br>
+ *<br>
+ * @retval true At most partial loss can be guaranteed.<br>
+ * @retval false The status indicates more than partial loss.<br>
+ */<br>
+static inline bool _Processor_mask_Is_at_most_partial_loss(<br>
+ Processor_mask_Copy_status status<br>
+)<br>
+{<br>
+ return (unsigned int) status <= PROCESSOR_MASK_COPY_PARTIAL_LOSS;<br>
+}<br>
+<br>
+/**<br>
+ * @brief Copies one mask to another.<br>
+ *<br>
+ * @param[out] dst The destination of the copy operation.<br>
+ * @param dst_size The size of @a dst.<br>
+ * @param src The source of the copy operation.<br>
+ * @param src_size The size of @a src.<br>
+ *<br>
+ * @retval PROCESSOR_MASK_COPY_LOSSLESS It is guaranteed that the copy<br>
+ * operation is lossless.<br>
+ * @retval PROCESSOR_MASK_COPY_PARTIAL_LOSS Partial loss happened due<br>
+ * to the sizes of @a src and @a dst.<br>
+ * @retval PROCESSOR_MASK_COPY_COMPLETE_LOSS Complete loss happened due<br>
+ * to the sizes of @a src and @a dst.<br>
+ * @retval PROCESSOR_MASK_COPY_INVALID_SIZE One of the arguments sizes<br>
+ * is invalid (bigger than the size of a long).<br>
+ */<br>
+Processor_mask_Copy_status _Processor_mask_Copy(<br>
+ long *dst,<br>
+ size_t dst_size,<br>
+ const long *src,<br>
+ size_t src_size<br>
+);<br>
+<br>
+/**<br>
+ * @brief Copies one mask to another.<br>
+ *<br>
+ * @param src The source for the copy operation.<br>
+ * @param dst_size The size of @a dst.<br>
+ * @param[out] dst The destination for the copy operation.<br>
+ *<br>
+ * @retval PROCESSOR_MASK_COPY_LOSSLESS It is guaranteed that the copy<br>
+ * operation is lossless.<br>
+ * @retval PROCESSOR_MASK_COPY_PARTIAL_LOSS Partial loss happened due<br>
+ * to the sizes of @a src and @a dst.<br>
+ * @retval PROCESSOR_MASK_COPY_COMPLETE_LOSS Complete loss happened due<br>
+ * to the sizes of @a src and @a dst.<br>
+ * @retval PROCESSOR_MASK_COPY_INVALID_SIZE One of the arguments sizes<br>
+ * is invalid (bigger than the size of a long).<br>
+ */<br>
+static inline Processor_mask_Copy_status _Processor_mask_To_cpu_set_t(<br>
+ const Processor_mask *src,<br>
+ size_t dst_size,<br>
+ cpu_set_t *dst<br>
+)<br>
+{<br>
+ return _Processor_mask_Copy(<br>
+ &dst->__bits[ 0 ],<br>
+ dst_size,<br>
+ &src->__bits[ 0 ],<br>
+ sizeof( *src )<br>
+ );<br>
+}<br>
+<br>
+/**<br>
+ * @brief Copies one mask to another.<br>
+ *<br>
+ * @param src The source for the copy operation.<br>
+ * @param src_size The size of @a src.<br>
+ * @param[out] dst The destination for the copy operation.<br>
+ *<br>
+ * @retval PROCESSOR_MASK_COPY_LOSSLESS It is guaranteed that the copy<br>
+ * operation is lossless.<br>
+ * @retval PROCESSOR_MASK_COPY_PARTIAL_LOSS Partial loss happened due<br>
+ * to the sizes of @a src and @a dst.<br>
+ * @retval PROCESSOR_MASK_COPY_COMPLETE_LOSS Complete loss happened due<br>
+ * to the sizes of @a src and @a dst.<br>
+ * @retval PROCESSOR_MASK_COPY_INVALID_SIZE One of the arguments sizes<br>
+ * is invalid (bigger than the size of a long).<br>
+ */<br>
+static inline Processor_mask_Copy_status _Processor_mask_From_cpu_set_t(<br>
+ Processor_mask *dst,<br>
+ size_t src_size,<br>
+ const cpu_set_t *src<br>
+)<br>
+{<br>
+ return _Processor_mask_Copy(<br>
+ &dst->__bits[ 0 ],<br>
+ sizeof( *dst ),<br>
+ &src->__bits[ 0 ],<br>
+ src_size<br>
+ );<br>
+}<br>
+<br>
+extern const Processor_mask _Processor_mask_The_one_and_only;<br>
+<br>
+/** @} */<br>
+<br>
+#ifdef __cplusplus<br>
+}<br>
+#endif /* __cplusplus */<br>
+<br>
+#endif /* _RTEMS_SCORE_PROCESSORMASKIMPL_H */<br>
diff --git a/cpukit/include/rtems/score/smpimpl.h b/cpukit/include/rtems/score/smpimpl.h<br>
index 2ffc047070..a8e3a3be15 100644<br>
--- a/cpukit/include/rtems/score/smpimpl.h<br>
+++ b/cpukit/include/rtems/score/smpimpl.h<br>
@@ -40,7 +40,7 @@<br>
<br>
#include <rtems/score/smp.h><br>
#include <rtems/score/percpu.h><br>
-#include <rtems/score/processormask.h><br>
+#include <rtems/score/processormaskimpl.h><br>
#include <rtems/fatal.h><br>
<br>
#ifdef __cplusplus<br>
diff --git a/cpukit/score/src/processormaskcopy.c b/cpukit/score/src/processormaskcopy.c<br>
index 863bd1574e..3f1c2cf250 100644<br>
--- a/cpukit/score/src/processormaskcopy.c<br>
+++ b/cpukit/score/src/processormaskcopy.c<br>
@@ -39,7 +39,7 @@<br>
#include "config.h"<br>
#endif<br>
<br>
-#include <rtems/score/processormask.h><br>
+#include <rtems/score/processormaskimpl.h><br>
<br>
const Processor_mask _Processor_mask_The_one_and_only = { .__bits[ 0 ] = 1 };<br>
<br>
-- <br>
2.35.3<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>