summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/rtems/src')
-rw-r--r--cpukit/rtems/src/barrierident.c55
-rw-r--r--cpukit/rtems/src/dpmemident.c51
-rw-r--r--cpukit/rtems/src/msgqident.c57
-rw-r--r--cpukit/rtems/src/partident.c47
-rw-r--r--cpukit/rtems/src/ratemonident.c56
-rw-r--r--cpukit/rtems/src/regionident.c57
-rw-r--r--cpukit/rtems/src/rtemsnametoid.c55
-rw-r--r--cpukit/rtems/src/semident.c44
-rw-r--r--cpukit/rtems/src/taskident.c65
-rw-r--r--cpukit/rtems/src/timerident.c56
10 files changed, 348 insertions, 195 deletions
diff --git a/cpukit/rtems/src/barrierident.c b/cpukit/rtems/src/barrierident.c
index e3d6a84b80..928cc0ce9e 100644
--- a/cpukit/rtems/src/barrierident.c
+++ b/cpukit/rtems/src/barrierident.c
@@ -1,41 +1,52 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
- * @file
+ * @file
+ *
+ * @ingroup ClassicBarrierImpl
*
- * @brief RTEMS Barrier name to Id
- * @ingroup ClassicBarrier
+ * @brief rtems_barrier_ident() Implementation
*/
/*
- * COPYRIGHT (c) 1989-2006.
- * On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1989 On-Line Applications Research Corporation (OAR).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/options.h>
#include <rtems/rtems/barrierimpl.h>
+#include <rtems/rtems/objectimpl.h>
-rtems_status_code rtems_barrier_ident(
- rtems_name name,
- rtems_id *id
-)
+rtems_status_code rtems_barrier_ident( rtems_name name, rtems_id *id )
{
- Objects_Name_or_id_lookup_errors status;
-
- status = _Objects_Name_to_id_u32(
- &_Barrier_Information,
+ return _RTEMS_Name_to_id(
name,
OBJECTS_SEARCH_LOCAL_NODE,
- id
+ id,
+ &_Barrier_Information
);
-
- return _Status_Object_name_errors_to_status[ status ];
}
diff --git a/cpukit/rtems/src/dpmemident.c b/cpukit/rtems/src/dpmemident.c
index 775d833bde..38d906833f 100644
--- a/cpukit/rtems/src/dpmemident.c
+++ b/cpukit/rtems/src/dpmemident.c
@@ -1,42 +1,55 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
- * @file
+ * @file
+ *
+ * @ingroup ClassicDPMEMImpl
*
- * @brief RTEMS Port Name to Id
- * @ingroup ClassicDPMEM
+ * @brief rtems_port_ident() Implementation
*/
/*
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1989 On-Line Applications Research Corporation (OAR).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/address.h>
#include <rtems/rtems/dpmemimpl.h>
-#include <rtems/score/thread.h>
+#include <rtems/rtems/objectimpl.h>
rtems_status_code rtems_port_ident(
rtems_name name,
rtems_id *id
)
{
- Objects_Name_or_id_lookup_errors status;
-
- status = _Objects_Name_to_id_u32(
- &_Dual_ported_memory_Information,
+ return _RTEMS_Name_to_id(
name,
OBJECTS_SEARCH_ALL_NODES,
- id
+ id,
+ &_Dual_ported_memory_Information
);
-
- return _Status_Object_name_errors_to_status[ status ];
}
diff --git a/cpukit/rtems/src/msgqident.c b/cpukit/rtems/src/msgqident.c
index f25f0cdc6c..dfd68d21f0 100644
--- a/cpukit/rtems/src/msgqident.c
+++ b/cpukit/rtems/src/msgqident.c
@@ -1,33 +1,45 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
- * @file
+ * @file
+ *
+ * @ingroup ClassicMessageQueueImpl
*
- * @brief RTEMS Message Queue Name to Id
- * @ingroup ClassicMessageQueue
+ * @brief rtems_message_queue_ident() Implementation
*/
/*
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1989 On-Line Applications Research Corporation (OAR).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/score/chain.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/coremsgimpl.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/attrimpl.h>
#include <rtems/rtems/messageimpl.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/support.h>
+#include <rtems/rtems/objectimpl.h>
rtems_status_code rtems_message_queue_ident(
rtems_name name,
@@ -35,14 +47,5 @@ rtems_status_code rtems_message_queue_ident(
rtems_id *id
)
{
- Objects_Name_or_id_lookup_errors status;
-
- status = _Objects_Name_to_id_u32(
- &_Message_queue_Information,
- name,
- node,
- id
- );
-
- return _Status_Object_name_errors_to_status[ status ];
+ return _RTEMS_Name_to_id( name, node, id, &_Message_queue_Information );
}
diff --git a/cpukit/rtems/src/partident.c b/cpukit/rtems/src/partident.c
index 03490cd95d..5e7140f8d9 100644
--- a/cpukit/rtems/src/partident.c
+++ b/cpukit/rtems/src/partident.c
@@ -1,28 +1,45 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
- * @file
+ * @file
+ *
+ * @ingroup ClassicPartitionImpl
*
- * @brief RTEMS Partition Name to Id
- * @ingroup ClassicPart
+ * @brief rtems_partition_ident() Implementation
*/
/*
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1989 On-Line Applications Research Corporation (OAR).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/address.h>
#include <rtems/rtems/partimpl.h>
-#include <rtems/score/thread.h>
+#include <rtems/rtems/objectimpl.h>
rtems_status_code rtems_partition_ident(
rtems_name name,
@@ -30,9 +47,5 @@ rtems_status_code rtems_partition_ident(
rtems_id *id
)
{
- Objects_Name_or_id_lookup_errors status;
-
- status = _Objects_Name_to_id_u32( &_Partition_Information, name, node, id );
-
- return _Status_Object_name_errors_to_status[ status ];
+ return _RTEMS_Name_to_id( name, node, id, &_Partition_Information );
}
diff --git a/cpukit/rtems/src/ratemonident.c b/cpukit/rtems/src/ratemonident.c
index 9c1ae3fba0..67ba13b476 100644
--- a/cpukit/rtems/src/ratemonident.c
+++ b/cpukit/rtems/src/ratemonident.c
@@ -1,42 +1,52 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
- * @file
+ * @file
+ *
+ * @ingroup ClassicRateMonImpl
*
- * @brief RTEMS Rate Monotonic Name to Id
- * @ingroup ClassicRateMon
+ * @brief rtems_rate_monotonic_ident() Implementation
*/
/*
- * COPYRIGHT (c) 1989-2007.
- * On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1989 On-Line Applications Research Corporation (OAR).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/isr.h>
#include <rtems/rtems/ratemonimpl.h>
-#include <rtems/score/thread.h>
+#include <rtems/rtems/objectimpl.h>
-rtems_status_code rtems_rate_monotonic_ident(
- rtems_name name,
- rtems_id *id
-)
+rtems_status_code rtems_rate_monotonic_ident( rtems_name name, rtems_id *id )
{
- Objects_Name_or_id_lookup_errors status;
-
- status = _Objects_Name_to_id_u32(
- &_Rate_monotonic_Information,
+ return _RTEMS_Name_to_id(
name,
OBJECTS_SEARCH_LOCAL_NODE,
- id
+ id,
+ &_Rate_monotonic_Information
);
-
- return _Status_Object_name_errors_to_status[ status ];
}
diff --git a/cpukit/rtems/src/regionident.c b/cpukit/rtems/src/regionident.c
index 9e4d4b7085..c8a643c356 100644
--- a/cpukit/rtems/src/regionident.c
+++ b/cpukit/rtems/src/regionident.c
@@ -1,43 +1,52 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
- * @file
+ * @file
+ *
+ * @ingroup ClassicRegionImpl
*
- * @brief RTEMS Region Name to Id
- * @ingroup ClassicRegion
+ * @brief rtems_region_ident() Implementation
*/
/*
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1989 On-Line Applications Research Corporation (OAR).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/options.h>
#include <rtems/rtems/regionimpl.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/apimutex.h>
+#include <rtems/rtems/objectimpl.h>
-rtems_status_code rtems_region_ident(
- rtems_name name,
- rtems_id *id
-)
+rtems_status_code rtems_region_ident( rtems_name name, rtems_id *id )
{
- Objects_Name_or_id_lookup_errors status;
-
- status = _Objects_Name_to_id_u32(
- &_Region_Information,
+ return _RTEMS_Name_to_id(
name,
OBJECTS_SEARCH_LOCAL_NODE,
- id
+ id,
+ &_Region_Information
);
-
- return _Status_Object_name_errors_to_status[ status ];
}
diff --git a/cpukit/rtems/src/rtemsnametoid.c b/cpukit/rtems/src/rtemsnametoid.c
new file mode 100644
index 0000000000..43a6d20908
--- /dev/null
+++ b/cpukit/rtems/src/rtemsnametoid.c
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup ClassicObjectImpl
+ *
+ * @brief _RTEMS_Name_to_id() Implementation
+ */
+
+/*
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/rtems/objectimpl.h>
+#include <rtems/rtems/statusimpl.h>
+
+rtems_status_code _RTEMS_Name_to_id(
+ uint32_t name,
+ uint32_t node,
+ Objects_Id *id,
+ const Objects_Information *information
+)
+{
+ Objects_Name_or_id_lookup_errors status;
+
+ status = _Objects_Name_to_id_u32( name, node, id, information );
+
+ return _Status_Object_name_errors_to_status[ status ];
+}
diff --git a/cpukit/rtems/src/semident.c b/cpukit/rtems/src/semident.c
index 37c776cf81..93c325c48d 100644
--- a/cpukit/rtems/src/semident.c
+++ b/cpukit/rtems/src/semident.c
@@ -1,17 +1,37 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
- * @file
+ * @file
+ *
+ * @ingroup ClassicSemImpl
*
- * @brief RTEMS Semaphore Name to Id
- * @ingroup ClassicSem
+ * @brief rtems_semaphore_ident() Implementation
*/
/*
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1989 On-Line Applications Research Corporation (OAR).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
@@ -19,7 +39,7 @@
#endif
#include <rtems/rtems/semimpl.h>
-#include <rtems/rtems/statusimpl.h>
+#include <rtems/rtems/objectimpl.h>
rtems_status_code rtems_semaphore_ident(
rtems_name name,
@@ -27,9 +47,5 @@ rtems_status_code rtems_semaphore_ident(
rtems_id *id
)
{
- Objects_Name_or_id_lookup_errors status;
-
- status = _Objects_Name_to_id_u32( &_Semaphore_Information, name, node, id );
-
- return _Status_Object_name_errors_to_status[ status ];
+ return _RTEMS_Name_to_id( name, node, id, &_Semaphore_Information );
}
diff --git a/cpukit/rtems/src/taskident.c b/cpukit/rtems/src/taskident.c
index d35a617c1f..501bd0b05f 100644
--- a/cpukit/rtems/src/taskident.c
+++ b/cpukit/rtems/src/taskident.c
@@ -1,53 +1,66 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
- * @file
+ * @file
+ *
+ * @ingroup ClassicTasksImpl
*
- * @brief RTEMS Task Name to Id
- * @ingroup ClassicTasks
+ * @brief rtems_task_ident() Implementation
*/
/*
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1989 On-Line Applications Research Corporation (OAR).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/score/stack.h>
#include <rtems/rtems/tasksimpl.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
+#include <rtems/rtems/objectimpl.h>
+#include <rtems/score/percpu.h>
rtems_status_code rtems_task_ident(
- rtems_name name,
- uint32_t node,
- rtems_id *id
+ rtems_name name,
+ uint32_t node,
+ rtems_id *id
)
{
- Objects_Name_or_id_lookup_errors status;
-
- if ( !id )
+ if ( id == NULL ) {
return RTEMS_INVALID_ADDRESS;
+ }
if ( name == OBJECTS_ID_OF_SELF ) {
*id = _Thread_Get_executing()->Object.id;
return RTEMS_SUCCESSFUL;
- }
+ }
- status = _Objects_Name_to_id_u32(
- &_RTEMS_tasks_Information.Objects,
+ return _RTEMS_Name_to_id(
name,
node,
- id
+ id,
+ &_RTEMS_tasks_Information.Objects
);
-
- return _Status_Object_name_errors_to_status[ status ];
}
diff --git a/cpukit/rtems/src/timerident.c b/cpukit/rtems/src/timerident.c
index b11550a744..8259507c15 100644
--- a/cpukit/rtems/src/timerident.c
+++ b/cpukit/rtems/src/timerident.c
@@ -1,42 +1,52 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
- * @file
+ * @file
+ *
+ * @ingroup ClassicTimerImpl
*
- * @brief RTEMS Timer Name to Id
- * @ingroup ClassicTimer
+ * @brief rtems_timer_ident() Implementation
*/
/*
- * COPYRIGHT (c) 1989-2002.
- * On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1989 On-Line Applications Research Corporation (OAR).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/thread.h>
#include <rtems/rtems/timerimpl.h>
-#include <rtems/score/watchdog.h>
+#include <rtems/rtems/objectimpl.h>
-rtems_status_code rtems_timer_ident(
- rtems_name name,
- rtems_id *id
-)
+rtems_status_code rtems_timer_ident( rtems_name name, rtems_id *id )
{
- Objects_Name_or_id_lookup_errors status;
-
- status = _Objects_Name_to_id_u32(
- &_Timer_Information,
+ return _RTEMS_Name_to_id(
name,
OBJECTS_SEARCH_LOCAL_NODE,
- id
+ id,
+ &_Timer_Information
);
-
- return _Status_Object_name_errors_to_status[ status ];
}