<div dir="ltr">Looks ok.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 17, 2021 at 9:59 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Move this diagnostic function to a separate file since it does not<br>
provide a core function of the system.<br>
<br>
Change license to BSD-2-Clause according to file history and<br>
re-licensing agreement.<br>
<br>
Update #3053.<br>
---<br>
 cpukit/Makefile.am                     |  1 +<br>
 cpukit/score/src/threadq.c             | 36 ------------<br>
 cpukit/score/src/threadqgetnameandid.c | 76 ++++++++++++++++++++++++++<br>
 spec/build/cpukit/librtemscpu.yml      |  1 +<br>
 4 files changed, 78 insertions(+), 36 deletions(-)<br>
 create mode 100644 cpukit/score/src/threadqgetnameandid.c<br>
<br>
diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am<br>
index 0178d5d82a..7e7c267fc1 100644<br>
--- a/cpukit/Makefile.am<br>
+++ b/cpukit/Makefile.am<br>
@@ -984,6 +984,7 @@ librtemscpu_a_SOURCES += score/src/threadqenqueue.c<br>
 librtemscpu_a_SOURCES += score/src/threadqextractwithproxy.c<br>
 librtemscpu_a_SOURCES += score/src/threadqfirst.c<br>
 librtemscpu_a_SOURCES += score/src/threadqflush.c<br>
+librtemscpu_a_SOURCES += score/src/threadqgetnameandid.c<br>
 librtemscpu_a_SOURCES += score/src/threadqops.c<br>
 librtemscpu_a_SOURCES += score/src/threadqtimeout.c<br>
 librtemscpu_a_SOURCES += score/src/timespecaddto.c<br>
diff --git a/cpukit/score/src/threadq.c b/cpukit/score/src/threadq.c<br>
index 55d8760f7c..e322b46b5e 100644<br>
--- a/cpukit/score/src/threadq.c<br>
+++ b/cpukit/score/src/threadq.c<br>
@@ -25,11 +25,7 @@<br>
 #include "config.h"<br>
 #endif<br>
<br>
-#include <string.h><br>
-<br>
 #include <rtems/score/threadqimpl.h><br>
-#include <rtems/score/rbtreeimpl.h><br>
-#include <rtems/score/threadimpl.h><br>
<br>
 RTEMS_STATIC_ASSERT(<br>
 #if defined(RTEMS_SMP)<br>
@@ -166,35 +162,3 @@ void _Thread_queue_MP_callout_do_nothing(<br>
   /* Do nothing */<br>
 }<br>
 #endif<br>
-<br>
-size_t _Thread_queue_Queue_get_name_and_id(<br>
-  const Thread_queue_Queue *queue,<br>
-  char                     *buffer,<br>
-  size_t                    buffer_size,<br>
-  Objects_Id               *id<br>
-)<br>
-{<br>
-  const char *name;<br>
-<br>
-  name = queue->name;<br>
-<br>
-  if ( name == _Thread_queue_Object_name ) {<br>
-    const Thread_queue_Object *queue_object;<br>
-<br>
-    queue_object = THREAD_QUEUE_QUEUE_TO_OBJECT( queue );<br>
-    *id = queue_object->Object.id;<br>
-    return _Objects_Name_to_string(<br>
-      queue_object->Object.name,<br>
-      false,<br>
-      buffer,<br>
-      buffer_size<br>
-    );<br>
-  } else {<br>
-    if ( name == NULL ) {<br>
-      name = _Thread_queue_Object_name;<br>
-    }<br>
-<br>
-    *id = 0;<br>
-    return strlcpy( buffer, name, buffer_size );<br>
-  }<br>
-}<br>
diff --git a/cpukit/score/src/threadqgetnameandid.c b/cpukit/score/src/threadqgetnameandid.c<br>
new file mode 100644<br>
index 0000000000..ea4e2203e6<br>
--- /dev/null<br>
+++ b/cpukit/score/src/threadqgetnameandid.c<br>
@@ -0,0 +1,76 @@<br>
+/* SPDX-License-Identifier: BSD-2-Clause */<br>
+<br>
+/**<br>
+ * @file<br>
+ *<br>
+ * @ingroup RTEMSScoreThreadQueue<br>
+ *<br>
+ * @brief This source file contains the implementation of<br>
+ *   _Thread_queue_Queue_get_name_and_id().<br>
+ */<br>
+<br>
+/*<br>
+ * Copyright (C) 2017 embedded brains GmbH (<a href="http://www.embedded-brains.de" rel="noreferrer" target="_blank">http://www.embedded-brains.de</a>)<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>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <rtems/score/threadqimpl.h><br>
+#include <rtems/score/objectimpl.h><br>
+<br>
+#include <string.h><br>
+<br>
+size_t _Thread_queue_Queue_get_name_and_id(<br>
+  const Thread_queue_Queue *queue,<br>
+  char                     *buffer,<br>
+  size_t                    buffer_size,<br>
+  Objects_Id               *id<br>
+)<br>
+{<br>
+  const char *name;<br>
+<br>
+  name = queue->name;<br>
+<br>
+  if ( name == _Thread_queue_Object_name ) {<br>
+    const Thread_queue_Object *queue_object;<br>
+<br>
+    queue_object = THREAD_QUEUE_QUEUE_TO_OBJECT( queue );<br>
+    *id = queue_object->Object.id;<br>
+    return _Objects_Name_to_string(<br>
+      queue_object->Object.name,<br>
+      false,<br>
+      buffer,<br>
+      buffer_size<br>
+    );<br>
+  } else {<br>
+    if ( name == NULL ) {<br>
+      name = _Thread_queue_Object_name;<br>
+    }<br>
+<br>
+    *id = 0;<br>
+    return strlcpy( buffer, name, buffer_size );<br>
+  }<br>
+}<br>
diff --git a/spec/build/cpukit/librtemscpu.yml b/spec/build/cpukit/librtemscpu.yml<br>
index 682032182f..ac9e494f0c 100644<br>
--- a/spec/build/cpukit/librtemscpu.yml<br>
+++ b/spec/build/cpukit/librtemscpu.yml<br>
@@ -1542,6 +1542,7 @@ source:<br>
 - cpukit/score/src/threadqextractwithproxy.c<br>
 - cpukit/score/src/threadqfirst.c<br>
 - cpukit/score/src/threadqflush.c<br>
+- cpukit/score/src/threadqgetnameandid.c<br>
 - cpukit/score/src/threadqops.c<br>
 - cpukit/score/src/threadqtimeout.c<br>
 - cpukit/score/src/threadrestart.c<br>
-- <br>
2.26.2<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>