Index: cpukit/rtems/src/barrier.c
===================================================================
--- cpukit/rtems/src/barrier.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicBarrier
- *
- * @brief This source file contains a definition of the ::_Barrier_Information
- *   with zero objects.
- */
-
-/*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * 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/barrierdata.h>
-
-OBJECTS_INFORMATION_DEFINE_ZERO(
-  _Barrier,
-  OBJECTS_CLASSIC_API,
-  OBJECTS_RTEMS_BARRIERS,
-  OBJECTS_NO_STRING_NAME
-);
Index: cpukit/rtems/src/barriercreate.c
===================================================================
--- cpukit/rtems/src/barriercreate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,100 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicBarrier
- *
- * @brief This source file contains the implementation of
- *   rtems_barrier_create() and the Barrier Manager system initialization.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2006.
- *  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.
- *
- * 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/barrierimpl.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/attrimpl.h>
-#include <rtems/score/isr.h>
-#include <rtems/sysinit.h>
-
-rtems_status_code rtems_barrier_create(
-  rtems_name           name,
-  rtems_attribute      attribute_set,
-  uint32_t             maximum_waiters,
-  rtems_id            *id
-)
-{
-  Barrier_Control *the_barrier;
-  uint32_t         maximum_count;
-
-  if ( !rtems_is_name_valid( name ) ) {
-    return RTEMS_INVALID_NAME;
-  }
-
-  if ( id == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( _Attributes_Is_barrier_automatic( attribute_set ) ) {
-    if ( maximum_waiters == 0 ) {
-      return RTEMS_INVALID_NUMBER;
-    }
-
-    maximum_count = maximum_waiters;
-  } else {
-    maximum_count = CORE_BARRIER_MANUAL_RELEASE_MAXIMUM_COUNT;
-  }
-
-  the_barrier = _Barrier_Allocate();
-
-  if ( the_barrier == NULL ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_TOO_MANY;
-  }
-
-  _CORE_barrier_Initialize( &the_barrier->Barrier, maximum_count );
-
-  *id = _Objects_Open_u32( &_Barrier_Information, &the_barrier->Object, name );
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
-
-static void _Barrier_Manager_initialization( void )
-{
-  _Objects_Initialize_information( &_Barrier_Information );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Barrier_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_BARRIER,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/rtems/src/barrierdelete.c
===================================================================
--- cpukit/rtems/src/barrierdelete.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicBarrier
- *
- * @brief This source file contains the implementation of
- *   rtems_barrier_delete().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/barrierimpl.h>
-
-rtems_status_code rtems_barrier_delete(
-  rtems_id   id
-)
-{
-  Barrier_Control      *the_barrier;
-  Thread_queue_Context  queue_context;
-
-  _Objects_Allocator_lock();
-  the_barrier = _Barrier_Get( id, &queue_context );
-
-  if ( the_barrier == NULL ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_INVALID_ID;
-  }
-
-  _CORE_barrier_Acquire_critical( &the_barrier->Barrier, &queue_context );
-  _Objects_Close( &_Barrier_Information, &the_barrier->Object );
-  _CORE_barrier_Flush( &the_barrier->Barrier, &queue_context );
-  _Barrier_Free( the_barrier );
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/barrierident.c
===================================================================
--- cpukit/rtems/src/barrierident.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicBarrier
- *
- * @brief This source file contains the implementation of
- *   rtems_barrier_ident().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- * 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.
- *
- * 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/barrierimpl.h>
-#include <rtems/rtems/objectimpl.h>
-
-rtems_status_code rtems_barrier_ident( rtems_name name, rtems_id *id )
-{
-  return _RTEMS_Name_to_id(
-    name,
-    OBJECTS_SEARCH_LOCAL_NODE,
-    id,
-    &_Barrier_Information
-  );
-}
Index: cpukit/rtems/src/barrierrelease.c
===================================================================
--- cpukit/rtems/src/barrierrelease.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicBarrier
- *
- * @brief This source file contains the implementation of
- *   rtems_barrier_release().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/barrierimpl.h>
-
-rtems_status_code rtems_barrier_release(
-  rtems_id          id,
-  uint32_t         *released
-)
-{
-  Barrier_Control      *the_barrier;
-  Thread_queue_Context  queue_context;
-
-  if ( released == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_barrier = _Barrier_Get( id, &queue_context );
-
-  if ( the_barrier == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  _CORE_barrier_Acquire_critical( &the_barrier->Barrier, &queue_context );
-  *released = _CORE_barrier_Surrender(
-    &the_barrier->Barrier,
-    &queue_context
-  );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/barrierwait.c
===================================================================
--- cpukit/rtems/src/barrierwait.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,74 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicBarrier
- *
- * @brief This source file contains the implementation of
- *   rtems_barrier_wait().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/barrierimpl.h>
-#include <rtems/rtems/statusimpl.h>
-
-THREAD_QUEUE_OBJECT_ASSERT(
-  Barrier_Control,
-  Barrier.Wait_queue,
-  BARRIER_CONTROL
-);
-
-rtems_status_code rtems_barrier_wait(
-  rtems_id        id,
-  rtems_interval  timeout
-)
-{
-  Barrier_Control      *the_barrier;
-  Thread_queue_Context  queue_context;
-  Status_Control        status;
-
-  the_barrier = _Barrier_Get( id, &queue_context );
-
-  if ( the_barrier == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  _Thread_queue_Context_set_enqueue_timeout_ticks( &queue_context, timeout );
-  status = _CORE_barrier_Seize(
-    &the_barrier->Barrier,
-    _Thread_Executing,
-    true,
-    &queue_context
-  );
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/clockgetsecondssinceepoch.c
===================================================================
--- cpukit/rtems/src/clockgetsecondssinceepoch.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_get_seconds_since_epoch().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/clock.h>
-#include <rtems/score/todimpl.h>
-
-rtems_status_code rtems_clock_get_seconds_since_epoch(
-  rtems_interval *the_interval
-)
-{
-  if ( !the_interval )
-    return RTEMS_INVALID_ADDRESS;
-
-  if ( !_TOD_Is_set() )
-    return RTEMS_NOT_DEFINED;
-
-  *the_interval = _TOD_Seconds_since_epoch();
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/clockgettickspersecond.c
===================================================================
--- cpukit/rtems/src/clockgettickspersecond.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_get_ticks_per_second().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/clock.h>
-
-static rtems_interval _RTEMS_Clock_get_ticks_per_second( void )
-{
-  return rtems_clock_get_ticks_per_second();
-}
-
-#undef rtems_clock_get_ticks_per_second
-
-rtems_interval rtems_clock_get_ticks_per_second( void )
-{
-  return _RTEMS_Clock_get_ticks_per_second();
-}
Index: cpukit/rtems/src/clockgettickssinceboot.c
===================================================================
--- cpukit/rtems/src/clockgettickssinceboot.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_get_ticks_since_boot().
- */
-
-/*
- * Copyright (C) 2022 embedded brains GmbH & Co. KG
- *
- * 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/clock.h>
-
-static rtems_interval _RTEMS_Clock_get_ticks_since_boot( void )
-{
-  return rtems_clock_get_ticks_since_boot();
-}
-
-#undef rtems_clock_get_ticks_since_boot
-
-rtems_interval rtems_clock_get_ticks_since_boot( void )
-{
-  return _RTEMS_Clock_get_ticks_since_boot();
-}
Index: cpukit/rtems/src/clockgettod.c
===================================================================
--- cpukit/rtems/src/clockgettod.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,159 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_get_tod().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/clock.h>
-#include <rtems/score/todimpl.h>
-#include <rtems/config.h>
-
-#define RTEMS_SECS_PER_MINUTE (60UL)
-#define RTEMS_MINUTE_PER_HOUR (60UL)
-#define RTEMS_SECS_PER_HOUR   (RTEMS_SECS_PER_MINUTE * RTEMS_MINUTE_PER_HOUR)
-#define RTEMS_HOURS_PER_DAY   (24UL)
-#define RTEMS_SECS_PER_DAY    (RTEMS_SECS_PER_HOUR * RTEMS_HOURS_PER_DAY)
-#define RTEMS_DAYS_PER_YEAR   (365UL)
-#define RTEMS_YEAR_BASE       (1970UL)
-
-static bool _Leap_year(
-  uint32_t year
-)
-{
-  return (((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0);
-}
-
-static uint32_t _Leap_years_before(
-  uint32_t year
-)
-{
-  year -= 1;
-  return (year / 4) - (year / 100) + (year / 400);
-}
-
-static uint32_t _Leap_years_between(
-  uint32_t from, uint32_t to
-)
-{
-  return _Leap_years_before( to ) - _Leap_years_before( from + 1 );
-}
-
-static uint32_t _Year_day_as_month(
-  uint32_t year, uint32_t *day
-)
-{
-  const uint16_t* days_to_date;
-  uint32_t        month = 0;
-
-  if ( _Leap_year( year ) )
-    days_to_date = _TOD_Days_to_date[0];
-  else
-    days_to_date = _TOD_Days_to_date[1];
-
-  days_to_date += 2;
-
-  while (month < 11) {
-    if (*day < *days_to_date)
-      break;
-    ++month;
-    ++days_to_date;
-  }
-
-  *day -= *(days_to_date - 1);
-
-  return month;
-}
-
-rtems_status_code rtems_clock_get_tod(
-  rtems_time_of_day  *time_of_day
-)
-{
-  struct timeval now;
-  uint32_t       days;
-  uint32_t       day_secs;
-  uint32_t       year;
-  uint32_t       year_days;
-  uint32_t       leap_years;
-
-  if ( !time_of_day )
-    return RTEMS_INVALID_ADDRESS;
-
-  if ( !_TOD_Is_set() )
-    return RTEMS_NOT_DEFINED;
-
-  /* Obtain the current time */
-  _TOD_Get_timeval( &now );
-
-  /*
-   * How many days and how many seconds in the day?
-   *
-   * A 32-bit integer can represent enough days for several 1000 years.  When
-   * the current time is valid, the integer conversions below are well defined.
-   */
-  days = (uint32_t) ( now.tv_sec / RTEMS_SECS_PER_DAY );
-  day_secs = (uint32_t) ( now.tv_sec % RTEMS_SECS_PER_DAY );
-
-  /* How many non-leap year years ? */
-  year = ( days / RTEMS_DAYS_PER_YEAR ) + RTEMS_YEAR_BASE;
-
-  /* Determine the number of leap years. */
-  leap_years = _Leap_years_between( RTEMS_YEAR_BASE, year );
-
-  /* Adjust the remaining number of days based on the leap years. */
-  year_days = ( days - leap_years ) % RTEMS_DAYS_PER_YEAR;
-
-  /* Adjust the year and days in the year if in the leap year overflow. */
-  if ( leap_years > ( days % RTEMS_DAYS_PER_YEAR ) ) {
-    year -= 1;
-    if ( _Leap_year( year ) ) {
-      year_days += 1;
-    }
-  }
-
-  time_of_day->year   = year;
-  time_of_day->month  = _Year_day_as_month( year, &year_days ) + 1;
-  time_of_day->day    = year_days + 1;
-  time_of_day->hour   = day_secs / RTEMS_SECS_PER_HOUR;
-  time_of_day->minute = day_secs % RTEMS_SECS_PER_HOUR;
-  time_of_day->second = time_of_day->minute % RTEMS_SECS_PER_MINUTE;
-  time_of_day->minute = time_of_day->minute / RTEMS_SECS_PER_MINUTE;
-  time_of_day->ticks  = now.tv_usec /
-    rtems_configuration_get_microseconds_per_tick( );
-
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/clockgettodtimeval.c
===================================================================
--- cpukit/rtems/src/clockgettodtimeval.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_get_tod_timeval().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/clock.h>
-#include <rtems/score/todimpl.h>
-
-rtems_status_code rtems_clock_get_tod_timeval(
-  struct timeval  *time_of_day
-)
-{
-  if ( !time_of_day )
-    return RTEMS_INVALID_ADDRESS;
-
-  if ( !_TOD_Is_set() )
-    return RTEMS_NOT_DEFINED;
-
-  _TOD_Get_timeval( time_of_day );
-
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/clockgetuptime.c
===================================================================
--- cpukit/rtems/src/clockgetuptime.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_get_uptime().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/clock.h>
-#include <rtems/score/todimpl.h>
-
-/*
- *  rtems_clock_get_uptime
- *
- *  This directive obtains the system uptime.  A timestamp is the seconds
- *  and nanoseconds since boot.
- *
- *  Input parameters:
- *    timestamp - pointer to the timestamp
- *
- *  Output parameters:
- *    *uptime           - filled in
- *    RTEMS_SUCCESSFUL - if successful
- *    error code       - if unsuccessful
- */
-rtems_status_code rtems_clock_get_uptime(
-  struct timespec *uptime
-)
-{
-  if ( !uptime )
-    return RTEMS_INVALID_ADDRESS;
-
-  _TOD_Get_zero_based_uptime_as_timespec( uptime );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/clockgetuptimenanoseconds.c
===================================================================
--- cpukit/rtems/src/clockgetuptimenanoseconds.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_get_uptime_nanoseconds().
- */
-
-/*
- * Copyright (c) 2013 Chris Johns <chrisj@rtems.org>.  All rights reserved.
- *
- * 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/clock.h>
-#include <rtems/score/timestampimpl.h>
-#include <rtems/score/todimpl.h>
-
-uint64_t rtems_clock_get_uptime_nanoseconds( void )
-{
-  Timestamp_Control  snapshot_as_timestamp;
-
-  _TOD_Get_zero_based_uptime(&snapshot_as_timestamp);
-
-  return _Timestamp_Get_as_nanoseconds(&snapshot_as_timestamp);
-}
Index: cpukit/rtems/src/clockgetuptimeseconds.c
===================================================================
--- cpukit/rtems/src/clockgetuptimeseconds.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,28 +1,0 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_get_uptime_seconds().
- */
-
-/*
- * Copyright (c) 2018 embedded brains GmbH & Co. KG
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/rtems/clock.h>
-#include <rtems/score/timecounter.h>
-
-time_t rtems_clock_get_uptime_seconds( void )
-{
-  return _Timecounter_Time_uptime - 1;
-}
Index: cpukit/rtems/src/clockgetuptimetimeval.c
===================================================================
--- cpukit/rtems/src/clockgetuptimetimeval.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_get_uptime_timeval().
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * 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/clock.h>
-#include <rtems/score/timestampimpl.h>
-#include <rtems/score/todimpl.h>
-
-void rtems_clock_get_uptime_timeval( struct timeval *uptime )
-{
-  Timestamp_Control snapshot_as_timestamp;
-
-  _TOD_Get_zero_based_uptime( &snapshot_as_timestamp );
-  _Timestamp_To_timeval( &snapshot_as_timestamp, uptime );
-}
Index: cpukit/rtems/src/clockset.c
===================================================================
--- cpukit/rtems/src/clockset.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_set().
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  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.
- *
- * 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/clockimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/todimpl.h>
-#include <rtems/config.h>
-
-rtems_status_code rtems_clock_set(
-  const rtems_time_of_day *tod
-)
-{
-  rtems_status_code status;
-  Status_Control    score_status;
-  struct timespec   tod_as_timespec;
-  ISR_lock_Context  lock_context;
-
-  status = _TOD_Validate( tod, TOD_ENABLE_TICKS_VALIDATION );
-
-  if ( status != RTEMS_SUCCESSFUL ) {
-    return status;
-  }
-
-  tod_as_timespec.tv_sec = _TOD_To_seconds( tod );
-  tod_as_timespec.tv_nsec = tod->ticks
-    * rtems_configuration_get_nanoseconds_per_tick();
-
-  _TOD_Lock();
-  _TOD_Acquire( &lock_context );
-  score_status = _TOD_Set( &tod_as_timespec, &lock_context );
-  _TOD_Unlock();
-
-  return _Status_Get( score_status );
-}
Index: cpukit/rtems/src/clocktick.c
===================================================================
--- cpukit/rtems/src/clocktick.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   rtems_clock_tick().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2009.
- *  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.
- *
- * 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/clock.h>
-#include <rtems/score/timecounter.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_clock_tick( void )
-{
-  ISR_lock_Context lock_context;
-
-  _Timecounter_Acquire( &lock_context );
-  _Timecounter_Tick_simple(
-    rtems_configuration_get_microseconds_per_tick(),
-    0,
-    &lock_context
-  );
-
-  if ( _Thread_Dispatch_is_enabled() ) {
-    _Thread_Dispatch();
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/clocktodtoseconds.c
===================================================================
--- cpukit/rtems/src/clocktodtoseconds.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,85 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   _TOD_To_seconds().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/clockimpl.h>
-#include <rtems/score/todimpl.h>
-
-const uint16_t _TOD_Days_to_date[ 2 ][ 13 ] = {
-  { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 },
-  { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }
-};
-
-/*
- *  The following array contains the number of days in the years
- *  since the last leap year.  The index should be 0 for leap
- *  years, and the number of years since the beginning of a leap
- *  year otherwise.
- */
-const uint16_t   _TOD_Days_since_last_leap_year[4] = { 0, 366, 731, 1096 };
-
-
-Watchdog_Interval   _TOD_To_seconds(
-  const rtems_time_of_day *the_tod
-)
-{
-  uint32_t time;
-  size_t   leap_year_index;
-
-  time = the_tod->day - 1;
-
-  leap_year_index = _TOD_Get_leap_year_index( the_tod->year );
-  time += _TOD_Days_to_date[ leap_year_index ][ the_tod->month ];
-
-  time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) *
-            ( (TOD_DAYS_PER_YEAR * 4) + 1);
-
-  time += _TOD_Days_since_last_leap_year[ the_tod->year % 4 ];
-
-  time *= TOD_SECONDS_PER_DAY;
-
-  time += ((the_tod->hour * TOD_MINUTES_PER_HOUR) + the_tod->minute)
-             * TOD_SECONDS_PER_MINUTE;
-
-  time += the_tod->second;
-  time += TOD_SECONDS_1970_THROUGH_1988;
-
-  return( time );
-}
Index: cpukit/rtems/src/clocktodvalidate.c
===================================================================
--- cpukit/rtems/src/clocktodvalidate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,110 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicClock
- *
- * @brief This source file contains the implementation of
- *   _TOD_Validate().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/clockimpl.h>
-#include <rtems/score/todimpl.h>
-#include <rtems/config.h>
-
-/*
- *  The following array contains the number of days in all months.
- *  The first dimension should be 0 for leap years, and 1 otherwise.
- *  The second dimension should range from 1 to 12 for January to
- *  December, respectively.
- */
-static const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = {
-  { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
-  { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
-};
-
-rtems_status_code _TOD_Validate(
-  const rtems_time_of_day *the_tod,
-  TOD_Ticks_validation     ticks_validation
-)
-{
-  size_t  leap_year_index;
-  uint32_t days_in_month;
-  uint32_t ticks_per_second;
-  uint32_t ticks_mask;
-
-  if ( the_tod == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  ticks_per_second = rtems_clock_get_ticks_per_second();
-  ticks_mask = (uint32_t) ticks_validation;
-
-  if ( ( the_tod->ticks & ticks_mask ) >= ticks_per_second ) {
-    return RTEMS_INVALID_CLOCK;
-  }
-
-  if ( the_tod->second >= TOD_SECONDS_PER_MINUTE ) {
-    return RTEMS_INVALID_CLOCK;
-  }
-
-  if ( the_tod->minute >= TOD_MINUTES_PER_HOUR ) {
-    return RTEMS_INVALID_CLOCK;
-  }
-
-  if ( the_tod->hour >= TOD_HOURS_PER_DAY ) {
-    return RTEMS_INVALID_CLOCK;
-  }
-
-  if ( the_tod->month == 0 || the_tod->month > TOD_MONTHS_PER_YEAR ) {
-    return RTEMS_INVALID_CLOCK;
-  }
-
-  if ( the_tod->year < TOD_BASE_YEAR || the_tod->year > TOD_LATEST_YEAR ) {
-    return RTEMS_INVALID_CLOCK;
-  }
-
-  if ( the_tod->day == 0 ) {
-    return RTEMS_INVALID_CLOCK;
-  }
-
-  leap_year_index = _TOD_Get_leap_year_index( the_tod->year );
-  days_in_month = _TOD_Days_per_month[ leap_year_index ][ the_tod->month ];
-
-  if ( the_tod->day > days_in_month ) {
-    return RTEMS_INVALID_CLOCK;
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/dpmem.c
===================================================================
--- cpukit/rtems/src/dpmem.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/dpmem.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,48 +1,268 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicDPMem
- *
- * @brief This source file contains a definition of
- *   ::_Dual_ported_memory_Information with zero objects.
- */
-
 /*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * 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/dpmemdata.h>
-
-OBJECTS_INFORMATION_DEFINE_ZERO(
-  _Dual_ported_memory,
-  OBJECTS_CLASSIC_API,
-  OBJECTS_RTEMS_PORTS,
-  OBJECTS_NO_STRING_NAME
-);
+ *  Dual Port Memory Manager
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/address.h>
+#include <rtems/dpmem.h>
+#include <rtems/object.h>
+#include <rtems/thread.h>
+
+/*PAGE
+ *
+ *  _Dual_ported_memory_Manager_initialization
+ *
+ *  This routine initializes all dual-ported memory manager related
+ *  data structures.
+ *
+ *  Input parameters:
+ *    maximum_ports - number of ports to initialize
+ *
+ *  Output parameters:  NONE
+ */
+
+void _Dual_ported_memory_Manager_initialization(
+  unsigned32 maximum_ports
+)
+{
+  _Objects_Initialize_information(
+     &_Dual_ported_memory_Information,
+     FALSE,
+     maximum_ports,
+     sizeof( Dual_ported_memory_Control )
+  );
+}
+
+/*PAGE
+ *
+ *  rtems_port_create
+ *
+ *  This directive creates a port into a dual-ported memory area.
+ *
+ *  Input parameters:
+ *    name           - user defined port name
+ *    internal_start - internal start address of port
+ *    external_start - external start address of port
+ *    length         - physical length in bytes
+ *    id             - address of port id to set
+ *
+ *  Output parameters:
+ *    id       - port id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_port_create(
+  Objects_Name  name,
+  void         *internal_start,
+  void         *external_start,
+  unsigned32    length,
+  Objects_Id   *id
+)
+{
+  register Dual_ported_memory_Control *the_port;
+
+  if ( !_Objects_Is_name_valid( name) )
+    return ( RTEMS_INVALID_NAME );
+
+  if ( !_Addresses_Is_aligned( internal_start ) ||
+       !_Addresses_Is_aligned( external_start ) )
+    return( RTEMS_INVALID_ADDRESS );
+
+  _Thread_Disable_dispatch();             /* to prevent deletion */
+
+  the_port = _Dual_ported_memory_Allocate();
+
+  if ( !the_port ) {
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  the_port->internal_base = internal_start;
+  the_port->external_base = external_start;
+  the_port->length        = length - 1;
+
+  _Objects_Open( &_Dual_ported_memory_Information,
+                 &the_port->Object, name );
+  *id = the_port->Object.id;
+  _Thread_Enable_dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_port_ident
+ *
+ *  This directive returns the system ID associated with
+ *  the port name.
+ *
+ *  Input parameters:
+ *    name - user defined port name
+ *    id   - pointer to port id
+ *
+ *  Output parameters:
+ *    *id      - port id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_port_ident(
+  Objects_Name  name,
+  Objects_Id   *id
+)
+{
+  return(
+    _Objects_Name_to_id(
+      &_Dual_ported_memory_Information,
+      name,
+      RTEMS_SEARCH_ALL_NODES,
+      id
+    )
+  );
+}
+
+/*PAGE
+ *
+ *  rtems_port_delete
+ *
+ *  This directive allows a thread to delete a dual-ported memory area
+ *  specified by the dual-ported memory identifier.
+ *
+ *  Input parameters:
+ *    id - dual-ported memory area id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_port_delete(
+  Objects_Id id
+)
+{
+  register Dual_ported_memory_Control *the_port;
+  Objects_Locations                    location;
+
+  the_port = _Dual_ported_memory_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:        /* this error cannot be returned */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object );
+      _Dual_ported_memory_Free( the_port );
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_port_internal_to_external
+ *
+ *  This directive converts an internal dual-ported memory address to an
+ *  external dual-ported memory address.  If the given internal address
+ *  is an invalid dual-ported address, then the external address is set
+ *  to the given internal address.
+ *
+ *  Input parameters:
+ *    id       - id of dual-ported memory object
+ *    internal - internal address to set
+ *    external - pointer to external address
+ *
+ *  Output parameters:
+ *    external          - external address
+ *    RTEMS_SUCCESSFUL - always succeeds
+ */
+
+rtems_status_code rtems_port_internal_to_external(
+  Objects_Id   id,
+  void        *internal,
+  void       **external
+)
+{
+  register Dual_ported_memory_Control *the_port;
+  Objects_Locations                    location;
+  unsigned32                           ending;
+
+  the_port = _Dual_ported_memory_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:        /* this error cannot be returned */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      ending = _Addresses_Subtract( internal, the_port->internal_base );
+      if ( ending > the_port->length )
+        *external = internal;
+      else
+        *external = _Addresses_Add_offset( the_port->external_base,
+                                           ending );
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_port_external_to_internal
+ *
+ *  This directive converts an external dual-ported memory address to an
+ *  internal dual-ported memory address.  If the given external address
+ *  is an invalid dual-ported address, then the internal address is set
+ *  to the given external address.
+ *
+ *  Input parameters:
+ *    id       - id of dp memory object
+ *    external - external address
+ *    internal - pointer of internal address to set
+ *
+ *  Output parameters:
+ *    internal          - internal address
+ *    RTEMS_SUCCESSFUL - always succeeds
+ */
+
+rtems_status_code rtems_port_external_to_internal(
+  Objects_Id   id,
+  void        *external,
+  void       **internal
+)
+{
+  register Dual_ported_memory_Control *the_port;
+  Objects_Locations                    location;
+  unsigned32                           ending;
+
+  the_port = _Dual_ported_memory_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:        /* this error cannot be returned */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      ending = _Addresses_Subtract( external, the_port->external_base );
+      if ( ending > the_port->length )
+        *internal = external;
+      else
+        *internal = _Addresses_Add_offset( the_port->internal_base,
+                                           ending );
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
Index: cpukit/rtems/src/dpmemcreate.c
===================================================================
--- cpukit/rtems/src/dpmemcreate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,99 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicDPMem
- *
- * @brief This source file contains the implementation of
- *   rtems_port_create() and the Dual-Ported Memory Manager system
- *   initialization.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/dpmemimpl.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/address.h>
-#include <rtems/score/thread.h>
-#include <rtems/sysinit.h>
-
-rtems_status_code rtems_port_create(
-  rtems_name    name,
-  void         *internal_start,
-  void         *external_start,
-  uint32_t      length,
-  rtems_id     *id
-)
-{
-  Dual_ported_memory_Control *the_port;
-
-  if ( !rtems_is_name_valid( name ) )
-    return RTEMS_INVALID_NAME;
-
-  if ( !id )
-    return RTEMS_INVALID_ADDRESS;
-
-  if ( !_Addresses_Is_aligned( internal_start ) ||
-       !_Addresses_Is_aligned( external_start ) )
-    return RTEMS_INVALID_ADDRESS;
-
-  the_port = _Dual_ported_memory_Allocate();
-
-  if ( !the_port ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_TOO_MANY;
-  }
-
-  the_port->internal_base = internal_start;
-  the_port->external_base = external_start;
-  the_port->length        = length - 1;
-
-  *id = _Objects_Open_u32(
-    &_Dual_ported_memory_Information,
-    &the_port->Object,
-    name
-  );
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
-
-static void _Dual_ported_memory_Manager_initialization( void )
-{
-  _Objects_Initialize_information( &_Dual_ported_memory_Information );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Dual_ported_memory_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/rtems/src/dpmemdelete.c
===================================================================
--- cpukit/rtems/src/dpmemdelete.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicDPMem
- *
- * @brief This source file contains the implementation of
- *   rtems_port_delete().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/dpmemimpl.h>
-
-rtems_status_code rtems_port_delete(
-  rtems_id id
-)
-{
-  Dual_ported_memory_Control *the_port;
-  ISR_lock_Context            lock_context;
-
-  _Objects_Allocator_lock();
-  the_port = _Dual_ported_memory_Get( id, &lock_context );
-
-  if ( the_port == NULL ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_INVALID_ID;
-  }
-
-  _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object );
-  _ISR_lock_ISR_enable( &lock_context );
-  _Dual_ported_memory_Free( the_port );
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/dpmemexternal2internal.c
===================================================================
--- cpukit/rtems/src/dpmemexternal2internal.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicDPMem
- *
- * @brief This source file contains the implementation of
- *   rtems_port_external_to_internal().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/dpmemimpl.h>
-#include <rtems/score/address.h>
-
-rtems_status_code rtems_port_external_to_internal(
-  rtems_id   id,
-  void      *external,
-  void     **internal
-)
-{
-  Dual_ported_memory_Control *the_port;
-  ISR_lock_Context            lock_context;
-  uintptr_t                   length;
-
-  if ( internal == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_port = _Dual_ported_memory_Get( id, &lock_context );
-
-  if ( the_port == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  length = (uintptr_t) _Addresses_Subtract( external, the_port->external_base );
-
-  if ( length > the_port->length ) {
-    *internal = external;
-  } else {
-    *internal = _Addresses_Add_offset( the_port->internal_base, length );
-  }
-
-  _ISR_lock_ISR_enable( &lock_context );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/dpmemident.c
===================================================================
--- cpukit/rtems/src/dpmemident.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicDPMem
- *
- * @brief This source file contains the implementation of
- *   rtems_port_ident().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- * 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.
- *
- * 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/dpmemimpl.h>
-#include <rtems/rtems/objectimpl.h>
-
-rtems_status_code rtems_port_ident(
-  rtems_name  name,
-  rtems_id   *id
-)
-{
-  return _RTEMS_Name_to_id(
-    name,
-    OBJECTS_SEARCH_ALL_NODES,
-    id,
-    &_Dual_ported_memory_Information
-  );
-}
Index: cpukit/rtems/src/dpmeminternal2external.c
===================================================================
--- cpukit/rtems/src/dpmeminternal2external.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicDPMem
- *
- * @brief This source file contains the implementation of
- *   rtems_port_internal_to_external().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/dpmemimpl.h>
-#include <rtems/score/address.h>
-
-rtems_status_code rtems_port_internal_to_external(
-  rtems_id   id,
-  void      *internal,
-  void     **external
-)
-{
-  Dual_ported_memory_Control *the_port;
-  ISR_lock_Context            lock_context;
-  uintptr_t                   length;
-
-  if ( external == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_port = _Dual_ported_memory_Get( id, &lock_context );
-
-  if ( the_port == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  length = (uintptr_t) _Addresses_Subtract( internal, the_port->internal_base );
-
-  if ( length > the_port->length ) {
-    *external = internal;
-  } else {
-    *external = _Addresses_Add_offset( the_port->external_base, length );
-  }
-
-  _ISR_lock_ISR_enable( &lock_context );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/event.c
===================================================================
--- cpukit/rtems/src/event.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ cpukit/rtems/src/event.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,294 @@
+/*
+ *  Event Manager
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/event.h>
+#include <rtems/isr.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/states.h>
+#include <rtems/thread.h>
+
+/*PAGE
+ *
+ *  rtems_event_send
+ *
+ *  This directive allows a thread send an event set to another thread.
+ *
+ *  Input parameters:
+ *    id    - thread id
+ *    event - event set
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_event_send(
+  Objects_Id         id,
+  rtems_event_set event_in
+)
+{
+  register Thread_Control *the_thread;
+  Objects_Locations        location;
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      return(
+        _Event_MP_Send_request_packet(
+          EVENT_MP_SEND_REQUEST,
+          id,
+          event_in
+        )
+      );
+    case OBJECTS_LOCAL:
+      _Event_sets_Post( event_in, &the_thread->pending_events );
+      _Event_Surrender( the_thread );
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_event_receive
+ *
+ *  This directive allows a thread to receive a set of events.
+ *
+ *  Input parameters:
+ *    event_in   - input event condition
+ *    option_set - options
+ *    ticks      - number of ticks to wait (0 means wait forever)
+ *    event_out  - pointer to output event set
+ *
+ *  Output parameters:
+ *    event out         - event set
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_event_receive(
+  rtems_event_set  event_in,
+  rtems_option     option_set,
+  rtems_interval   ticks,
+  rtems_event_set *event_out
+)
+{
+  if ( _Event_sets_Is_empty( event_in ) ) {
+    *event_out = _Thread_Executing->pending_events;
+    return( RTEMS_SUCCESSFUL );
+  }
+
+  _Thread_Disable_dispatch();
+  _Event_Seize( event_in, option_set, ticks );
+  _Thread_Enable_dispatch();
+  *event_out = _Thread_Executing->events_out;
+  return( _Thread_Executing->Wait.return_code );
+}
+
+/*PAGE
+ *
+ *  _Event_Seize
+ *
+ *  This routine attempts to satisfy the requested event condition
+ *  for the running thread.
+ *
+ *  Input parameters:
+ *    event_in   - the event condition to satisfy
+ *    option_set - acquire event options
+ *    ticks      - interval to wait
+ *
+ *  Output parameters: NONE
+ *
+ *  INTERRUPT LATENCY:
+ *    available
+ *    wait
+ *    check sync
+ */
+
+void _Event_Seize(
+  rtems_event_set event_in,
+  rtems_option    option_set,
+  rtems_interval  ticks
+)
+{
+  Thread_Control   *executing;
+  rtems_event_set   seized_events;
+  rtems_event_set   pending_events;
+  ISR_Level         level;
+
+  executing = _Thread_Executing;
+  executing->Wait.return_code = RTEMS_SUCCESSFUL;
+
+  _ISR_Disable( level );
+  pending_events = executing->pending_events;
+  seized_events  = _Event_sets_Get( pending_events, event_in );
+
+  if ( !_Event_sets_Is_empty( seized_events ) &&
+       (seized_events == event_in || _Options_Is_any( option_set )) ) {
+    executing->pending_events =
+      _Event_sets_Clear( pending_events, seized_events );
+    _ISR_Enable( level );
+    executing->events_out = seized_events;
+    return;
+  }
+
+  if ( _Options_Is_no_wait( option_set ) ) {
+    _ISR_Enable( level );
+    executing->Wait.return_code = RTEMS_UNSATISFIED;
+    executing->events_out = seized_events;
+    return;
+  }
+
+  _Event_Sync = TRUE;
+  executing->Wait.option_set            = option_set;
+  executing->Wait.Extra.event_condition = event_in;
+
+  _ISR_Enable( level );
+  _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT );
+
+  if ( ticks ) {
+    _Watchdog_Initialize(
+      &executing->Timer,
+      _Event_Timeout,
+      executing->Object.id,
+      NULL
+    );
+    _Watchdog_Insert_ticks(
+      &executing->Timer,
+      ticks,
+      WATCHDOG_NO_ACTIVATE
+    );
+  }
+
+  _ISR_Disable( level );
+  if ( _Event_Sync == TRUE ) {
+    _Event_Sync = FALSE;
+    if ( ticks )
+      _Watchdog_Activate( &executing->Timer );
+    _ISR_Enable( level );
+    return;
+  }
+  _ISR_Enable( level );
+  (void) _Watchdog_Remove( &executing->Timer );
+  _Thread_Unblock( executing );
+  return;
+}
+
+/*PAGE
+ *
+ *  _Event_Surrender
+ *
+ *  This routines remove a thread from the specified threadq.
+ *
+ *  Input parameters:
+ *    the_thread - pointer to thread to be dequeued
+ *
+ *  Output parameters: NONE
+ *
+ *  INTERRUPT LATENCY:
+ *    before flash
+ *    after flash
+ *    check sync
+ */
+
+void _Event_Surrender(
+  Thread_Control *the_thread
+)
+{
+  ISR_Level          level;
+  rtems_event_set pending_events;
+  rtems_event_set event_condition;
+  rtems_event_set seized_events;
+
+  _ISR_Disable( level );
+  pending_events  = the_thread->pending_events;
+  event_condition = the_thread->Wait.Extra.event_condition;
+
+  seized_events = _Event_sets_Get( pending_events, event_condition );
+
+  if ( !_Event_sets_Is_empty( seized_events ) ) {
+    if ( _States_Is_waiting_for_event( the_thread->current_state ) ) {
+      if ( seized_events == event_condition ||
+                    _Options_Is_any( the_thread->Wait.option_set ) ) {
+        the_thread->pending_events =
+           _Event_sets_Clear( pending_events, seized_events );
+        (rtems_event_set *)the_thread->events_out = seized_events;
+
+        _ISR_Flash( level );
+
+        if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
+          _ISR_Enable( level );
+          _Thread_Unblock( the_thread );
+        }
+        else {
+          _Watchdog_Deactivate( &the_thread->Timer );
+          _ISR_Enable( level );
+          (void) _Watchdog_Remove( &the_thread->Timer );
+          _Thread_Unblock( the_thread );
+        }
+        return;
+      }
+    }
+    else if ( _Thread_Is_executing( the_thread ) && _Event_Sync == TRUE ) {
+      if ( seized_events == event_condition ||
+                    _Options_Is_any( the_thread->Wait.option_set ) ) {
+        the_thread->pending_events =
+           _Event_sets_Clear( pending_events,seized_events );
+        (rtems_event_set *)the_thread->events_out = seized_events;
+        _Event_Sync = FALSE;
+      }
+    }
+  }
+  _ISR_Enable( level );
+}
+
+/*PAGE
+ *
+ *  _Event_Timeout
+ *
+ *  This routine processes a thread which timeouts while waiting to
+ *  receive an event_set. It is called by the watchdog handler.
+ *
+ *  Input parameters:
+ *    id - thread id
+ *
+ *  Output parameters: NONE
+ */
+
+void _Event_Timeout(
+  Objects_Id  id,
+  void       *ignored
+)
+{
+  Thread_Control *the_thread;
+  Objects_Locations      location;
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+    case OBJECTS_REMOTE:  /* impossible */
+      break;
+    case OBJECTS_LOCAL:
+      the_thread->Wait.return_code = RTEMS_TIMEOUT;
+      _Thread_Unblock( the_thread );
+      _Thread_Unnest_dispatch();
+      break;
+  }
+}
Index: cpukit/rtems/src/eventmp.c
===================================================================
--- cpukit/rtems/src/eventmp.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/eventmp.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,110 +1,87 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
+/*
+ *  Multiprocessing Support for the Event Manager
  *
- * @ingroup RTEMSImplClassicEventMP
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
  *
- * @brief This source file contains the implementation to support the Event
- *   Manager in multiprocessing (MP) configurations.
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
  */
 
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
+#include <rtems/system.h>
+#include <rtems/event.h>
+#include <rtems/mpci.h>
+#include <rtems/mppkt.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/states.h>
+#include <rtems/thread.h>
+
+/*PAGE
  *
- * 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.
+ *  _Event_MP_Send_process_packet
  *
- * 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.
+ *  This subprogram is not needed since there are no process
+ *  packets to be sent by this manager.
+ *
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+/*PAGE
+ *
+ *  _Event_MP_Send_request_packet
+ *
+ */
 
-#include <rtems/rtems/eventimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/statesimpl.h>
-
-/**
- *  The following enumerated type defines the list of
- *  remote event operations.
- */
-typedef enum {
-  EVENT_MP_SEND_REQUEST  =  0,
-  EVENT_MP_SEND_RESPONSE =  1
-}   Event_MP_Remote_operations;
-
-/**
- *  The following data structure defines the packet used to perform
- *  remote event operations.
- */
-typedef struct {
-  rtems_packet_prefix         Prefix;
-  Event_MP_Remote_operations  operation;
-  rtems_event_set             event_in;
-}   Event_MP_Packet;
-
-RTEMS_STATIC_ASSERT(
-  sizeof(Event_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE,
-  Event_MP_Packet
-);
-
-static Event_MP_Packet *_Event_MP_Get_packet( Objects_Id id )
-{
-  if ( !_Thread_MP_Is_remote( id ) ) {
-    return NULL;
-  }
-
-  return (Event_MP_Packet *) _MPCI_Get_packet();
-}
-
-rtems_status_code _Event_MP_Send(
-  rtems_id        id,
-  rtems_event_set event_in
+rtems_status_code _Event_MP_Send_request_packet (
+  Event_MP_Remote_operations operation,
+  Objects_Id                 event_id,
+  rtems_event_set         event_in
 )
 {
   Event_MP_Packet *the_packet;
-  Status_Control   status;
 
-  the_packet = _Event_MP_Get_packet( id );
-  if ( the_packet == NULL ) {
-    return RTEMS_INVALID_ID;
+  switch ( operation ) {
+
+    case EVENT_MP_SEND_REQUEST:
+
+      the_packet                    = _Event_MP_Get_packet();
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_EVENT;
+      the_packet->Prefix.length     = sizeof ( Event_MP_Packet );
+      the_packet->Prefix.to_convert = sizeof ( Event_MP_Packet );
+      the_packet->operation         = operation;
+      the_packet->Prefix.id         = event_id;
+      the_packet->event_in          = event_in;
+
+      return
+        _MPCI_Send_request_packet(
+          rtems_get_node( event_id ),
+          &the_packet->Prefix,
+          STATES_READY
+        );
+
+      break;
+
+    case EVENT_MP_SEND_RESPONSE:
+      break;
+
   }
-
-  the_packet->Prefix.the_class  = MP_PACKET_EVENT;
-  the_packet->Prefix.length     = sizeof ( *the_packet );
-  the_packet->Prefix.to_convert = sizeof ( *the_packet );
-  the_packet->operation         = EVENT_MP_SEND_REQUEST;
-  the_packet->Prefix.id         = id;
-  the_packet->event_in          = event_in;
-
-  status = _MPCI_Send_request_packet(
-    _Objects_Get_node( id ),
-    &the_packet->Prefix,
-    STATES_READY
-  );
-  return _Status_Get( status );
+  /*
+   *  The following line is included to satisfy compilers which
+   *  produce warnings when a function does not end with a return.
+   */
+  return RTEMS_SUCCESSFUL;
 }
 
-static void _Event_MP_Send_response_packet (
+/*PAGE
+ *
+ *  _Event_MP_Send_response_packet
+ *
+ */
+
+void _Event_MP_Send_response_packet (
   Event_MP_Remote_operations  operation,
   Thread_Control             *the_thread
@@ -127,5 +104,5 @@
 
       _MPCI_Send_response_packet(
-        _Objects_Get_node( the_packet->Prefix.source_tid ),
+        rtems_get_node( the_packet->Prefix.source_tid ),
         &the_packet->Prefix
       );
@@ -138,4 +115,11 @@
 }
 
+/*PAGE
+ *
+ *
+ *  _Event_MP_Process_packet
+ *
+ */
+
 void _Event_MP_Process_packet (
   rtems_packet_prefix  *the_packet_prefix
@@ -143,4 +127,5 @@
 {
   Event_MP_Packet *the_packet;
+  Thread_Control  *the_thread;
 
   the_packet = (Event_MP_Packet *) the_packet_prefix;
@@ -161,15 +146,17 @@
       break;
 
-    case EVENT_MP_SEND_RESPONSE: {
-      _MPCI_Process_response( the_packet_prefix );
+    case EVENT_MP_SEND_RESPONSE:
+
+      the_thread = _MPCI_Process_response( the_packet_prefix );
+
       _MPCI_Return_packet( the_packet_prefix );
 
       break;
-    }
 
   }
 }
 
-/*
+/*PAGE
+ *
  *  _Event_MP_Send_object_was_deleted
  *
@@ -179,5 +166,6 @@
  */
 
-/*
+/*PAGE
+ *
  *  _Event_MP_Send_extract_proxy
  *
@@ -187,3 +175,14 @@
  */
 
+/*PAGE
+ *
+ *  _Event_MP_Get_packet
+ *
+ */
+
+Event_MP_Packet *_Event_MP_Get_packet ( void )
+{
+  return ( (Event_MP_Packet *) _MPCI_Get_packet() );
+}
+
 /* end of file */
Index: cpukit/rtems/src/eventreceive.c
===================================================================
--- cpukit/rtems/src/eventreceive.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,88 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicEvent
- *
- * @brief This source file contains the implementation of
- *   rtems_event_receive().
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  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.
- *
- * 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/eventimpl.h>
-#include <rtems/rtems/tasksdata.h>
-#include <rtems/score/statesimpl.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_event_receive(
-  rtems_event_set  event_in,
-  rtems_option     option_set,
-  rtems_interval   ticks,
-  rtems_event_set *event_out
-)
-{
-  rtems_status_code sc;
-
-  if ( event_out != NULL ) {
-    ISR_lock_Context   lock_context;
-    Thread_Control    *executing;
-    RTEMS_API_Control *api;
-    Event_Control     *event;
-
-    executing = _Thread_Wait_acquire_default_for_executing( &lock_context );
-    api = executing->API_Extensions[ THREAD_API_RTEMS ];
-    event = &api->Event;
-
-    if ( !_Event_sets_Is_empty( event_in ) ) {
-      sc = _Event_Seize(
-        event_in,
-        option_set,
-        ticks,
-        event_out,
-        executing,
-        event,
-        THREAD_WAIT_CLASS_EVENT,
-        STATES_WAITING_FOR_EVENT,
-        &lock_context
-      );
-    } else {
-      *event_out = event->pending_events;
-      _Thread_Wait_release_default( executing, &lock_context );
-      sc = RTEMS_SUCCESSFUL;
-    }
-  } else {
-    sc = RTEMS_INVALID_ADDRESS;
-  }
-
-  return sc;
-}
Index: cpukit/rtems/src/eventseize.c
===================================================================
--- cpukit/rtems/src/eventseize.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,136 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicEvent
- *
- * @brief This source file contains the implementation of
- *   _Event_Seize() and the Event Manager multiprocessing (MP) support system
- *   initialization.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/sysinit.h>
-#include <rtems/rtems/eventimpl.h>
-#include <rtems/rtems/optionsimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/watchdogimpl.h>
-
-rtems_status_code _Event_Seize(
-  rtems_event_set    event_in,
-  rtems_option       option_set,
-  rtems_interval     ticks,
-  rtems_event_set   *event_out,
-  Thread_Control    *executing,
-  Event_Control     *event,
-  Thread_Wait_flags  wait_class,
-  States_Control     block_state,
-  ISR_lock_Context  *lock_context
-)
-{
-  rtems_event_set    seized_events;
-  rtems_event_set    pending_events;
-  bool               success;
-  Thread_Wait_flags  intend_to_block;
-  Per_CPU_Control   *cpu_self;
-
-  pending_events = event->pending_events;
-  seized_events  = _Event_sets_Get( pending_events, event_in );
-
-  if ( !_Event_sets_Is_empty( seized_events ) &&
-       (seized_events == event_in || _Options_Is_any( option_set )) ) {
-    event->pending_events =
-      _Event_sets_Clear( pending_events, seized_events );
-    _Thread_Wait_release_default( executing, lock_context );
-    *event_out = seized_events;
-    return RTEMS_SUCCESSFUL;
-  }
-
-  if ( _Options_Is_no_wait( option_set ) ) {
-    _Thread_Wait_release_default( executing, lock_context );
-    *event_out = seized_events;
-    return RTEMS_UNSATISFIED;
-  }
-
-  intend_to_block = wait_class | THREAD_WAIT_STATE_INTEND_TO_BLOCK;
-
-  /*
-   *  Note what we are waiting for BEFORE we enter the critical section.
-   *  The interrupt critical section management code needs this to be
-   *  set properly when we are marked as in the event critical section.
-   *
-   *  NOTE: Since interrupts are disabled, this isn't that much of an
-   *        issue but better safe than sorry.
-   */
-  executing->Wait.return_code     = STATUS_SUCCESSFUL;
-  executing->Wait.option          = option_set;
-  executing->Wait.count           = event_in;
-  executing->Wait.return_argument = event_out;
-  _Thread_Wait_flags_set( executing, intend_to_block );
-
-  cpu_self = _Thread_Dispatch_disable_critical( lock_context );
-  _Thread_Wait_release_default( executing, lock_context );
-
-  if ( ticks ) {
-    _Thread_Add_timeout_ticks( executing, cpu_self, ticks );
-  }
-
-  _Thread_Set_state( executing, block_state );
-
-  success = _Thread_Wait_flags_try_change_acquire(
-    executing,
-    intend_to_block,
-    wait_class | THREAD_WAIT_STATE_BLOCKED
-  );
-  if ( !success ) {
-    _Thread_Timer_remove( executing );
-    _Thread_Unblock( executing );
-  }
-
-  _Thread_Dispatch_direct( cpu_self );
-  return _Status_Get_after_wait( executing );
-}
-
-#if defined(RTEMS_MULTIPROCESSING)
-static void _Event_MP_Initialize( void )
-{
-  _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Event_MP_Initialize,
-  RTEMS_SYSINIT_CLASSIC_EVENT_MP,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
-#endif
Index: cpukit/rtems/src/eventsend.c
===================================================================
--- cpukit/rtems/src/eventsend.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicEvent
- *
- * @brief This source file contains the implementation of
- *   rtems_event_send().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/eventimpl.h>
-#include <rtems/rtems/tasksdata.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_event_send(
-  rtems_id        id,
-  rtems_event_set event_in
-)
-{
-  Thread_Control    *the_thread;
-  RTEMS_API_Control *api;
-  ISR_lock_Context   lock_context;
-
-  the_thread = _Thread_Get( id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Event_MP_Send( id, event_in );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
-  return _Event_Surrender(
-    the_thread,
-    event_in,
-    &api->Event,
-    THREAD_WAIT_CLASS_EVENT,
-    &lock_context
-  );
-}
Index: cpukit/rtems/src/eventsurrender.c
===================================================================
--- cpukit/rtems/src/eventsurrender.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,147 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicEvent
- *
- * @brief This source file contains the implementation of
- *   _Event_Surrender().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/eventimpl.h>
-#include <rtems/rtems/optionsimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/watchdogimpl.h>
-
-static void _Event_Satisfy(
-  Thread_Control  *the_thread,
-  Event_Control   *event,
-  rtems_event_set  pending_events,
-  rtems_event_set  seized_events
-)
-{
-  event->pending_events = _Event_sets_Clear( pending_events, seized_events );
-  *(rtems_event_set *) the_thread->Wait.return_argument = seized_events;
-}
-
-static bool _Event_Is_blocking_on_event(
-  const Thread_Control *the_thread,
-  Thread_Wait_flags     wait_class
-)
-{
-  Thread_Wait_flags wait_flags;
-
-  wait_flags = _Thread_Wait_flags_get( the_thread );
-
-  return ( wait_flags & THREAD_WAIT_CLASS_MASK ) == wait_class;
-}
-
-static bool _Event_Is_satisfied(
-  const Thread_Control *the_thread,
-  rtems_event_set       pending_events,
-  rtems_event_set      *seized_events
-)
-{
-  rtems_option    option_set;
-  rtems_event_set event_condition;
-
-  option_set = the_thread->Wait.option;
-  event_condition = the_thread->Wait.count;
-  *seized_events = _Event_sets_Get( pending_events, event_condition );
-
-  return !_Event_sets_Is_empty( *seized_events )
-    && ( *seized_events == event_condition || _Options_Is_any( option_set ) );
-}
-
-rtems_status_code _Event_Surrender(
-  Thread_Control    *the_thread,
-  rtems_event_set    event_in,
-  Event_Control     *event,
-  Thread_Wait_flags  wait_class,
-  ISR_lock_Context  *lock_context
-)
-{
-  rtems_event_set pending_events;
-  rtems_event_set seized_events;
-  bool            unblock;
-
-  _Thread_Wait_acquire_default_critical( the_thread, lock_context );
-
-  _Event_sets_Post( event_in, &event->pending_events );
-  pending_events = event->pending_events;
-
-  if (
-    _Event_Is_blocking_on_event( the_thread, wait_class )
-      && _Event_Is_satisfied( the_thread, pending_events, &seized_events )
-  ) {
-    bool success;
-
-    _Event_Satisfy( the_thread, event, pending_events, seized_events );
-
-    success = _Thread_Wait_flags_try_change_release(
-      the_thread,
-      wait_class | THREAD_WAIT_STATE_INTEND_TO_BLOCK,
-      THREAD_WAIT_STATE_READY
-    );
-
-    if ( success ) {
-      unblock = false;
-    } else {
-      _Assert(
-        _Thread_Wait_flags_get( the_thread )
-          == ( wait_class | THREAD_WAIT_STATE_BLOCKED )
-      );
-      _Thread_Wait_flags_set( the_thread, THREAD_WAIT_STATE_READY );
-      unblock = true;
-    }
-  } else {
-    unblock = false;
-  }
-
-  if ( unblock ) {
-    Per_CPU_Control *cpu_self;
-
-    cpu_self = _Thread_Dispatch_disable_critical( lock_context );
-    _Thread_Wait_release_default( the_thread, lock_context );
-
-    _Thread_Timer_remove( the_thread );
-    _Thread_Unblock( the_thread );
-
-    _Thread_Dispatch_enable( cpu_self );
-  } else {
-    _Thread_Wait_release_default( the_thread, lock_context );
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/getapiconfig.c
===================================================================
--- cpukit/rtems/src/getapiconfig.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassic
- *
- * @brief This source file contains the implementation of
- *   rtems_api_configuration_table().
- */
-
-/*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * 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/config.h>
-#include <rtems/rtems/tasksdata.h>
-
-static rtems_api_configuration_table config;
-
-const rtems_api_configuration_table *
-rtems_configuration_get_rtems_api_configuration( void )
-{
-  /*
-   * Always initialize the configuration table and do not bother with
-   * synchronization issues.  This function is not performance critical.  The
-   * configuration values are all constants.
-   */
-
-  config.notepads_enabled = false;
-  config.maximum_tasks = rtems_configuration_get_maximum_tasks();
-  config.maximum_timers = rtems_configuration_get_maximum_timers();
-  config.maximum_semaphores = rtems_configuration_get_maximum_semaphores();
-  config.maximum_message_queues =
-    rtems_configuration_get_maximum_message_queues();
-  config.maximum_partitions = rtems_configuration_get_maximum_partitions();
-  config.maximum_regions = rtems_configuration_get_maximum_regions();
-  config.maximum_ports = rtems_configuration_get_maximum_ports();
-  config.maximum_periods = rtems_configuration_get_maximum_periods();
-  config.maximum_barriers = rtems_configuration_get_maximum_barriers();
-
-  if ( _RTEMS_tasks_User_task_table.entry_point != NULL ) {
-    config.number_of_initialization_tasks = 1;
-    config.User_initialization_tasks_table = &_RTEMS_tasks_User_task_table;
-  }
-
-  return &config;
-}
Index: cpukit/rtems/src/intr.c
===================================================================
--- cpukit/rtems/src/intr.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ cpukit/rtems/src/intr.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,85 @@
+/*
+ *  Interrupt Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/isr.h>
+#include <rtems/stack.h>
+#include <rtems/intr.h>
+#include <rtems/wkspace.h>
+
+/*  _Interrupt_Manager_initialization
+ *
+ *  This routine initializes the interrupt manager.
+ *
+ *  Input parameters: NONE
+ *
+ *  Output parameters: NONE
+ */
+
+void _Interrupt_Manager_initialization( void )
+{
+#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
+
+  if ( _CPU_Table.interrupt_stack_size < RTEMS_MINIMUM_STACK_SIZE )
+    rtems_fatal_error_occurred( RTEMS_INVALID_SIZE );
+
+  _CPU_Interrupt_stack_low =
+    _Workspace_Allocate_or_fatal_error( _CPU_Table.interrupt_stack_size );
+
+  _CPU_Interrupt_stack_high = _Addresses_Add_offset(
+    _CPU_Interrupt_stack_low,
+    _CPU_Table.interrupt_stack_size
+  );
+
+#endif
+
+#if ( CPU_HAS_HARDWARE_INTERRUPT_STACK == TRUE )
+  _CPU_Install_interrupt_stack();
+#endif
+
+}
+
+/*  rtems_interrupt_catch
+ *
+ *  This directive allows a thread to specify what action to take when
+ *  catching signals.
+ *
+ *  Input parameters:
+ *    new_isr_handler - address of interrupt service routine (isr)
+ *    vector          - interrupt vector number
+ *    old_isr_handler - address at which to store previous ISR address
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - always succeeds
+ *    *old_isr_handler  - previous ISR address
+ */
+
+rtems_status_code rtems_interrupt_catch(
+  rtems_isr_entry      new_isr_handler,
+  rtems_vector_number  vector,
+  rtems_isr_entry     *old_isr_handler
+)
+{
+  if ( !_ISR_Is_vector_number_valid( vector ) )
+    return( RTEMS_INVALID_NUMBER );
+
+  if ( !_ISR_Is_valid_user_handler( new_isr_handler ) )
+    return( RTEMS_INVALID_ADDRESS );
+
+  _ISR_Install_vector(
+    vector, (proc_ptr)new_isr_handler, (proc_ptr *)old_isr_handler );
+
+  return( RTEMS_SUCCESSFUL );
+}
Index: cpukit/rtems/src/intrbody.c
===================================================================
--- cpukit/rtems/src/intrbody.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,98 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassic
- *
- * @brief This source file contains the implementation of
- *   directive bindings of the Interrupt Manager for languages other than
- *   C/C++.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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/status.h>
-#include <rtems/score/isr.h>
-#include <rtems/rtems/intr.h>
-
-#if !defined(RTEMS_SMP)
-
-/*
- *  Undefine all of these is normally a macro and we want a real body in
- *  the library for other language bindings.
- */
-#undef rtems_interrupt_disable
-#undef rtems_interrupt_enable
-#undef rtems_interrupt_flash
-
-/*
- *  Prototype them to avoid warnings
- */
-rtems_interrupt_level rtems_interrupt_disable( void );
-void rtems_interrupt_enable( rtems_interrupt_level previous_level );
-void rtems_interrupt_flash( rtems_interrupt_level previous_level );
-
-/*
- *  Now define real bodies
- */
-rtems_interrupt_level rtems_interrupt_disable( void )
-{
-  rtems_interrupt_level previous_level;
-
-  _ISR_Local_disable( previous_level );
-
-  return previous_level;
-}
-
-void rtems_interrupt_enable(
-  rtems_interrupt_level previous_level
-)
-{
-  _ISR_Local_enable( previous_level );
-}
-
-void rtems_interrupt_flash(
-  rtems_interrupt_level previous_level
-)
-{
-  _ISR_Local_flash( previous_level );
-}
-
-#endif /* RTEMS_SMP */
-
-#undef rtems_interrupt_is_in_progress
-bool rtems_interrupt_is_in_progress( void );
-
-bool rtems_interrupt_is_in_progress( void )
-{
-  return _ISR_Is_in_progress();
-}
Index: cpukit/rtems/src/intrcatch.c
===================================================================
--- cpukit/rtems/src/intrcatch.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassic
- *
- * @brief This source file contains the implementation of
- *   rtems_interrupt_catch().
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  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.
- *
- * 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/intr.h>
-#include <rtems/score/isr.h>
-
-#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
-rtems_status_code rtems_interrupt_catch(
-  rtems_isr_entry      new_isr_handler,
-  rtems_vector_number  vector,
-  rtems_isr_entry     *old_isr_handler
-)
-{
-  if ( vector > CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER )
-    return RTEMS_INVALID_NUMBER;
-
-  if ( new_isr_handler == NULL )
-    return RTEMS_INVALID_ADDRESS;
-
-  if ( old_isr_handler == NULL )
-    return RTEMS_INVALID_ADDRESS;
-
-  _ISR_Install_vector( vector, new_isr_handler, old_isr_handler );
-
-  return RTEMS_SUCCESSFUL;
-}
-#endif
Index: cpukit/rtems/src/modes.c
===================================================================
--- cpukit/rtems/src/modes.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassic
- *
- * @brief This source file contains the implementation of
- *   rtems_interrupt_level_body() and the definition of ::rtems_interrupt_mask
- *   to support languages other than C/C++.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2012.
- *  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.
- *
- * 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/tasks.h>
-#include <rtems/score/stack.h>
-#include <rtems/rtems/modes.h>
-
-const uint32_t rtems_interrupt_mask = RTEMS_INTERRUPT_MASK;
-
-rtems_mode rtems_interrupt_level_body(
-  uint32_t   level
-)
-{
-  return RTEMS_INTERRUPT_LEVEL(level);
-}
Index: cpukit/rtems/src/mp.c
===================================================================
--- cpukit/rtems/src/mp.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/mp.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,49 +1,127 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
+/*
+ *  Multiprocessing Manager
  *
- * @ingroup RTEMSImplClassic
  *
- * @brief This source file contains the implementation to support the Classic
- *   API in multiprocessing (MP) configurations.
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
  */
 
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
+#include <rtems/system.h>
+#include <rtems/config.h>
+#include <rtems/cpu.h>
+#include <rtems/event.h>
+#include <rtems/fatal.h>
+#include <rtems/intthrd.h>
+#include <rtems/message.h>
+#include <rtems/mp.h>
+#include <rtems/mpci.h>
+#include <rtems/mppkt.h>
+#include <rtems/part.h>
+#include <rtems/sem.h>
+#include <rtems/signal.h>
+#include <rtems/states.h>
+#include <rtems/tasks.h>
+#include <rtems/thread.h>
+#include <rtems/threadq.h>
+#include <rtems/watchdog.h>
+
+/*PAGE
  *
- * 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.
+ *  _Multiprocessing_Manager_initialization
  *
- * 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
+void _Multiprocessing_Manager_initialization ( void )
+{
+  if ( _Configuration_MP_table->node < 1 ||
+       _Configuration_MP_table->node > _Configuration_MP_table->maximum_nodes )
+     rtems_fatal_error_occurred( RTEMS_INVALID_NODE );
 
-#include <rtems/rtems/mp.h>
-#include <rtems/score/mpciimpl.h>
+  _Internal_threads_Set_MP_receive_server( _Multiprocessing_Receive_server );
+}
+
+/*PAGE
+ *
+ *  rtems_multiprocessing_announce
+ *
+ */
 
 void rtems_multiprocessing_announce ( void )
 {
-  _MPCI_Announce();
+  _Thread_MP_Ready();
+}
+
+/*PAGE
+ *
+ *  _Multiprocessing_Receive_server
+ *
+ */
+
+Thread _Multiprocessing_Receive_server (
+  Thread_Argument ignored
+)
+{
+
+  rtems_packet_prefix *the_packet;
+
+  _Thread_Dispatch_disable_level = 1;
+
+  for ( ; ; ) {
+
+    _Internal_threads_System_initialization_thread->Notepads[ 0 ] = 1;
+
+    the_packet = _MPCI_Receive_packet();
+
+    if ( ! the_packet ) {
+      _Thread_MP_Block();
+      _Thread_Dispatch_disable_level = 1;
+    }
+    else {
+
+      _Thread_Executing->receive_packet = the_packet;
+
+      switch ( the_packet->the_class ) {
+
+        case RTEMS_MP_PACKET_INTERNAL_THREADS:
+          _Internal_threads_MP_Process_packet( the_packet );
+          break;
+
+        case RTEMS_MP_PACKET_TASKS:
+          _RTEMS_tasks_MP_Process_packet( the_packet );
+          break;
+
+        case RTEMS_MP_PACKET_MESSAGE_QUEUE:
+          _Message_queue_MP_Process_packet( the_packet );
+          break;
+
+        case RTEMS_MP_PACKET_SEMAPHORE:
+          _Semaphore_MP_Process_packet( the_packet );
+          break;
+
+        case RTEMS_MP_PACKET_PARTITION:
+          _Partition_MP_Process_packet( the_packet );
+          break;
+
+        case RTEMS_MP_PACKET_REGION:
+          /* Global regions are unsupported at this time */
+          break;
+
+        case RTEMS_MP_PACKET_EVENT:
+          _Event_MP_Process_packet( the_packet );
+          break;
+
+        case RTEMS_MP_PACKET_SIGNAL:
+          _Signal_MP_Process_packet( the_packet );
+          break;
+      }
+    }
+  }
 }
 
Index: cpukit/rtems/src/msg.c
===================================================================
--- cpukit/rtems/src/msg.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/msg.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,48 +1,708 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains a definition of the
- *   ::_Message_queue_Information with zero objects.
- */
-
 /*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * 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/messagedata.h>
-
-OBJECTS_INFORMATION_DEFINE_ZERO(
-  _Message_queue,
-  OBJECTS_CLASSIC_API,
-  OBJECTS_RTEMS_MESSAGE_QUEUES,
-  OBJECTS_NO_STRING_NAME
-);
+ *  Message Queue Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/attr.h>
+#include <rtems/chain.h>
+#include <rtems/config.h>
+#include <rtems/isr.h>
+#include <rtems/message.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/states.h>
+#include <rtems/thread.h>
+#include <rtems/wkspace.h>
+#include <rtems/mpci.h>
+
+/*PAGE
+ *
+ *  _Message_queue_Manager_initialization
+ *
+ *  This routine initializes all message queue manager related
+ *  data structures.
+ *
+ *  Input parameters:
+ *    maximum_message_queues - number of message queues to initialize
+ *    maximum_message        - number of messages per queue
+ *
+ *  Output parameters:  NONE
+ */
+
+void _Message_queue_Manager_initialization(
+  unsigned32 maximum_message_queues,
+  unsigned32 maximum_messages
+)
+{
+
+  _Objects_Initialize_information(
+    &_Message_queue_Information,
+    TRUE,
+    maximum_message_queues,
+    sizeof( Message_queue_Control )
+  );
+
+  if ( maximum_messages == 0 ) {
+
+    _Chain_Initialize_empty( &_Message_queue_Inactive_messages );
+
+  } else {
+
+
+    _Chain_Initialize(
+      &_Message_queue_Inactive_messages,
+      _Workspace_Allocate_or_fatal_error(
+        maximum_messages * sizeof( Message_queue_Buffer_control )
+      ),
+      maximum_messages,
+      sizeof( Message_queue_Buffer_control )
+    );
+
+  }
+}
+
+/*PAGE
+ *
+ *  rtems_message_queue_create
+ *
+ *  This directive creates a message queue by allocating and initializing
+ *  a message queue data structure.
+ *
+ *  Input parameters:
+ *    name          - user defined queue name
+ *    count         - maximum message and reserved buffer count
+ *    attribute_set - process method
+ *    id            - pointer to queue
+ *
+ *  Output parameters:
+ *    id                - queue id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_message_queue_create(
+  Objects_Name        name,
+  unsigned32          count,
+  rtems_attribute  attribute_set,
+  Objects_Id         *id
+)
+{
+  register Message_queue_Control *the_message_queue;
+
+  if ( !_Objects_Is_name_valid( name ) )
+    return ( RTEMS_INVALID_NAME );
+
+  if ( _Attributes_Is_global( attribute_set ) &&
+       !_Configuration_Is_multiprocessing() )
+    return( RTEMS_MP_NOT_CONFIGURED );
+
+  _Thread_Disable_dispatch();              /* protects object pointer */
+
+  the_message_queue = _Message_queue_Allocate();
+
+  if ( !the_message_queue ) {
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  if ( _Attributes_Is_global( attribute_set ) &&
+       !( _Objects_MP_Open( &_Message_queue_Information, name,
+                            the_message_queue->Object.id, FALSE ) ) ) {
+    _Message_queue_Free( the_message_queue );
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  if ( _Attributes_Is_limit( attribute_set ) )
+    the_message_queue->maximum_pending_messages = count;
+  else
+    the_message_queue->maximum_pending_messages = 0xffffffff;
+
+  the_message_queue->attribute_set              = attribute_set;
+  the_message_queue->number_of_pending_messages = 0;
+
+  _Chain_Initialize_empty( &the_message_queue->Pending_messages );
+
+  _Thread_queue_Initialize( &the_message_queue->Wait_queue, attribute_set,
+                            STATES_WAITING_FOR_MESSAGE );
+
+  _Objects_Open( &_Message_queue_Information,
+                 &the_message_queue->Object, name );
+
+  *id = the_message_queue->Object.id;
+
+  if ( _Attributes_Is_global( attribute_set ) )
+    _Message_queue_MP_Send_process_packet(
+      MESSAGE_QUEUE_MP_ANNOUNCE_CREATE,
+      the_message_queue->Object.id,
+      name,
+      0
+    );
+
+  _Thread_Enable_dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_message_queue_ident
+ *
+ *  This directive returns the system ID associated with
+ *  the message queue name.
+ *
+ *  Input parameters:
+ *    name - user defined message queue name
+ *    node - node(s) to be searched
+ *    id   - pointer to message queue id
+ *
+ *  Output parameters:
+ *    *id               - message queue id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_message_queue_ident(
+  Objects_Name  name,
+  unsigned32    node,
+  Objects_Id   *id
+)
+{
+  return( _Objects_Name_to_id( &_Message_queue_Information, name,
+                               node, id ) );
+}
+
+/*PAGE
+ *
+ *  rtems_message_queue_delete
+ *
+ *  This directive allows a thread to delete the message queue specified
+ *  by the given queue identifier.
+ *
+ *  Input parameters:
+ *    id - queue id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_message_queue_delete(
+  Objects_Id id
+)
+{
+  register Message_queue_Control *the_message_queue;
+  Objects_Locations               location;
+
+  the_message_queue = _Message_queue_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Dispatch();
+      return( RTEMS_ILLEGAL_ON_REMOTE_OBJECT );
+    case OBJECTS_LOCAL:
+      _Objects_Close( &_Message_queue_Information,
+                      &the_message_queue->Object );
+
+      if ( the_message_queue->number_of_pending_messages != 0 )
+        (void) _Message_queue_Flush_support( the_message_queue );
+      else
+        _Thread_queue_Flush(
+          &the_message_queue->Wait_queue,
+          _Message_queue_MP_Send_object_was_deleted
+        );
+
+      _Message_queue_Free( the_message_queue );
+
+      if ( _Attributes_Is_global( the_message_queue->attribute_set ) ) {
+        _Objects_MP_Close(
+          &_Message_queue_Information,
+          the_message_queue->Object.id
+        );
+
+        _Message_queue_MP_Send_process_packet(
+          MESSAGE_QUEUE_MP_ANNOUNCE_DELETE,
+          the_message_queue->Object.id,
+          0,                                 /* Not used */
+          MPCI_DEFAULT_TIMEOUT
+        );
+      }
+
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_message_queue_send
+ *
+ *  This routine implements the directives q_send.  It sends a
+ *  message to the specified message queue.
+ *
+ *  Input parameters:
+ *    id     - pointer to message queue
+ *    buffer - pointer to message buffer
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_message_queue_send(
+  Objects_Id            id,
+  void                 *buffer
+)
+{
+  return( _Message_queue_Submit(
+      id,
+      (Message_queue_Buffer *) buffer,
+      MESSAGE_QUEUE_SEND_REQUEST
+    )
+  );
+}
+
+/*PAGE
+ *
+ *  rtems_message_queue_urgent
+ *
+ *  This routine implements the directives q_urgent.  It urgents a
+ *  message to the specified message queue.
+ *
+ *  Input parameters:
+ *    id     - pointer to message queue
+ *    buffer - pointer to message buffer
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_message_queue_urgent(
+  Objects_Id            id,
+  void                 *buffer
+)
+{
+  return( _Message_queue_Submit(
+      id,
+      (Message_queue_Buffer *) buffer,
+      MESSAGE_QUEUE_URGENT_REQUEST
+    )
+  );
+}
+
+/*PAGE
+ *
+ *  rtems_message_queue_broadcast
+ *
+ *  This directive sends a message for every thread waiting on the queue
+ *  designated by id.
+ *
+ *  Input parameters:
+ *    id     - pointer to message queue
+ *    buffer - pointer to message buffer
+ *    count  - pointer to area to store number of threads made ready
+ *
+ *  Output parameters:
+ *    count             - number of threads made ready
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_message_queue_broadcast(
+  Objects_Id            id,
+  void                 *buffer,
+  unsigned32           *count
+)
+{
+  register Message_queue_Control *the_message_queue;
+  Objects_Locations               location;
+  Thread_Control                 *the_thread;
+  unsigned32                      number_broadcasted;
+
+  the_message_queue = _Message_queue_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Executing->Wait.return_argument = count;
+
+      return
+        _Message_queue_MP_Send_request_packet(
+          MESSAGE_QUEUE_MP_BROADCAST_REQUEST,
+          id,
+          (Message_queue_Buffer *) buffer,
+          0,                               /* Not used */
+          MPCI_DEFAULT_TIMEOUT
+        );
+
+    case OBJECTS_LOCAL:
+      number_broadcasted = 0;
+      while ( (the_thread =
+                 _Thread_queue_Dequeue(&the_message_queue->Wait_queue)) ) {
+        number_broadcasted += 1;
+        _Message_queue_Copy_buffer(
+          (Message_queue_Buffer *) buffer,
+          the_thread->Wait.return_argument
+        );
+
+        if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
+          the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
+
+          _Message_queue_MP_Send_response_packet(
+            MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
+            id,
+            the_thread
+          );
+        }
+      }
+      _Thread_Enable_dispatch();
+      *count = number_broadcasted;
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_message_queue_receive
+ *
+ *  This directive dequeues a message from the designated message queue
+ *  and copies it into the requesting thread's buffer.
+ *
+ *  Input parameters:
+ *    id         - queue id
+ *    buffer     - pointer to message buffer
+ *    option_set - options on receive
+ *    timeout    - number of ticks to wait
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_message_queue_receive(
+  Objects_Id            id,
+  void                 *buffer,
+  unsigned32            option_set,
+  rtems_interval     timeout
+)
+{
+  register Message_queue_Control *the_message_queue;
+  Objects_Locations                      location;
+
+  the_message_queue = _Message_queue_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Executing->Wait.return_argument = buffer;
+      return
+        _Message_queue_MP_Send_request_packet(
+          MESSAGE_QUEUE_MP_RECEIVE_REQUEST,
+          id,
+          buffer,
+          option_set,
+          timeout
+        );
+
+    case OBJECTS_LOCAL:
+      if ( !_Message_queue_Seize( the_message_queue, option_set, buffer ) )
+        _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
+      _Thread_Enable_dispatch();
+      return( _Thread_Executing->Wait.return_code );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_message_queue_flush
+ *
+ *  This directive removes all pending messages from a queue and returns
+ *  the number of messages removed.  If no messages were present then
+ *  a count of zero is returned.
+ *
+ *  Input parameters:
+ *    id    - queue id
+ *    count - return area for count
+ *
+ *  Output parameters:
+ *    count             - number of messages removed ( 0 = empty queue )
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_message_queue_flush(
+  Objects_Id  id,
+  unsigned32 *count
+)
+{
+  register Message_queue_Control *the_message_queue;
+  Objects_Locations               location;
+
+  the_message_queue = _Message_queue_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Executing->Wait.return_argument = count;
+
+      return
+        _Message_queue_MP_Send_request_packet(
+          MESSAGE_QUEUE_MP_FLUSH_REQUEST,
+          id,
+          0,                               /* Not used */
+          0,                               /* Not used */
+          MPCI_DEFAULT_TIMEOUT
+        );
+
+    case OBJECTS_LOCAL:
+      if ( the_message_queue->number_of_pending_messages != 0 )
+        *count = _Message_queue_Flush_support( the_message_queue );
+      else
+        *count = 0;
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  _Message_queue_Seize
+ *
+ *  This kernel routine dequeues a message, copies the message buffer to
+ *  a given destination buffer, and frees the message buffer to the
+ *  inactive message pool.
+ *
+ *  Input parameters:
+ *    the_message_queue - pointer to message queue
+ *    option_set        - options on receive
+ *    the_buffer        - pointer to message buffer to be filled
+ *
+ *  Output parameters:
+ *    TRUE  - if message received or RTEMS_NO_WAIT and no message
+ *    FALSE - if thread is to block
+ *
+ *  NOTE: Dependent on BUFFER_LENGTH
+ *
+ *  INTERRUPT LATENCY:
+ *    available
+ *    wait
+ */
+
+boolean _Message_queue_Seize(
+  Message_queue_Control  *the_message_queue,
+  rtems_option            option_set,
+  Message_queue_Buffer   *buffer
+)
+{
+  ISR_Level                     level;
+  Message_queue_Buffer_control *the_message;
+  Thread_Control               *executing;
+
+  executing = _Thread_Executing;
+  executing->Wait.return_code = RTEMS_SUCCESSFUL;
+  _ISR_Disable( level );
+  if ( the_message_queue->number_of_pending_messages != 0 ) {
+    the_message_queue->number_of_pending_messages -= 1;
+
+    the_message = _Message_queue_Get_pending_message( the_message_queue );
+    _ISR_Enable( level );
+    _Message_queue_Copy_buffer( &the_message->Contents, buffer );
+    _Message_queue_Free_message_buffer( the_message );
+    return( TRUE );
+  }
+
+  if ( _Options_Is_no_wait( option_set ) ) {
+    _ISR_Enable( level );
+    executing->Wait.return_code = RTEMS_UNSATISFIED;
+    return( TRUE );
+  }
+
+  the_message_queue->Wait_queue.sync = TRUE;
+  executing->Wait.queue              = &the_message_queue->Wait_queue;
+  executing->Wait.id                 = the_message_queue->Object.id;
+  executing->Wait.option_set         = option_set;
+  executing->Wait.return_argument    = (unsigned32 *)buffer;
+  _ISR_Enable( level );
+  return( FALSE );
+}
+
+/*PAGE
+ *
+ *  _Message_queue_Flush_support
+ *
+ *  This message manager routine removes all messages from a message queue
+ *  and returns them to the inactive message pool.
+ *
+ *  Input parameters:
+ *    the_message_queue - pointer to message queue
+ *
+ *  Output parameters:
+ *    returns - number of messages placed on inactive chain
+ *
+ *  INTERRUPT LATENCY:
+ *    only case
+ */
+
+unsigned32 _Message_queue_Flush_support(
+  Message_queue_Control *the_message_queue
+)
+{
+  ISR_Level          level;
+  Chain_Node *inactive_first;
+  Chain_Node *message_queue_first;
+  Chain_Node *message_queue_last;
+  unsigned32         count;
+
+  _ISR_Disable( level );
+    inactive_first      = _Message_queue_Inactive_messages.first;
+    message_queue_first = the_message_queue->Pending_messages.first;
+    message_queue_last  = the_message_queue->Pending_messages.last;
+
+    _Message_queue_Inactive_messages.first = message_queue_first;
+    message_queue_last->next               = inactive_first;
+    inactive_first->previous               = message_queue_last;
+    message_queue_first->previous          =
+               _Chain_Head( &_Message_queue_Inactive_messages );
+
+    _Chain_Initialize_empty( &the_message_queue->Pending_messages );
+
+    count = the_message_queue->number_of_pending_messages;
+    the_message_queue->number_of_pending_messages = 0;
+  _ISR_Enable( level );
+  return( count );
+}
+
+/*PAGE
+ *
+ *  _Message_queue_Submit
+ *
+ *  This routine implements the directives q_send and q_urgent.  It
+ *  processes a message that is to be submitted to the designated
+ *  message queue.  The message will either be processed as a send
+ *  send message which it will be inserted at the rear of the queue
+ *  or it will be processed as an urgent message which will be inserted
+ *  at the front of the queue.
+ *
+ *  Input parameters:
+ *    id          - pointer to message queue
+ *    the_buffer  - pointer to message buffer
+ *    submit_type - send or urgent message
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code _Message_queue_Submit(
+  Objects_Id                  id,
+  Message_queue_Buffer       *buffer,
+  Message_queue_Submit_types  submit_type
+)
+{
+  register Message_queue_Control *the_message_queue;
+  Objects_Locations               location;
+  Thread_Control                 *the_thread;
+  Message_queue_Buffer_control   *the_message;
+
+  the_message_queue = _Message_queue_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      switch ( submit_type ) {
+        case MESSAGE_QUEUE_SEND_REQUEST:
+          return
+            _Message_queue_MP_Send_request_packet(
+              MESSAGE_QUEUE_MP_SEND_REQUEST,
+              id,
+              buffer,
+              0,                               /* Not used */
+              MPCI_DEFAULT_TIMEOUT
+            );
+
+        case MESSAGE_QUEUE_URGENT_REQUEST:
+          return
+            _Message_queue_MP_Send_request_packet(
+              MESSAGE_QUEUE_MP_URGENT_REQUEST,
+              id,
+              buffer,
+              0,                               /* Not used */
+              MPCI_DEFAULT_TIMEOUT
+            );
+      }
+    case OBJECTS_LOCAL:
+      the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
+
+      if ( the_thread ) {
+
+        _Message_queue_Copy_buffer(
+          buffer,
+          the_thread->Wait.return_argument
+        );
+
+        if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
+          the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
+
+          _Message_queue_MP_Send_response_packet(
+            MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
+            id,
+            the_thread
+          );
+
+        }
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+
+      if ( the_message_queue->number_of_pending_messages ==
+           the_message_queue->maximum_pending_messages ) {
+        _Thread_Enable_dispatch();
+        return( RTEMS_TOO_MANY );
+      }
+
+      the_message = _Message_queue_Allocate_message_buffer();
+
+      if ( !the_message ) {
+        _Thread_Enable_dispatch();
+        return( RTEMS_UNSATISFIED );
+      }
+
+      _Message_queue_Copy_buffer( buffer, &the_message->Contents );
+
+      the_message_queue->number_of_pending_messages += 1;
+
+      switch ( submit_type ) {
+        case MESSAGE_QUEUE_SEND_REQUEST:
+          _Message_queue_Append( the_message_queue, the_message );
+          break;
+        case MESSAGE_QUEUE_URGENT_REQUEST:
+          _Message_queue_Prepend( the_message_queue, the_message );
+          break;
+      }
+
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
Index: cpukit/rtems/src/msgmp.c
===================================================================
--- cpukit/rtems/src/msgmp.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/msgmp.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,63 +1,28 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessageMP
- *
- * @brief This source file contains the implementation to support the Message
- *   Manager in multiprocessing (MP) configurations.
- */
-
 /*
- *  COPYRIGHT (c) 1989-2008.
+ *  Multiprocessing Support for the Message Queue Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
  *  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.
- *
- * 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/messageimpl.h>
-#include <rtems/rtems/optionsimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/coremsgimpl.h>
-#include <rtems/score/statesimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/sysinit.h>
-
-RTEMS_STATIC_ASSERT(
-  MESSAGE_QUEUE_MP_PACKET_SIZE <= MP_PACKET_MINIMUM_PACKET_SIZE,
-  Message_queue_MP_Packet
-);
-
-static Message_queue_MP_Packet *_Message_queue_MP_Get_packet( void )
-{
-  return (Message_queue_MP_Packet *) _MPCI_Get_packet();
-}
-
-
-/*
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/message.h>
+#include <rtems/mpci.h>
+#include <rtems/msgmp.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/thread.h>
+#include <rtems/watchdog.h>
+
+/*PAGE
+ *
  *  _Message_queue_MP_Send_process_packet
  *
@@ -67,10 +32,10 @@
   Message_queue_MP_Remote_operations  operation,
   Objects_Id                          message_queue_id,
-  rtems_name                          name,
+  Objects_Name                        name,
   Objects_Id                          proxy_id
 )
 {
   Message_queue_MP_Packet *the_packet;
-  uint32_t                 node;
+  unsigned32               node;
 
   switch ( operation ) {
@@ -81,7 +46,7 @@
 
       the_packet                    = _Message_queue_MP_Get_packet();
-      the_packet->Prefix.the_class  = MP_PACKET_MESSAGE_QUEUE;
-      the_packet->Prefix.length     = MESSAGE_QUEUE_MP_PACKET_SIZE;
-      the_packet->Prefix.to_convert = MESSAGE_QUEUE_MP_PACKET_SIZE;
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_MESSAGE_QUEUE;
+      the_packet->Prefix.length     = sizeof ( Message_queue_MP_Packet );
+      the_packet->Prefix.to_convert = sizeof ( Message_queue_MP_Packet );
       the_packet->operation         = operation;
       the_packet->Prefix.id         = message_queue_id;
@@ -90,5 +55,5 @@
 
       if ( operation == MESSAGE_QUEUE_MP_EXTRACT_PROXY )
-         node = _Objects_Get_node( message_queue_id );
+         node = rtems_get_node( message_queue_id );
       else
          node = MPCI_ALL_NODES;
@@ -107,6 +72,4 @@
     case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
     case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
-    case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
-    case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
       break;
 
@@ -114,101 +77,50 @@
 }
 
-/*
+/*PAGE
+ *
  *  _Message_queue_MP_Send_request_packet
  *
  */
 
-static rtems_status_code _Message_queue_MP_Send_request_packet (
+rtems_status_code _Message_queue_MP_Send_request_packet (
+  Message_queue_MP_Remote_operations  operation,
   Objects_Id                          message_queue_id,
-  const void                         *buffer,
-  size_t                             *size_p,
-  rtems_option                        option_set,
-  rtems_interval                      timeout,
-  Message_queue_MP_Remote_operations  operation
+  Message_queue_Buffer               *buffer,
+  rtems_option                     option_set,
+  rtems_interval                   timeout
 )
 {
   Message_queue_MP_Packet *the_packet;
-  Status_Control           status;
-
-  if ( !_Message_queue_MP_Is_remote( message_queue_id ) ) {
-    return RTEMS_INVALID_ID;
-  }
 
   switch ( operation ) {
 
+    case MESSAGE_QUEUE_MP_RECEIVE_REQUEST:
     case MESSAGE_QUEUE_MP_SEND_REQUEST:
     case MESSAGE_QUEUE_MP_URGENT_REQUEST:
     case MESSAGE_QUEUE_MP_BROADCAST_REQUEST:
     case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
-    case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
 
       the_packet                    = _Message_queue_MP_Get_packet();
-      the_packet->Prefix.the_class  = MP_PACKET_MESSAGE_QUEUE;
-      the_packet->Prefix.length     = MESSAGE_QUEUE_MP_PACKET_SIZE;
-      if ( size_p )
-        the_packet->Prefix.length     += *size_p;
-      the_packet->Prefix.to_convert = MESSAGE_QUEUE_MP_PACKET_SIZE;
-
-      /*
-       * make sure message is not too big for our MPCI driver
-       * We have to check it here instead of waiting for MPCI because
-       * we are about to slam in the payload
-       */
-
-      if (the_packet->Prefix.length > _MPCI_table->maximum_packet_size) {
-          return RTEMS_INVALID_SIZE;
-      }
-
-      if (! _Options_Is_no_wait(option_set))
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_MESSAGE_QUEUE;
+      the_packet->Prefix.length     = sizeof ( Message_queue_MP_Packet );
+      the_packet->Prefix.to_convert = sizeof ( Message_queue_MP_Packet ) -
+                         sizeof ( Message_queue_Buffer );
+      if ( ! _Options_Is_no_wait(option_set))
           the_packet->Prefix.timeout = timeout;
 
-      the_packet->operation  = operation;
-      the_packet->Prefix.id  = message_queue_id;
-      the_packet->option_set = option_set;
-
-      /*
-       * Copy the data into place if needed
-       */
-
-      if (buffer) {
-          the_packet->size = *size_p;
-          _CORE_message_queue_Copy_buffer(
-            buffer,
-            the_packet->buffer,
-            *size_p
-          );
-      }
-
-      status = _MPCI_Send_request_packet(
-        _Objects_Get_node(message_queue_id),
-        &the_packet->Prefix,
-        STATES_WAITING_FOR_MESSAGE
-      );
-      return _Status_Get( status );
-
-    case MESSAGE_QUEUE_MP_RECEIVE_REQUEST:
-
-      the_packet                    = _Message_queue_MP_Get_packet();
-      the_packet->Prefix.the_class  = MP_PACKET_MESSAGE_QUEUE;
-      the_packet->Prefix.length     = MESSAGE_QUEUE_MP_PACKET_SIZE;
-      the_packet->Prefix.to_convert = MESSAGE_QUEUE_MP_PACKET_SIZE;
-
-      if (! _Options_Is_no_wait(option_set))
-          the_packet->Prefix.timeout = timeout;
-
-      the_packet->operation  = MESSAGE_QUEUE_MP_RECEIVE_REQUEST;
-      the_packet->Prefix.id  = message_queue_id;
-      the_packet->option_set = option_set;
-      the_packet->size       = 0;        /* just in case of an error */
-
-      _Thread_Executing->Wait.return_argument_second.immutable_object = buffer;
-      _Thread_Executing->Wait.return_argument = size_p;
-
-      status = _MPCI_Send_request_packet(
-        _Objects_Get_node(message_queue_id),
-        &the_packet->Prefix,
-        STATES_WAITING_FOR_MESSAGE
-      );
-      return _Status_Get( status );
+      the_packet->operation         = operation;
+      the_packet->Prefix.id         = message_queue_id;
+      the_packet->option_set        = option_set;
+
+      if ( buffer )
+        _Message_queue_Copy_buffer( buffer, &the_packet->Buffer );
+
+      return
+        _MPCI_Send_request_packet(
+          rtems_get_node( message_queue_id ),
+          &the_packet->Prefix,
+          STATES_WAITING_FOR_MESSAGE
+        );
+      break;
 
     case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE:
@@ -220,117 +132,21 @@
     case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
     case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
-    case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
-      break;
+      break;
+
   }
-
+  /*
+   *  The following line is included to satisfy compilers which
+   *  produce warnings when a function does not end with a return.
+   */
   return RTEMS_SUCCESSFUL;
 }
 
-rtems_status_code _Message_queue_MP_Broadcast(
-  rtems_id    id,
-  const void *buffer,
-  size_t      size,
-  uint32_t   *count
-)
-{
-  _Thread_Get_executing()->Wait.return_argument = count;
-  return _Message_queue_MP_Send_request_packet(
-    id,
-    buffer,
-    &size,
-    0,
-    MPCI_DEFAULT_TIMEOUT,
-    MESSAGE_QUEUE_MP_BROADCAST_REQUEST
-  );
-}
-
-rtems_status_code _Message_queue_MP_Flush(
-  rtems_id  id,
-  uint32_t *count
-)
-{
-  _Thread_Get_executing()->Wait.return_argument = count;
-  return _Message_queue_MP_Send_request_packet(
-    id,
-    NULL,
-    NULL,
-    0,
-    MPCI_DEFAULT_TIMEOUT,
-    MESSAGE_QUEUE_MP_FLUSH_REQUEST
-  );
-}
-
-rtems_status_code _Message_queue_MP_Get_number_pending(
-  rtems_id  id,
-  uint32_t *count
-)
-{
-  _Thread_Get_executing()->Wait.return_argument = count;
-  return _Message_queue_MP_Send_request_packet(
-    id,
-    NULL,
-    NULL,
-    0,
-    MPCI_DEFAULT_TIMEOUT,
-    MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST
-  );
-}
-
-rtems_status_code _Message_queue_MP_Receive(
-  rtems_id        id,
-  void           *buffer,
-  size_t         *size,
-  rtems_option    option_set,
-  rtems_interval  timeout
-)
-{
-  return _Message_queue_MP_Send_request_packet(
-    id,
-    buffer,
-    size,
-    option_set,
-    timeout,
-    MESSAGE_QUEUE_MP_RECEIVE_REQUEST
-  );
-}
-
-rtems_status_code _Message_queue_MP_Send(
-  rtems_id    id,
-  const void *buffer,
-  size_t      size
-)
-{
-  return _Message_queue_MP_Send_request_packet(
-    id,
-    buffer,
-    &size,
-    0,
-    MPCI_DEFAULT_TIMEOUT,
-    MESSAGE_QUEUE_MP_SEND_REQUEST
-  );
-}
-
-rtems_status_code _Message_queue_MP_Urgent(
-  rtems_id    id,
-  const void *buffer,
-  size_t      size
-)
-{
-  return _Message_queue_MP_Send_request_packet(
-    id,
-    buffer,
-    &size,
-    0,
-    MPCI_DEFAULT_TIMEOUT,
-    MESSAGE_QUEUE_MP_URGENT_REQUEST
-  );
-}
-
-/*
+/*PAGE
+ *
  *  _Message_queue_MP_Send_response_packet
  *
  */
 
-static void _Message_queue_MP_Send_response_packet (
+void _Message_queue_MP_Send_response_packet (
   Message_queue_MP_Remote_operations  operation,
   Objects_Id                          message_queue_id,
@@ -347,5 +163,4 @@
     case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
     case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
-    case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
 
       the_packet = ( Message_queue_MP_Packet *) the_thread->receive_packet;
@@ -354,16 +169,10 @@
  *  The packet being returned already contains the class, length, and
  *  to_convert fields, therefore they are not set in this routine.
- *
- *  Exception: MESSAGE_QUEUE_MP_RECEIVE_RESPONSE needs payload length
- *             added to 'length'
  */
       the_packet->operation = operation;
       the_packet->Prefix.id = the_packet->Prefix.source_tid;
 
-      if (operation == MESSAGE_QUEUE_MP_RECEIVE_RESPONSE)
-          the_packet->Prefix.length += the_packet->size;
-
       _MPCI_Send_response_packet(
-        _Objects_Get_node( the_packet->Prefix.source_tid ),
+        rtems_get_node( the_packet->Prefix.source_tid ),
         &the_packet->Prefix
       );
@@ -378,5 +187,4 @@
     case MESSAGE_QUEUE_MP_BROADCAST_REQUEST:
     case MESSAGE_QUEUE_MP_FLUSH_REQUEST:
-    case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
       break;
 
@@ -384,5 +192,12 @@
 }
 
-static void _Message_queue_MP_Process_packet (
+/*PAGE
+ *
+ *
+ *  _Message_queue_MP_Process_packet
+ *
+ */
+
+void _Message_queue_MP_Process_packet (
   rtems_packet_prefix   *the_packet_prefix
 )
@@ -390,4 +205,5 @@
   Message_queue_MP_Packet *the_packet;
   Thread_Control          *the_thread;
+  boolean                  ignored;
 
   the_packet = (Message_queue_MP_Packet *) the_packet_prefix;
@@ -397,10 +213,10 @@
     case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE:
 
-      _Objects_MP_Allocate_and_open(
-        &_Message_queue_Information,
-        the_packet->name,
-        the_packet->Prefix.id,
-        true
-      );
+      ignored = _Objects_MP_Open(
+                  &_Message_queue_Information,
+                  the_packet->name,
+                  the_packet->Prefix.id,
+                  TRUE
+                );
 
       _MPCI_Return_packet( the_packet_prefix );
@@ -418,7 +234,6 @@
       the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
 
-      if ( the_thread != NULL ) {
-        _Thread_queue_Extract( the_thread );
-      }
+      if ( ! _Thread_Is_null( the_thread ) )
+         _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
 
       _MPCI_Return_packet( the_packet_prefix );
@@ -429,11 +244,10 @@
       the_packet->Prefix.return_code = rtems_message_queue_receive(
         the_packet->Prefix.id,
-        the_packet->buffer,
-        &the_packet->size,
+        &the_packet->Buffer,
         the_packet->option_set,
         the_packet->Prefix.timeout
       );
 
-      if ( the_packet->Prefix.return_code != RTEMS_PROXY_BLOCKING )
+      if ( ! _Status_Is_proxy_blocking( the_packet->Prefix.return_code ) )
         _Message_queue_MP_Send_response_packet(
           MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
@@ -447,14 +261,8 @@
       the_thread = _MPCI_Process_response( the_packet_prefix );
 
-      if (the_packet->Prefix.return_code == RTEMS_SUCCESSFUL) {
-        *(size_t *) the_thread->Wait.return_argument =
-           the_packet->size;
-
-        _CORE_message_queue_Copy_buffer(
-          the_packet->buffer,
-          the_thread->Wait.return_argument_second.mutable_object,
-          the_packet->size
-        );
-      }
+      _Message_queue_Copy_buffer(
+        &the_packet->Buffer,
+        (Message_queue_Buffer *) the_thread->Wait.return_argument
+      );
 
       _MPCI_Return_packet( the_packet_prefix );
@@ -465,6 +273,5 @@
       the_packet->Prefix.return_code = rtems_message_queue_send(
         the_packet->Prefix.id,
-        the_packet->buffer,
-        the_packet->size
+        &the_packet->Buffer
       );
 
@@ -488,6 +295,5 @@
       the_packet->Prefix.return_code = rtems_message_queue_urgent(
         the_packet->Prefix.id,
-        the_packet->buffer,
-        the_packet->size
+        &the_packet->Buffer
       );
 
@@ -503,6 +309,5 @@
       the_packet->Prefix.return_code = rtems_message_queue_broadcast(
         the_packet->Prefix.id,
-        the_packet->buffer,
-        the_packet->size,
+        &the_packet->Buffer,
         &the_packet->count
       );
@@ -517,9 +322,8 @@
     case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE:
     case MESSAGE_QUEUE_MP_FLUSH_RESPONSE:
-    case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE:
 
       the_thread = _MPCI_Process_response( the_packet_prefix );
 
-      *(uint32_t *) the_thread->Wait.return_argument = the_packet->count;
+      *(unsigned32 *)the_thread->Wait.return_argument = the_packet->count;
 
       _MPCI_Return_packet( the_packet_prefix );
@@ -540,22 +344,9 @@
       break;
 
-    case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST:
-
-      the_packet->Prefix.return_code = rtems_message_queue_get_number_pending(
-        the_packet->Prefix.id,
-        &the_packet->count
-      );
-
-      _Message_queue_MP_Send_response_packet(
-        MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE,
-        the_packet->Prefix.id,
-        _Thread_Executing
-      );
-      break;
-
   }
 }
 
-/*
+/*PAGE
+ *
  *  _Message_queue_MP_Send_object_was_deleted
  *
@@ -563,6 +354,5 @@
 
 void _Message_queue_MP_Send_object_was_deleted (
-  Thread_Control *the_proxy,
-  Objects_Id      mp_id
+  Thread_Control  *the_proxy
 )
 {
@@ -571,10 +361,11 @@
   _Message_queue_MP_Send_response_packet(
     MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
-    mp_id,
+    the_proxy->Wait.id,
     the_proxy
   );
 }
 
-/*
+/*PAGE
+ *
  *  _Message_queue_MP_Send_extract_proxy
  *
@@ -582,41 +373,25 @@
 
 void _Message_queue_MP_Send_extract_proxy (
-  Thread_Control *the_thread,
-  Objects_Id      id
+  Thread_Control  *the_thread
 )
 {
   _Message_queue_MP_Send_process_packet(
     MESSAGE_QUEUE_MP_EXTRACT_PROXY,
-    id,
-    (rtems_name) 0,
+    the_thread->Wait.id,
+    (Objects_Name) 0,
     the_thread->Object.id
   );
 }
 
-void  _Message_queue_Core_message_queue_mp_support(
-  Thread_Control *the_thread,
-  Objects_Id      id
-)
-{
-  the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
-
-  _Message_queue_MP_Send_response_packet(
-    MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
-    id,
-    the_thread
-  );
-}
-
-static void _Message_queue_MP_Initialize( void )
-{
-  _MPCI_Register_packet_processor(
-    MP_PACKET_MESSAGE_QUEUE,
-    _Message_queue_MP_Process_packet
-  );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Message_queue_MP_Initialize,
-  RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE_MP,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
+/*PAGE
+ *
+ *  _Message_queue_MP_Get_packet
+ *
+ */
+
+Message_queue_MP_Packet *_Message_queue_MP_Get_packet ( void )
+{
+  return ( (Message_queue_MP_Packet *) _MPCI_Get_packet() );
+}
+
+/* end of file */
Index: cpukit/rtems/src/msgqbroadcast.c
===================================================================
--- cpukit/rtems/src/msgqbroadcast.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains the implementation of
- *   rtems_message_queue_broadcast().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/messageimpl.h>
-#include <rtems/rtems/statusimpl.h>
-
-rtems_status_code rtems_message_queue_broadcast(
-  rtems_id    id,
-  const void *buffer,
-  size_t      size,
-  uint32_t   *count
-)
-{
-  Message_queue_Control *the_message_queue;
-  Thread_queue_Context   queue_context;
-  Status_Control         status;
-
-  if ( buffer == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( count == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_message_queue = _Message_queue_Get( id, &queue_context );
-
-  if ( the_message_queue == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Message_queue_MP_Broadcast( id, buffer, size, count );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  _Thread_queue_Context_set_MP_callout(
-    &queue_context,
-    _Message_queue_Core_message_queue_mp_support
-  );
-  status = _CORE_message_queue_Broadcast(
-    &the_message_queue->message_queue,
-    buffer,
-    size,
-    count,
-    &queue_context
-  );
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/msgqconstruct.c
===================================================================
--- cpukit/rtems/src/msgqconstruct.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,218 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains the implementation of
- *   rtems_message_queue_construct().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/messageimpl.h>
-#include <rtems/rtems/attrimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/coremsgimpl.h>
-#include <rtems/sysinit.h>
-
-static void *_Message_queue_Get_buffers(
-  CORE_message_queue_Control *the_message_queue,
-  size_t                      size,
-  const void                 *arg
-)
-{
-  const rtems_message_queue_config *config;
-
-  config = arg;
-
-  if ( config->storage_size != size ) {
-    return NULL;
-  }
-
-  if ( config->storage_free != NULL ) {
-    the_message_queue->free_message_buffers = config->storage_free;
-  } else {
-    the_message_queue->free_message_buffers = _Objects_Free_nothing;
-  }
-
-  return config->storage_area;
-}
-
-rtems_status_code rtems_message_queue_construct(
-  const rtems_message_queue_config *config,
-  rtems_id                         *id
-)
-{
-  if ( config == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  return _Message_queue_Create( config, id, _Message_queue_Get_buffers );
-}
-
-rtems_status_code _Message_queue_Create(
-  const rtems_message_queue_config    *config,
-  rtems_id                            *id,
-  CORE_message_queue_Allocate_buffers  allocate_buffers
-)
-{
-  Message_queue_Control          *the_message_queue;
-  CORE_message_queue_Disciplines  discipline;
-  Status_Control                  status;
-#if defined(RTEMS_MULTIPROCESSING)
-  bool                            is_global;
-#endif
-
-  if ( !rtems_is_name_valid( config->name ) ) {
-    return RTEMS_INVALID_NAME;
-  }
-
-  if ( id == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( config->maximum_pending_messages == 0 ) {
-    return RTEMS_INVALID_NUMBER;
-  }
-
-  if ( config->maximum_message_size == 0 ) {
-    return RTEMS_INVALID_SIZE;
-  }
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( _System_state_Is_multiprocessing ) {
-    is_global = _Attributes_Is_global( config->attributes );
-  } else {
-    is_global = false;
-  }
-
-#if 1
-  /*
-   * I am not 100% sure this should be an error.
-   * It seems reasonable to create a que with a large max size,
-   * and then just send smaller msgs from remote (or all) nodes.
-   */
-  if ( is_global ) {
-    size_t max_packet_payload_size = _MPCI_table->maximum_packet_size
-      - MESSAGE_QUEUE_MP_PACKET_SIZE;
-
-    if ( config->maximum_message_size > max_packet_payload_size ) {
-      return RTEMS_INVALID_SIZE;
-    }
-  }
-#endif
-#endif
-
-  the_message_queue = _Message_queue_Allocate();
-
-  if ( !the_message_queue ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_TOO_MANY;
-  }
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if (
-    is_global
-      && !_Objects_MP_Allocate_and_open(
-            &_Message_queue_Information,
-            config->name,
-            the_message_queue->Object.id,
-            false
-          )
-  ) {
-    _Message_queue_Free( the_message_queue );
-    _Objects_Allocator_unlock();
-    return RTEMS_TOO_MANY;
-  }
-
-  the_message_queue->is_global = is_global;
-#endif
-
-  if ( _Attributes_Is_priority( config->attributes ) ) {
-    discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY;
-  } else {
-    discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO;
-  }
-
-  status = _CORE_message_queue_Initialize(
-    &the_message_queue->message_queue,
-    discipline,
-    config->maximum_pending_messages,
-    config->maximum_message_size,
-    allocate_buffers,
-    config
-  );
-
-  if ( status != STATUS_SUCCESSFUL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( is_global )
-        _Objects_MP_Close(
-          &_Message_queue_Information, the_message_queue->Object.id);
-#endif
-
-    _Message_queue_Free( the_message_queue );
-    _Objects_Allocator_unlock();
-    return _Status_Get( status );
-  }
-
-  *id = _Objects_Open_u32(
-    &_Message_queue_Information,
-    &the_message_queue->Object,
-    config->name
-  );
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( is_global )
-    _Message_queue_MP_Send_process_packet(
-      MESSAGE_QUEUE_MP_ANNOUNCE_CREATE,
-      the_message_queue->Object.id,
-      config->name,
-      0
-    );
-#endif
-
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
-
-static void _Message_queue_Manager_initialization( void )
-{
-  _Objects_Initialize_information( &_Message_queue_Information);
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Message_queue_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/rtems/src/msgqcreate.c
===================================================================
--- cpukit/rtems/src/msgqcreate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,67 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains the implementation of
- *   rtems_message_queue_create().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * 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/messageimpl.h>
-#include <rtems/score/coremsgimpl.h>
-
-#include <string.h>
-
-rtems_status_code rtems_message_queue_create(
-  rtems_name       name,
-  uint32_t         count,
-  size_t           max_message_size,
-  rtems_attribute  attribute_set,
-  rtems_id        *id
-)
-{
-  rtems_message_queue_config config;
-
-  memset( &config, 0, sizeof( config ) );
-  config.name = name;
-  config.maximum_pending_messages = count;
-  config.maximum_message_size = max_message_size;
-  config.attributes = attribute_set;
-
-  return _Message_queue_Create(
-    &config,
-    id,
-    _CORE_message_queue_Workspace_allocate
-  );
-}
Index: cpukit/rtems/src/msgqdelete.c
===================================================================
--- cpukit/rtems/src/msgqdelete.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,102 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains the implementation of
- *   rtems_message_queue_delete().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/messageimpl.h>
-#include <rtems/rtems/attrimpl.h>
-
-rtems_status_code rtems_message_queue_delete(
-  rtems_id id
-)
-{
-  Message_queue_Control *the_message_queue;
-  Thread_queue_Context   queue_context;
-
-  _Objects_Allocator_lock();
-  the_message_queue = _Message_queue_Get( id, &queue_context );
-
-  if ( the_message_queue == NULL ) {
-    _Objects_Allocator_unlock();
-
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Message_queue_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  _CORE_message_queue_Acquire_critical(
-    &the_message_queue->message_queue,
-    &queue_context
-  );
-
-  _Objects_Close( &_Message_queue_Information, &the_message_queue->Object );
-
-  _Thread_queue_Context_set_MP_callout(
-    &queue_context,
-    _Message_queue_MP_Send_object_was_deleted
-  );
-  _CORE_message_queue_Close(
-    &the_message_queue->message_queue,
-    &queue_context
-  );
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( the_message_queue->is_global ) {
-    _Objects_MP_Close(
-      &_Message_queue_Information,
-      the_message_queue->Object.id
-    );
-
-    _Message_queue_MP_Send_process_packet(
-      MESSAGE_QUEUE_MP_ANNOUNCE_DELETE,
-      the_message_queue->Object.id,
-      0,                         /* Not used */
-      0
-    );
-  }
-#endif
-
-  _Message_queue_Free( the_message_queue );
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/msgqflush.c
===================================================================
--- cpukit/rtems/src/msgqflush.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains the implementation of
- *   rtems_message_queue_flush().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/messageimpl.h>
-
-rtems_status_code rtems_message_queue_flush(
-  rtems_id  id,
-  uint32_t *count
-)
-{
-  Message_queue_Control *the_message_queue;
-  Thread_queue_Context   queue_context;
-
-  if ( count == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_message_queue = _Message_queue_Get( id, &queue_context );
-
-  if ( the_message_queue == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Message_queue_MP_Flush( id, count );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  *count = _CORE_message_queue_Flush(
-    &the_message_queue->message_queue,
-    &queue_context
-  );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/msgqgetnumberpending.c
===================================================================
--- cpukit/rtems/src/msgqgetnumberpending.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains the implementation of
- *   rtems_message_queue_get_number_pending().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/messageimpl.h>
-
-rtems_status_code rtems_message_queue_get_number_pending(
-  rtems_id  id,
-  uint32_t *count
-)
-{
-  Message_queue_Control *the_message_queue;
-  Thread_queue_Context   queue_context;
-
-  if ( count == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_message_queue = _Message_queue_Get( id, &queue_context );
-
-  if ( the_message_queue == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Message_queue_MP_Get_number_pending( id, count );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  _CORE_message_queue_Acquire_critical(
-    &the_message_queue->message_queue,
-    &queue_context
-  );
-  *count = the_message_queue->message_queue.number_of_pending_messages;
-  _CORE_message_queue_Release(
-    &the_message_queue->message_queue,
-    &queue_context
-  );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/msgqident.c
===================================================================
--- cpukit/rtems/src/msgqident.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains the implementation of
- *   rtems_message_queue_ident().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- * 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.
- *
- * 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/messageimpl.h>
-#include <rtems/rtems/objectimpl.h>
-
-rtems_status_code rtems_message_queue_ident(
-  rtems_name  name,
-  uint32_t    node,
-  rtems_id   *id
-)
-{
-  return _RTEMS_Name_to_id( name, node, id, &_Message_queue_Information );
-}
Index: cpukit/rtems/src/msgqreceive.c
===================================================================
--- cpukit/rtems/src/msgqreceive.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,99 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains the implementation of
- *   rtems_message_queue_receive().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/messageimpl.h>
-#include <rtems/rtems/optionsimpl.h>
-#include <rtems/rtems/statusimpl.h>
-
-THREAD_QUEUE_OBJECT_ASSERT(
-  Message_queue_Control,
-  message_queue.Wait_queue,
-  MESSAGE_QUEUE_CONTROL
-);
-
-rtems_status_code rtems_message_queue_receive(
-  rtems_id        id,
-  void           *buffer,
-  size_t         *size,
-  rtems_option    option_set,
-  rtems_interval  timeout
-)
-{
-  Message_queue_Control *the_message_queue;
-  Thread_queue_Context   queue_context;
-  Thread_Control        *executing;
-  Status_Control         status;
-
-  if ( buffer == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( size == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_message_queue = _Message_queue_Get( id, &queue_context );
-
-  if ( the_message_queue == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Message_queue_MP_Receive( id, buffer, size, option_set, timeout );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  _CORE_message_queue_Acquire_critical(
-    &the_message_queue->message_queue,
-    &queue_context
-  );
-
-  executing = _Thread_Executing;
-  _Thread_queue_Context_set_enqueue_timeout_ticks( &queue_context, timeout );
-  status = _CORE_message_queue_Seize(
-    &the_message_queue->message_queue,
-    executing,
-    buffer,
-    size,
-    !_Options_Is_no_wait( option_set ),
-    &queue_context
-  );
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/msgqsend.c
===================================================================
--- cpukit/rtems/src/msgqsend.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,85 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains the implementation of
- *   rtems_message_queue_send().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/messageimpl.h>
-#include <rtems/rtems/statusimpl.h>
-
-rtems_status_code rtems_message_queue_send(
-  rtems_id    id,
-  const void *buffer,
-  size_t      size
-)
-{
-  Message_queue_Control *the_message_queue;
-  Thread_queue_Context   queue_context;
-  Status_Control         status;
-
-  if ( buffer == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_message_queue = _Message_queue_Get( id, &queue_context );
-
-  if ( the_message_queue == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Message_queue_MP_Send( id, buffer, size );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  _CORE_message_queue_Acquire_critical(
-    &the_message_queue->message_queue,
-    &queue_context
-  );
-  _Thread_queue_Context_set_MP_callout(
-    &queue_context,
-    _Message_queue_Core_message_queue_mp_support
-  );
-  status = _CORE_message_queue_Send(
-    &the_message_queue->message_queue,
-    buffer,
-    size,
-    false,   /* sender does not block */
-    &queue_context
-  );
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/msgqurgent.c
===================================================================
--- cpukit/rtems/src/msgqurgent.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,85 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicMessage
- *
- * @brief This source file contains the implementation of
- *   rtems_message_queue_urgent().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/messageimpl.h>
-#include <rtems/rtems/statusimpl.h>
-
-rtems_status_code rtems_message_queue_urgent(
-  rtems_id    id,
-  const void *buffer,
-  size_t      size
-)
-{
-  Message_queue_Control *the_message_queue;
-  Thread_queue_Context   queue_context;
-  Status_Control         status;
-
-  if ( buffer == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_message_queue = _Message_queue_Get( id, &queue_context );
-
-  if ( the_message_queue == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Message_queue_MP_Urgent( id, buffer, size );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  _CORE_message_queue_Acquire_critical(
-    &the_message_queue->message_queue,
-    &queue_context
-  );
-  _Thread_queue_Context_set_MP_callout(
-    &queue_context,
-    _Message_queue_Core_message_queue_mp_support
-  );
-  status = _CORE_message_queue_Urgent(
-    &the_message_queue->message_queue,
-    buffer,
-    size,
-    false,   /* sender does not block */
-    &queue_context
-  );
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/part.c
===================================================================
--- cpukit/rtems/src/part.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/part.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,48 +1,322 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicPartition
- *
- * @brief This source file contains a definition of the
- *   ::_Partition_Information with zero objects.
- */
-
 /*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * 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/partdata.h>
-
-OBJECTS_INFORMATION_DEFINE_ZERO(
-  _Partition,
-  OBJECTS_CLASSIC_API,
-  OBJECTS_RTEMS_PARTITIONS,
-  OBJECTS_NO_STRING_NAME
-);
+ *  Partition Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/address.h>
+#include <rtems/config.h>
+#include <rtems/object.h>
+#include <rtems/part.h>
+#include <rtems/thread.h>
+
+/*PAGE
+ *
+ *  _Partition_Manager_initialization
+ *
+ *  This routine initializes all partition manager related
+ *  data structures.
+ *
+ *  Input parameters:
+ *    maximum_partitions - number of partitions to initialize
+ *
+ *  Output parameters:  NONE
+ */
+
+void _Partition_Manager_initialization(
+  unsigned32 maximum_partitions
+)
+{
+  _Objects_Initialize_information(
+    &_Partition_Information,
+    TRUE,
+    maximum_partitions,
+    sizeof( Partition_Control )
+  );
+
+}
+
+/*PAGE
+ *
+ *  rtems_partition_create
+ *
+ *  This directive creates a partiton of fixed sized buffers from the
+ *  given contiguous memory area.
+ *
+ *  Input parameters:
+ *    name             - user defined partition name
+ *    starting_address - physical start address of partition
+ *    length           - physical length in bytes
+ *    buffer_size      - size of buffers in bytes
+ *    attribute_set    - partition attributes
+ *    id               - pointer to partition id
+ *
+ *  Output parameters:
+ *    id                - partition id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_partition_create(
+  Objects_Name        name,
+  void               *starting_address,
+  unsigned32          length,
+  unsigned32          buffer_size,
+  rtems_attribute  attribute_set,
+  Objects_Id         *id
+)
+{
+  register Partition_Control *the_partition;
+
+  if ( !_Objects_Is_name_valid( name ) )
+    return ( RTEMS_INVALID_NAME );
+
+  if ( length == 0 || buffer_size == 0 || length < buffer_size ||
+         !_Partition_Is_buffer_size_aligned( buffer_size ) )
+    return ( RTEMS_INVALID_SIZE );
+
+  if ( !_Addresses_Is_aligned( starting_address ) )
+     return( RTEMS_INVALID_ADDRESS );
+
+  if ( _Attributes_Is_global( attribute_set ) &&
+       !_Configuration_Is_multiprocessing() )
+    return( RTEMS_MP_NOT_CONFIGURED );
+
+  _Thread_Disable_dispatch();               /* prevents deletion */
+
+  the_partition = _Partition_Allocate();
+
+  if ( !the_partition ) {
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  if ( _Attributes_Is_global( attribute_set ) &&
+       !( _Objects_MP_Open( &_Partition_Information, name,
+                            the_partition->Object.id, FALSE ) ) ) {
+    _Partition_Free( the_partition );
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+  the_partition->starting_address      = starting_address;
+  the_partition->length                = length;
+  the_partition->buffer_size           = buffer_size;
+  the_partition->attribute_set         = attribute_set;
+  the_partition->number_of_used_blocks = 0;
+
+  _Chain_Initialize( &the_partition->Memory, starting_address,
+                        length / buffer_size, buffer_size );
+
+  _Objects_Open( &_Partition_Information, &the_partition->Object, name );
+
+  *id = the_partition->Object.id;
+  if ( _Attributes_Is_global( attribute_set ) )
+    _Partition_MP_Send_process_packet(
+      PARTITION_MP_ANNOUNCE_CREATE,
+      the_partition->Object.id,
+      name,
+      0                  /* Not used */
+    );
+
+  _Thread_Enable_dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_partition_ident
+ *
+ *  This directive returns the system ID associated with
+ *  the partition name.
+ *
+ *  Input parameters:
+ *    name - user defined partition name
+ *    node - node(s) to be searched
+ *    id   - pointer to partition id
+ *
+ *  Output parameters:
+ *    *id               - partition id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_partition_ident(
+  Objects_Name  name,
+  unsigned32    node,
+  Objects_Id   *id
+)
+{
+  return( _Objects_Name_to_id( &_Partition_Information, name, node, id ) );
+}
+
+/*PAGE
+ *
+ *  rtems_partition_delete
+ *
+ *  This directive allows a thread to delete a partition specified by
+ *  the partition identifier, provided that none of its buffers are
+ *  still allocated.
+ *
+ *  Input parameters:
+ *    id - partition id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_partition_delete(
+  Objects_Id id
+)
+{
+  register Partition_Control *the_partition;
+  Objects_Locations                  location;
+
+  the_partition = _Partition_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Dispatch();
+      return( RTEMS_ILLEGAL_ON_REMOTE_OBJECT );
+    case OBJECTS_LOCAL:
+      if ( the_partition->number_of_used_blocks == 0 ) {
+        _Objects_Close( &_Partition_Information, &the_partition->Object );
+        _Partition_Free( the_partition );
+        if ( _Attributes_Is_global( the_partition->attribute_set ) ) {
+
+          _Objects_MP_Close(
+            &_Partition_Information,
+            the_partition->Object.id
+          );
+
+          _Partition_MP_Send_process_packet(
+            PARTITION_MP_ANNOUNCE_DELETE,
+            the_partition->Object.id,
+            0,                         /* Not used */
+            0                          /* Not used */
+          );
+        }
+
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_RESOURCE_IN_USE );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_partition_get_buffer
+ *
+ *  This directive will obtain a buffer from a buffer partition.
+ *
+ *  Input parameters:
+ *    id     - partition id
+ *    buffer - pointer to buffer address
+ *
+ *  Output parameters:
+ *    buffer            - pointer to buffer address filled in
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_partition_get_buffer(
+  Objects_Id   id,
+  void       **buffer
+)
+{
+  register Partition_Control *the_partition;
+  Objects_Locations           location;
+  void                       *the_buffer;
+
+  the_partition = _Partition_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Executing->Wait.return_argument = buffer;
+      return(
+        _Partition_MP_Send_request_packet(
+          PARTITION_MP_GET_BUFFER_REQUEST,
+          id,
+          0           /* Not used */
+        )
+      );
+    case OBJECTS_LOCAL:
+      the_buffer = _Partition_Allocate_buffer( the_partition );
+      if ( the_buffer ) {
+        the_partition->number_of_used_blocks += 1;
+        _Thread_Enable_dispatch();
+        *buffer = the_buffer;
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_UNSATISFIED );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_partition_return_buffer
+ *
+ *  This directive will return the given buffer to the specified
+ *  buffer partition.
+ *
+ *  Input parameters:
+ *    id     - partition id
+ *    buffer - pointer to buffer address
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_partition_return_buffer(
+  Objects_Id  id,
+  void       *buffer
+)
+{
+  register Partition_Control *the_partition;
+  Objects_Locations           location;
+
+  the_partition = _Partition_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      return(
+        _Partition_MP_Send_request_packet(
+          PARTITION_MP_RETURN_BUFFER_REQUEST,
+          id,
+          buffer
+        )
+      );
+    case OBJECTS_LOCAL:
+      if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) {
+        _Partition_Free_buffer( the_partition, buffer );
+        the_partition->number_of_used_blocks -= 1;
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_INVALID_ADDRESS );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
Index: cpukit/rtems/src/partcreate.c
===================================================================
--- cpukit/rtems/src/partcreate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,196 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicPartition
- *
- * @brief This source file contains the implementation of
- *   rtems_partition_create() and the Partition Manager system initialization.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/partimpl.h>
-#include <rtems/rtems/attrimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/address.h>
-#include <rtems/score/chainimpl.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/sysinit.h>
-
-static Partition_Control *_Partition_Allocate( void )
-{
-  return (Partition_Control *) _Objects_Allocate( &_Partition_Information );
-}
-
-static void _Partition_Initialize(
-  Partition_Control *the_partition,
-  void              *starting_address,
-  uintptr_t          length,
-  size_t             buffer_size,
-  rtems_attribute    attribute_set
-)
-{
-  const void *limit_address;
-
-  limit_address = _Addresses_Add_offset( starting_address, length - 1 );
-  the_partition->base_address          = starting_address;
-  the_partition->limit_address         = limit_address;
-  the_partition->buffer_size           = buffer_size;
-  the_partition->attribute_set         = attribute_set;
-  the_partition->number_of_used_blocks = 0;
-
-  _Chain_Initialize(
-    &the_partition->Memory,
-    starting_address,
-    length / buffer_size,
-    buffer_size
-  );
-
-  _ISR_lock_Initialize( &the_partition->Lock, "Partition" );
-}
-
-rtems_status_code rtems_partition_create(
-  rtems_name       name,
-  void            *starting_address,
-  uintptr_t        length,
-  size_t           buffer_size,
-  rtems_attribute  attribute_set,
-  rtems_id        *id
-)
-{
-  Partition_Control *the_partition;
-
-  if ( !rtems_is_name_valid( name ) ) {
-    return RTEMS_INVALID_NAME;
-  }
-
-  if ( id == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( starting_address == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( length == 0 ) {
-    return RTEMS_INVALID_SIZE;
-  }
-
-  if ( buffer_size == 0 ) {
-    return RTEMS_INVALID_SIZE;
-  }
-
-  if ( length < buffer_size ) {
-    return RTEMS_INVALID_SIZE;
-  }
-
-  /*
-   * Ensure that the buffer size is an integral multiple of the pointer size so
-   * that each buffer begin meets the chain node alignment.
-   */
-  if ( buffer_size % CPU_SIZEOF_POINTER != 0 ) {
-    return RTEMS_INVALID_SIZE;
-  }
-
-  if ( buffer_size < sizeof( Chain_Node ) )
-    return RTEMS_INVALID_SIZE;
-
-  /*
-   * Ensure that the buffer area starting address is aligned on a pointer
-   * boundary so that each buffer begin meets the chain node alignment.
-   */
-  if ( (uintptr_t) starting_address % CPU_SIZEOF_POINTER != 0 ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( !_System_state_Is_multiprocessing ) {
-    attribute_set = _Attributes_Clear( attribute_set, RTEMS_GLOBAL );
-  }
-#endif
-
-  the_partition = _Partition_Allocate();
-
-  if ( !the_partition ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_TOO_MANY;
-  }
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( _Attributes_Is_global( attribute_set ) &&
-       !( _Objects_MP_Allocate_and_open( &_Partition_Information, name,
-                            the_partition->Object.id, false ) ) ) {
-    _Objects_Free( &_Partition_Information, &the_partition->Object );
-    _Objects_Allocator_unlock();
-    return RTEMS_TOO_MANY;
-  }
-#endif
-
-  _Partition_Initialize(
-    the_partition,
-    starting_address,
-    length,
-    buffer_size,
-    attribute_set
-  );
-
-  *id = _Objects_Open_u32(
-    &_Partition_Information,
-    &the_partition->Object,
-    name
-  );
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( _Attributes_Is_global( attribute_set ) )
-    _Partition_MP_Send_process_packet(
-      PARTITION_MP_ANNOUNCE_CREATE,
-      the_partition->Object.id,
-      name,
-      0                  /* Not used */
-    );
-#endif
-
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
-
-static void _Partition_Manager_initialization( void )
-{
-  _Objects_Initialize_information( &_Partition_Information );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Partition_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_PARTITION,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/rtems/src/partdelete.c
===================================================================
--- cpukit/rtems/src/partdelete.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,98 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicPartition
- *
- * @brief This source file contains the implementation of
- *   rtems_partition_delete().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/partimpl.h>
-#include <rtems/rtems/attrimpl.h>
-
-rtems_status_code rtems_partition_delete(
-  rtems_id id
-)
-{
-  Partition_Control *the_partition;
-  ISR_lock_Context   lock_context;
-
-  _Objects_Allocator_lock();
-  the_partition = _Partition_Get( id, &lock_context );
-
-  if ( the_partition == NULL ) {
-    _Objects_Allocator_unlock();
-
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Partition_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  _Partition_Acquire_critical( the_partition, &lock_context );
-
-  if ( the_partition->number_of_used_blocks != 0 ) {
-    _Partition_Release( the_partition, &lock_context );
-    _Objects_Allocator_unlock();
-    return RTEMS_RESOURCE_IN_USE;
-  }
-
-  _Objects_Close( &_Partition_Information, &the_partition->Object );
-  _Partition_Release( the_partition, &lock_context );
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( _Attributes_Is_global( the_partition->attribute_set ) ) {
-    _Objects_MP_Close(
-      &_Partition_Information,
-      the_partition->Object.id
-    );
-
-    _Partition_MP_Send_process_packet(
-      PARTITION_MP_ANNOUNCE_DELETE,
-      the_partition->Object.id,
-      0,                         /* Not used */
-      0                          /* Not used */
-    );
-  }
-#endif
-
-  _ISR_lock_Destroy( &the_partition->Lock );
-  _Objects_Free( &_Partition_Information, &the_partition->Object );
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/partgetbuffer.c
===================================================================
--- cpukit/rtems/src/partgetbuffer.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,85 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicPartition
- *
- * @brief This source file contains the implementation of
- *   rtems_partition_get_buffer().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/partimpl.h>
-#include <rtems/score/chainimpl.h>
-
-static void *_Partition_Allocate_buffer( Partition_Control *the_partition )
-{
-  return _Chain_Get_unprotected( &the_partition->Memory );
-}
-
-rtems_status_code rtems_partition_get_buffer(
-  rtems_id   id,
-  void     **buffer
-)
-{
-  Partition_Control *the_partition;
-  ISR_lock_Context   lock_context;
-  void              *the_buffer;
-
-  if ( buffer == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_partition = _Partition_Get( id, &lock_context );
-
-  if ( the_partition == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Partition_MP_Get_buffer( id, buffer );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  _Partition_Acquire_critical( the_partition, &lock_context );
-  the_buffer = _Partition_Allocate_buffer( the_partition );
-
-  if ( the_buffer == NULL ) {
-    _Partition_Release( the_partition, &lock_context );
-    return RTEMS_UNSATISFIED;
-  }
-
-  the_partition->number_of_used_blocks += 1;
-  _Partition_Release( the_partition, &lock_context );
-  *buffer = the_buffer;
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/partident.c
===================================================================
--- cpukit/rtems/src/partident.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicPartition
- *
- * @brief This source file contains the implementation of
- *   rtems_partition_ident().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- * 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.
- *
- * 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/partimpl.h>
-#include <rtems/rtems/objectimpl.h>
-
-rtems_status_code rtems_partition_ident(
-  rtems_name  name,
-  uint32_t    node,
-  rtems_id   *id
-)
-{
-  return _RTEMS_Name_to_id( name, node, id, &_Partition_Information );
-}
Index: cpukit/rtems/src/partmp.c
===================================================================
--- cpukit/rtems/src/partmp.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/partmp.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,74 +1,27 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicPartitionMP
- *
- * @brief This source file contains the implementation to support the Partition
- *   Manager in multiprocessing (MP) configurations.
- */
-
 /*
- *  COPYRIGHT (c) 1989-2008.
+ *  Multiprocessing Support for the Partition Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
  *  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.
- *
- * 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/partimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/statesimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/threadqimpl.h>
-#include <rtems/sysinit.h>
-
-RTEMS_STATIC_ASSERT(
-  sizeof(Partition_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE,
-  Partition_MP_Packet
-);
-
-static Partition_MP_Packet *_Partition_MP_Get_packet( void )
-{
-  return (Partition_MP_Packet *) _MPCI_Get_packet();
-}
-
-static void _Partition_MP_Initialize_packet(
-  Partition_MP_Packet            *the_packet,
-  Objects_Id                      id,
-  Partition_MP_Remote_operations  operation
-)
-{
-  the_packet->Prefix.the_class  = MP_PACKET_PARTITION;
-  the_packet->Prefix.length     = sizeof( *the_packet );
-  the_packet->Prefix.to_convert = sizeof( *the_packet );
-  the_packet->Prefix.id         = id;
-  the_packet->operation         = operation;
-}
-
-/*
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/mpci.h>
+#include <rtems/mppkt.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/part.h>
+#include <rtems/thread.h>
+
+/*PAGE
+ *
  *  _Partition_MP_Send_process_packet
  *
@@ -78,10 +31,10 @@
   Partition_MP_Remote_operations  operation,
   Objects_Id                      partition_id,
-  rtems_name                      name,
+  Objects_Name                    name,
   Objects_Id                      proxy_id
 )
 {
   Partition_MP_Packet *the_packet;
-  uint32_t             node;
+  unsigned32           node;
 
   switch ( operation ) {
@@ -91,11 +44,15 @@
     case PARTITION_MP_EXTRACT_PROXY:
 
-      the_packet = _Partition_MP_Get_packet();
-      _Partition_MP_Initialize_packet( the_packet, partition_id, operation );
-      the_packet->name     = name;
-      the_packet->proxy_id = proxy_id;
+      the_packet                    = _Partition_MP_Get_packet();
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_PARTITION;
+      the_packet->Prefix.length     = sizeof ( Partition_MP_Packet );
+      the_packet->Prefix.to_convert = sizeof ( Partition_MP_Packet );
+      the_packet->operation         = operation;
+      the_packet->Prefix.id         = partition_id;
+      the_packet->name              = name;
+      the_packet->proxy_id          = proxy_id;
 
       if ( operation == PARTITION_MP_EXTRACT_PROXY )
-         node = _Objects_Get_node( partition_id );
+         node = rtems_get_node( partition_id );
       else
          node = MPCI_ALL_NODES;
@@ -112,21 +69,17 @@
 }
 
-/*
+/*PAGE
+ *
  *  _Partition_MP_Send_request_packet
  *
  */
 
-static rtems_status_code _Partition_MP_Send_request_packet (
+rtems_status_code _Partition_MP_Send_request_packet (
+  Partition_MP_Remote_operations  operation,
   Objects_Id                      partition_id,
-  void                           *buffer,
-  Partition_MP_Remote_operations  operation
+  void                           *buffer
 )
 {
   Partition_MP_Packet *the_packet;
-  Status_Control       status;
-
-  if ( !_Partition_MP_Is_remote( partition_id ) ) {
-    return RTEMS_INVALID_ID;
-  }
 
   switch ( operation ) {
@@ -135,14 +88,20 @@
     case PARTITION_MP_RETURN_BUFFER_REQUEST:
 
-      the_packet = _Partition_MP_Get_packet();
-      _Partition_MP_Initialize_packet( the_packet, partition_id, operation );
-      the_packet->buffer = buffer;
-
-      status = _MPCI_Send_request_packet(
-        _Objects_Get_node( partition_id ),
-        &the_packet->Prefix,
-        STATES_READY /* Not used */
-      );
-      return _Status_Get( status );
+      the_packet                    = _Partition_MP_Get_packet();
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_PARTITION;
+      the_packet->Prefix.length     = sizeof ( Partition_MP_Packet );
+      the_packet->Prefix.to_convert = sizeof ( Partition_MP_Packet );
+      the_packet->operation         = operation;
+      the_packet->Prefix.id         = partition_id;
+      the_packet->buffer            = buffer;
+
+      return
+        _MPCI_Send_request_packet(
+          rtems_get_node( partition_id ),
+          &the_packet->Prefix,
+          STATES_READY      /* Not used */
+        );
+
+      break;
 
     case PARTITION_MP_ANNOUNCE_CREATE:
@@ -161,35 +120,11 @@
 }
 
-rtems_status_code _Partition_MP_Get_buffer(
-  rtems_id   id,
-  void     **buffer
-)
-{
-  _Thread_Get_executing()->Wait.return_argument = buffer;
-  return _Partition_MP_Send_request_packet(
-    id,
-    buffer,
-    PARTITION_MP_GET_BUFFER_REQUEST
-  );
-}
-
-rtems_status_code _Partition_MP_Return_buffer(
-  rtems_id  id,
-  void     *buffer
-)
-{
-  return _Partition_MP_Send_request_packet(
-    id,
-    buffer,
-    PARTITION_MP_RETURN_BUFFER_REQUEST
-  );
-}
-
-/*
+/*PAGE
+ *
  *  _Partition_MP_Send_response_packet
  *
  */
 
-static void _Partition_MP_Send_response_packet (
+void _Partition_MP_Send_response_packet (
   Partition_MP_Remote_operations  operation,
   Objects_Id                      partition_id,
@@ -214,5 +149,5 @@
 
       _MPCI_Send_response_packet(
-        _Objects_Get_node( the_packet->Prefix.source_tid ),
+        rtems_get_node( the_packet->Prefix.source_tid ),
         &the_packet->Prefix
       );
@@ -229,5 +164,12 @@
 }
 
-static void _Partition_MP_Process_packet(
+/*PAGE
+ *
+ *
+ *  _Partition_MP_Process_packet
+ *
+ */
+
+void _Partition_MP_Process_packet (
   rtems_packet_prefix  *the_packet_prefix
 )
@@ -235,4 +177,5 @@
   Partition_MP_Packet *the_packet;
   Thread_Control      *the_thread;
+  boolean              ignored;
 
   the_packet = (Partition_MP_Packet *) the_packet_prefix;
@@ -242,10 +185,10 @@
     case PARTITION_MP_ANNOUNCE_CREATE:
 
-      _Objects_MP_Allocate_and_open(
-        &_Partition_Information,
-        the_packet->name,
-        the_packet->Prefix.id,
-        true
-      );
+      ignored = _Objects_MP_Open(
+                  &_Partition_Information,
+                  the_packet->name,
+                  the_packet->Prefix.id,
+                  TRUE
+                );
 
       _MPCI_Return_packet( the_packet_prefix );
@@ -263,7 +206,6 @@
       the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
 
-      if ( the_thread != NULL ) {
-        _Thread_queue_Extract( the_thread );
-      }
+      if ( ! _Thread_Is_null( the_thread ) )
+         _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
 
       _MPCI_Return_packet( the_packet_prefix );
@@ -317,5 +259,6 @@
 }
 
-/*
+/*PAGE
+ *
  *  _Partition_MP_Send_object_was_deleted
  *
@@ -325,5 +268,6 @@
  */
 
-/*
+/*PAGE
+ *
  *  _Partition_MP_Send_extract_proxy
  *
@@ -331,12 +275,11 @@
 
 void _Partition_MP_Send_extract_proxy (
-  Thread_Control *the_thread,
-  Objects_Id      id
+  Thread_Control *the_thread
 )
 {
   _Partition_MP_Send_process_packet(
     PARTITION_MP_EXTRACT_PROXY,
-    id,
-    (rtems_name) 0,
+    the_thread->Wait.id,
+    (Objects_Name) 0,
     the_thread->Object.id
   );
@@ -344,15 +287,14 @@
 }
 
-static void _Partition_MP_Initialize( void )
-{
-  _MPCI_Register_packet_processor(
-    MP_PACKET_PARTITION,
-    _Partition_MP_Process_packet
-  );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Partition_MP_Initialize,
-  RTEMS_SYSINIT_CLASSIC_PARTITION_MP,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
+/*PAGE
+ *
+ *  _Partition_MP_Get_packet
+ *
+ */
+
+Partition_MP_Packet *_Partition_MP_Get_packet ( void )
+{
+  return ( (Partition_MP_Packet *) _MPCI_Get_packet() );
+}
+
+/* end of file */
Index: cpukit/rtems/src/partreturnbuffer.c
===================================================================
--- cpukit/rtems/src/partreturnbuffer.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,116 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicPartition
- *
- * @brief This source file contains the implementation of
- *   rtems_partition_return_buffer().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/partimpl.h>
-#include <rtems/score/address.h>
-#include <rtems/score/chainimpl.h>
-
-static bool _Partition_Is_address_on_buffer_boundary(
-  const Partition_Control *the_partition,
-  const void              *the_buffer
-)
-{
-  intptr_t offset;
-
-  offset = _Addresses_Subtract(
-    the_buffer,
-    the_partition->base_address
-  );
-
-  return ( offset % the_partition->buffer_size ) == 0;
-}
-
-static bool _Partition_Is_address_a_buffer_begin(
-   const Partition_Control *the_partition,
-   const void              *the_buffer
-)
-{
-  const void *base;
-  const void *limit;
-
-  base = the_partition->base_address;
-  limit = the_partition->limit_address;
-
-  if ( !_Addresses_Is_in_range( the_buffer, base, limit ) ) {
-    return false;
-  }
-
-  return _Partition_Is_address_on_buffer_boundary( the_partition, the_buffer );
-}
-
-static void _Partition_Free_buffer(
-  Partition_Control *the_partition,
-  void              *the_buffer
-)
-{
-  _Chain_Append_unprotected( &the_partition->Memory, the_buffer );
-}
-
-rtems_status_code rtems_partition_return_buffer(
-  rtems_id  id,
-  void     *buffer
-)
-{
-  Partition_Control *the_partition;
-  ISR_lock_Context   lock_context;
-
-  the_partition = _Partition_Get( id, &lock_context );
-
-  if ( the_partition == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Partition_MP_Return_buffer( id, buffer );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  _Partition_Acquire_critical( the_partition, &lock_context );
-
-  if ( !_Partition_Is_address_a_buffer_begin( the_partition, buffer ) ) {
-    _Partition_Release( the_partition, &lock_context );
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  _Partition_Free_buffer( the_partition, buffer );
-  the_partition->number_of_used_blocks -= 1;
-  _Partition_Release( the_partition, &lock_context );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/ratemon.c
===================================================================
--- cpukit/rtems/src/ratemon.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/ratemon.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,48 +1,401 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains a definition of the
- *   ::_Rate_monotonic_Information with zero objects.
- */
-
 /*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * 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/ratemondata.h>
-
-OBJECTS_INFORMATION_DEFINE_ZERO(
-  _Rate_monotonic,
-  OBJECTS_CLASSIC_API,
-  OBJECTS_RTEMS_PERIODS,
-  OBJECTS_NO_STRING_NAME
-);
+ *  Rate Monotonic Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/isr.h>
+#include <rtems/object.h>
+#include <rtems/ratemon.h>
+#include <rtems/thread.h>
+
+/*PAGE
+ *
+ *  _Rate_monotonic_Manager_initialization
+ *
+ *  This routine initializes all Rate Monotonic Manager related
+ *  data structures.
+ *
+ *  Input parameters:
+ *    maximum_periods - number of periods timers to initialize
+ *
+ *  Output parameters:  NONE
+ *
+ *  NOTE: The Rate Monotonic Manager is built on top of the Watchdog
+ *        Handler.
+ */
+
+void _Rate_monotonic_Manager_initialization(
+  unsigned32 maximum_periods
+)
+{
+  _Objects_Initialize_information(
+     &_Rate_monotonic_Information,
+     FALSE,
+     maximum_periods,
+     sizeof( Rate_monotonic_Control )
+  );
+}
+
+/*PAGE
+ *
+ *  rtems_rate_monotonic_create
+ *
+ *  This directive creates a rate monotonic timer and performs
+ *  some initialization.
+ *
+ *  Input parameters:
+ *    name - name of period
+ *    id   - pointer to rate monotonic id
+ *
+ *  Output parameters:
+ *    id                - rate monotonic id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_rate_monotonic_create(
+  Objects_Name  name,
+  Objects_Id   *id
+)
+{
+  Rate_monotonic_Control *the_period;
+
+  if ( !_Objects_Is_name_valid( name ) )
+    return( RTEMS_INVALID_NAME );
+
+  _Thread_Disable_dispatch();            /* to prevent deletion */
+
+  the_period = _Rate_monotonic_Allocate();
+
+  if ( !the_period ) {
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  the_period->owner = _Thread_Executing;
+  the_period->state = RATE_MONOTONIC_INACTIVE;
+
+  _Objects_Open( &_Rate_monotonic_Information, &the_period->Object, name );
+
+  *id = the_period->Object.id;
+  _Thread_Enable_dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_rate_monotonic_ident
+ *
+ *  This directive returns the system ID associated with
+ *  the rate monotonic period name.
+ *
+ *  Input parameters:
+ *    name - user defined period name
+ *    id   - pointer to period id
+ *
+ *  Output parameters:
+ *    *id               - region id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_rate_monotonic_ident(
+  Objects_Name  name,
+  Objects_Id   *id
+)
+{
+  return _Objects_Name_to_id(
+    &_Rate_monotonic_Information,
+    name,
+    RTEMS_SEARCH_LOCAL_NODE,
+    id
+  );
+}
+
+/*PAGE
+ *
+ *  rtems_rate_monotonic_cancel
+ *
+ *  This directive allows a thread to cancel a rate monotonic timer.
+ *
+ *  Input parameters:
+ *    id - rate monotonic id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful and caller is not the owning thread
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_rate_monotonic_cancel(
+  Objects_Id id
+)
+{
+  Rate_monotonic_Control *the_period;
+  Objects_Locations              location;
+
+  the_period = _Rate_monotonic_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:            /* should never return this */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      if ( !_Thread_Is_executing( the_period->owner ) ) {
+        _Thread_Enable_dispatch();
+        return( RTEMS_NOT_OWNER_OF_RESOURCE );
+      }
+      (void) _Watchdog_Remove( &the_period->Timer );
+      the_period->state = RATE_MONOTONIC_INACTIVE;
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_rate_monotonic_delete
+ *
+ *  This directive allows a thread to delete a rate monotonic timer.
+ *
+ *  Input parameters:
+ *    id - rate monotonic id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_rate_monotonic_delete(
+  Objects_Id id
+)
+{
+  Rate_monotonic_Control *the_period;
+  Objects_Locations              location;
+
+  the_period = _Rate_monotonic_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:            /* should never return this */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      _Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
+      (void) _Watchdog_Remove( &the_period->Timer );
+      the_period->state = RATE_MONOTONIC_INACTIVE;
+      _Rate_monotonic_Free( the_period );
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_rate_monotonic_period
+ *
+ *  This directive allows a thread to manipulate a rate monotonic timer.
+ *
+ *  Input parameters:
+ *    id     - rate monotonic id
+ *    length - length of period (in ticks)
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_rate_monotonic_period(
+  Objects_Id        id,
+  rtems_interval length
+)
+{
+  Rate_monotonic_Control *the_period;
+  Objects_Locations       location;
+  rtems_status_code            return_value;
+
+  the_period = _Rate_monotonic_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:            /* should never return this */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      if ( !_Thread_Is_executing( the_period->owner ) ) {
+        _Thread_Enable_dispatch();
+        return( RTEMS_NOT_OWNER_OF_RESOURCE );
+      }
+
+      if ( length == RTEMS_PERIOD_STATUS ) {
+        switch ( the_period->state ) {
+          case RATE_MONOTONIC_INACTIVE:
+            return_value = RTEMS_NOT_DEFINED;
+            break;
+          case RATE_MONOTONIC_ACTIVE:
+            return_value = RTEMS_SUCCESSFUL;
+            break;
+          case RATE_MONOTONIC_EXPIRED:
+            return_value = RTEMS_TIMEOUT;
+            break;
+          default:              /* unreached -- only to remove warnings */
+            return_value = RTEMS_INTERNAL_ERROR;
+            break;
+        }
+        _Thread_Enable_dispatch();
+        return( return_value );
+      }
+
+      switch ( the_period->state ) {
+        case RATE_MONOTONIC_INACTIVE:
+          the_period->state = RATE_MONOTONIC_ACTIVE;
+          _Watchdog_Initialize(
+            &the_period->Timer,
+            _Rate_monotonic_Timeout,
+            id,
+            NULL
+          );
+          _Watchdog_Insert_ticks(
+                     &the_period->Timer, length, WATCHDOG_ACTIVATE_NOW );
+          _Thread_Enable_dispatch();
+          return( RTEMS_SUCCESSFUL );
+
+        case RATE_MONOTONIC_ACTIVE:
+/* following is and could be a critical section problem */
+          _Thread_Executing->Wait.id  = the_period->Object.id;
+          if ( _Rate_monotonic_Set_state( the_period ) ) {
+            _Thread_Enable_dispatch();
+            return( RTEMS_SUCCESSFUL );
+          }
+         /* has expired -- fall into next case */
+        case RATE_MONOTONIC_EXPIRED:
+          the_period->state = RATE_MONOTONIC_ACTIVE;
+          _Watchdog_Insert_ticks(
+                     &the_period->Timer, length, WATCHDOG_ACTIVATE_NOW );
+          _Thread_Enable_dispatch();
+          return( RTEMS_TIMEOUT );
+      }
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ * _Rate_monotonic_Set_state
+ *
+ * This kernel routine sets the STATES_WAITING_FOR_PERIOD state in
+ * the running thread's tcb if the specified period has not expired.
+ * The ready chain is adjusted if necessary.
+ *
+ * Input parameters:
+ *   the_period - pointer to period control block
+ *
+ * Output parameters:
+ *   TRUE  - if blocked successfully for period
+ *   FALSE - if period has expired
+ *
+ *  INTERRUPT LATENCY:
+ *    delete node
+ *    priority map
+ *    select heir
+ */
+
+boolean _Rate_monotonic_Set_state(
+Rate_monotonic_Control *the_period
+)
+{
+  Thread_Control *executing;
+  Chain_Control  *ready;
+  ISR_Level              level;
+  States_Control         old_state;
+
+  executing = _Thread_Executing;
+  ready     = executing->ready;
+  _ISR_Disable( level );
+
+  old_state = executing->current_state;
+
+  if ( _Rate_monotonic_Is_expired( the_period ) ) {
+    _ISR_Enable( level );
+    return( FALSE );
+  }
+
+  executing->current_state =
+             _States_Set( STATES_WAITING_FOR_PERIOD, old_state );
+
+  if ( _States_Is_ready( old_state ) ) {
+    if ( _Chain_Has_only_one_node( ready ) ) {
+      _Chain_Initialize_empty( ready );
+      _Priority_Remove_from_bit_map( &executing->Priority_map );
+      _ISR_Flash( level );
+    } else {
+      _Chain_Extract_unprotected( &executing->Object.Node );
+      _ISR_Flash( level );
+    }
+
+    if ( _Thread_Is_heir( executing ) )
+      _Thread_Calculate_heir();
+
+    _Context_Switch_necessary = TRUE;
+  }
+
+  _ISR_Enable( level );
+  return( TRUE );
+}
+
+/*PAGE
+ *
+ *  _Rate_monotonic_Timeout
+ *
+ *  This routine processes a period ending.  If the owning thread
+ *  is waiting for the period, that thread is unblocked and the
+ *  period reinitiated.  Otherwise, the period is expired.
+ *  This routine is called by the watchdog handler.
+ *
+ *  Input parameters:
+ *    id - period id
+ *
+ *  Output parameters: NONE
+ */
+
+void _Rate_monotonic_Timeout(
+  Objects_Id  id,
+  void       *ignored
+)
+{
+  Rate_monotonic_Control *the_period;
+  Objects_Locations              location;
+  Thread_Control         *the_thread;
+
+  the_period = _Rate_monotonic_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+    case OBJECTS_REMOTE:  /* impossible */
+      break;
+    case OBJECTS_LOCAL:
+      the_thread = the_period->owner;
+      if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
+            the_thread->Wait.id == the_period->Object.id ) {
+        _Thread_Unblock( the_thread );
+        _Watchdog_Reset( &the_period->Timer );
+      }
+      else
+        the_period->state = RATE_MONOTONIC_EXPIRED;
+      _Thread_Unnest_dispatch();
+      break;
+  }
+}
+
Index: cpukit/rtems/src/ratemoncancel.c
===================================================================
--- cpukit/rtems/src/ratemoncancel.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   rtems_rate_monotonic_cancel().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *  Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * 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/ratemonimpl.h>
-
-void _Rate_monotonic_Cancel(
-  Rate_monotonic_Control *the_period,
-  Thread_Control         *owner,
-  ISR_lock_Context       *lock_context
-)
-{
-  Per_CPU_Control      *cpu_self;
-  Thread_queue_Context  queue_context;
-
-  _Rate_monotonic_Acquire_critical( the_period, lock_context );
-
-  _Watchdog_Per_CPU_remove_ticks( &the_period->Timer );
-  the_period->postponed_jobs = 0;
-  the_period->state = RATE_MONOTONIC_INACTIVE;
-  _Scheduler_Cancel_job(
-    the_period->owner,
-    &the_period->Priority,
-    &queue_context
-  );
-
-  cpu_self = _Thread_Dispatch_disable_critical( lock_context );
-  _Rate_monotonic_Release( the_period, lock_context );
-  _Thread_Priority_update( &queue_context );
-  _Thread_Dispatch_enable( cpu_self );
-}
-
-rtems_status_code rtems_rate_monotonic_cancel(
-  rtems_id id
-)
-{
-  Rate_monotonic_Control *the_period;
-  ISR_lock_Context        lock_context;
-  Thread_Control         *executing;
-
-  the_period = _Rate_monotonic_Get( id, &lock_context );
-  if ( the_period == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  executing = _Thread_Executing;
-  if ( executing != the_period->owner ) {
-    _ISR_lock_ISR_enable( &lock_context );
-    return RTEMS_NOT_OWNER_OF_RESOURCE;
-  }
-
-  _Rate_monotonic_Cancel( the_period, executing, &lock_context );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/ratemoncreate.c
===================================================================
--- cpukit/rtems/src/ratemoncreate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,101 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   rtems_rate_monotonic_create().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/ratemonimpl.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/watchdogimpl.h>
-#include <rtems/sysinit.h>
-
-rtems_status_code rtems_rate_monotonic_create(
-  rtems_name  name,
-  rtems_id   *id
-)
-{
-  Rate_monotonic_Control *the_period;
-
-  if ( !rtems_is_name_valid( name ) )
-    return RTEMS_INVALID_NAME;
-
-  if ( !id )
-    return RTEMS_INVALID_ADDRESS;
-
-  the_period = _Rate_monotonic_Allocate();
-
-  if ( !the_period ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_TOO_MANY;
-  }
-
-  _ISR_lock_Initialize( &the_period->Lock, "Rate Monotonic Period" );
-  _Priority_Node_initialize( &the_period->Priority, 0 );
-  _Priority_Node_set_inactive( &the_period->Priority );
-
-  the_period->owner = _Thread_Get_executing();
-  the_period->state = RATE_MONOTONIC_INACTIVE;
-  the_period->postponed_jobs = 0;
-
-  _Watchdog_Preinitialize( &the_period->Timer, _Per_CPU_Get_by_index( 0 ) );
-  _Watchdog_Initialize( &the_period->Timer, _Rate_monotonic_Timeout );
-
-  _Rate_monotonic_Reset_statistics( the_period );
-
-  *id = _Objects_Open_u32(
-    &_Rate_monotonic_Information,
-    &the_period->Object,
-    name
-  );
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
-
-static void _Rate_monotonic_Manager_initialization( void )
-{
-  _Objects_Initialize_information( &_Rate_monotonic_Information );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Rate_monotonic_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/rtems/src/ratemondelete.c
===================================================================
--- cpukit/rtems/src/ratemondelete.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   rtems_rate_monotonic_delete().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *  Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * 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/ratemonimpl.h>
-
-rtems_status_code rtems_rate_monotonic_delete(
-  rtems_id id
-)
-{
-  Rate_monotonic_Control *the_period;
-  ISR_lock_Context        lock_context;
-  rtems_status_code       status;
-
-  _Objects_Allocator_lock();
-
-  the_period = _Rate_monotonic_Get( id, &lock_context );
-  if ( the_period != NULL ) {
-    _Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
-    _Rate_monotonic_Cancel( the_period, the_period->owner, &lock_context );
-    _Objects_Free( &_Rate_monotonic_Information, &the_period->Object );
-    status = RTEMS_SUCCESSFUL;
-  } else {
-    status = RTEMS_INVALID_ID;
-  }
-
-  _Objects_Allocator_unlock();
-
-  return status;
-}
Index: cpukit/rtems/src/ratemongetstatistics.c
===================================================================
--- cpukit/rtems/src/ratemongetstatistics.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,77 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   rtems_rate_monotonic_get_statistics().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2009.
- *  On-Line Applications Research Corporation (OAR).
- *  Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * 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/ratemonimpl.h>
-
-rtems_status_code rtems_rate_monotonic_get_statistics(
-  rtems_id                                id,
-  rtems_rate_monotonic_period_statistics *dst
-)
-{
-  Rate_monotonic_Control          *the_period;
-  ISR_lock_Context                 lock_context;
-  const Rate_monotonic_Statistics *src;
-
-  if ( dst == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_period = _Rate_monotonic_Get( id, &lock_context );
-  if ( the_period == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  _Rate_monotonic_Acquire_critical( the_period, &lock_context );
-
-  src = &the_period->Statistics;
-  dst->count        = src->count;
-  dst->missed_count = src->missed_count;
-  _Timestamp_To_timespec( &src->min_cpu_time,    &dst->min_cpu_time );
-  _Timestamp_To_timespec( &src->max_cpu_time,    &dst->max_cpu_time );
-  _Timestamp_To_timespec( &src->total_cpu_time,  &dst->total_cpu_time );
-  _Timestamp_To_timespec( &src->min_wall_time,   &dst->min_wall_time );
-  _Timestamp_To_timespec( &src->max_wall_time,   &dst->max_wall_time );
-  _Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time );
-
-  _Rate_monotonic_Release( the_period, &lock_context );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/ratemongetstatus.c
===================================================================
--- cpukit/rtems/src/ratemongetstatus.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,99 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   rtems_rate_monotonic_get_status().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2009.
- *  On-Line Applications Research Corporation (OAR).
- *  Copyright (c) 2016 embedded brains GmbH & Co. KG
- *  Copyright (c) 2017 Kuan-Hsun Chen.
- *
- * 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/ratemonimpl.h>
-
-rtems_status_code rtems_rate_monotonic_get_status(
-  rtems_id                            id,
-  rtems_rate_monotonic_period_status *period_status
-)
-{
-  Rate_monotonic_Control *the_period;
-  ISR_lock_Context        lock_context;
-
-  if ( period_status == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_period = _Rate_monotonic_Get( id, &lock_context );
-  if ( the_period == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  _Rate_monotonic_Acquire_critical( the_period, &lock_context );
-
-  period_status->owner = the_period->owner->Object.id;
-  period_status->state = the_period->state;
-  period_status->postponed_jobs_count = the_period->postponed_jobs;
-
-  if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
-    /*
-     *  If the period is inactive, there is no information.
-     */
-    _Timespec_Set_to_zero( &period_status->since_last_period );
-    _Timespec_Set_to_zero( &period_status->executed_since_last_period );
-  } else {
-    Timestamp_Control wall_since_last_period;
-    Timestamp_Control cpu_since_last_period;
-
-    /*
-     *  Grab the current status.
-     */
-    _Rate_monotonic_Get_status(
-      the_period,
-      &wall_since_last_period,
-      &cpu_since_last_period
-    );
-    _Timestamp_To_timespec(
-      &wall_since_last_period,
-      &period_status->since_last_period
-    );
-    _Timestamp_To_timespec(
-      &cpu_since_last_period,
-      &period_status->executed_since_last_period
-    );
-  }
-
-  _Rate_monotonic_Release( the_period, &lock_context );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/ratemonident.c
===================================================================
--- cpukit/rtems/src/ratemonident.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   rtems_rate_monotonic_ident().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- * 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.
- *
- * 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/ratemonimpl.h>
-#include <rtems/rtems/objectimpl.h>
-
-rtems_status_code rtems_rate_monotonic_ident( rtems_name name, rtems_id *id )
-{
-  return _RTEMS_Name_to_id(
-    name,
-    OBJECTS_SEARCH_LOCAL_NODE,
-    id,
-    &_Rate_monotonic_Information
-  );
-}
Index: cpukit/rtems/src/ratemonperiod.c
===================================================================
--- cpukit/rtems/src/ratemonperiod.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,403 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   rtems_rate_monotonic_period_states().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *  Copyright (c) 2016 embedded brains GmbH & Co. KG
- *  COPYRIGHT (c) 2016 Kuan-Hsun Chen.
- *
- * 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/ratemonimpl.h>
-#include <rtems/score/schedulerimpl.h>
-#include <rtems/score/todimpl.h>
-
-void _Rate_monotonic_Get_status(
-  const Rate_monotonic_Control *the_period,
-  Timestamp_Control            *wall_since_last_period,
-  Timestamp_Control            *cpu_since_last_period
-)
-{
-  Timestamp_Control        uptime;
-  Thread_Control          *owning_thread = the_period->owner;
-  Timestamp_Control        used;
-
-  /*
-   *  Determine elapsed wall time since period initiated.
-   */
-  _TOD_Get_uptime( &uptime );
-  _Timestamp_Subtract(
-    &the_period->time_period_initiated, &uptime, wall_since_last_period
-  );
-
-  /*
-   *  Determine cpu usage since period initiated.
-   */
-  used = _Thread_Get_CPU_time_used( owning_thread );
-
-   /* used = current cpu usage - cpu usage at start of period */
-  _Timestamp_Subtract(
-    &the_period->cpu_usage_period_initiated,
-    &used,
-    cpu_since_last_period
-  );
-}
-
-static void _Rate_monotonic_Release_postponed_job(
-  Rate_monotonic_Control *the_period,
-  Thread_Control         *owner,
-  rtems_interval          next_length,
-  ISR_lock_Context       *lock_context
-)
-{
-  Per_CPU_Control      *cpu_self;
-  Thread_queue_Context  queue_context;
-
-  --the_period->postponed_jobs;
-  _Scheduler_Release_job(
-    owner,
-    &the_period->Priority,
-    the_period->latest_deadline,
-    &queue_context
-  );
-
-  cpu_self = _Thread_Dispatch_disable_critical( lock_context );
-  _Rate_monotonic_Release( the_period, lock_context );
-  _Thread_Priority_update( &queue_context );
-  _Thread_Dispatch_direct( cpu_self );
-}
-
-static void _Rate_monotonic_Release_job(
-  Rate_monotonic_Control *the_period,
-  Thread_Control         *owner,
-  rtems_interval          next_length,
-  ISR_lock_Context       *lock_context
-)
-{
-  Per_CPU_Control      *cpu_self;
-  Thread_queue_Context  queue_context;
-  uint64_t              deadline;
-
-  cpu_self = _Thread_Dispatch_disable_critical( lock_context );
-
-  deadline = _Watchdog_Per_CPU_insert_ticks(
-    &the_period->Timer,
-    cpu_self,
-    next_length
-  );
-  _Scheduler_Release_job(
-    owner,
-    &the_period->Priority,
-    deadline,
-    &queue_context
-  );
-
-  _Rate_monotonic_Release( the_period, lock_context );
-  _Thread_Priority_update( &queue_context );
-  _Thread_Dispatch_enable( cpu_self );
-}
-
-void _Rate_monotonic_Restart(
-  Rate_monotonic_Control *the_period,
-  Thread_Control         *owner,
-  ISR_lock_Context       *lock_context
-)
-{
-  /*
-   *  Set the starting point and the CPU time used for the statistics.
-   */
-  _TOD_Get_uptime( &the_period->time_period_initiated );
-  the_period->cpu_usage_period_initiated = _Thread_Get_CPU_time_used( owner );
-
-  _Rate_monotonic_Release_job(
-    the_period,
-    owner,
-    the_period->next_length,
-    lock_context
-  );
-}
-
-static void _Rate_monotonic_Update_statistics(
-  Rate_monotonic_Control    *the_period
-)
-{
-  Timestamp_Control          executed;
-  Timestamp_Control          since_last_period;
-  Rate_monotonic_Statistics *stats;
-
-  /*
-   *  Assume we are only called in states where it is appropriate
-   *  to update the statistics.  This should only be RATE_MONOTONIC_ACTIVE
-   *  and RATE_MONOTONIC_EXPIRED.
-   */
-
-  /*
-   *  Update the counts.
-   */
-  stats = &the_period->Statistics;
-  stats->count++;
-
-  if ( the_period->state == RATE_MONOTONIC_EXPIRED )
-    stats->missed_count++;
-
-  /*
-   *  Grab status for time statistics.
-   */
-  _Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
-
-  /*
-   *  Update CPU time
-   */
-  _Timestamp_Add_to( &stats->total_cpu_time, &executed );
-
-  if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) )
-    stats->min_cpu_time = executed;
-
-  if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
-    stats->max_cpu_time = executed;
-
-  /*
-   *  Update Wall time
-   */
-  _Timestamp_Add_to( &stats->total_wall_time, &since_last_period );
-
-  if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
-    stats->min_wall_time = since_last_period;
-
-  if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
-    stats->max_wall_time = since_last_period;
-}
-
-static rtems_status_code _Rate_monotonic_Get_status_for_state(
-  rtems_rate_monotonic_period_states state
-)
-{
-  switch ( state ) {
-    case RATE_MONOTONIC_INACTIVE:
-      return RTEMS_NOT_DEFINED;
-    case RATE_MONOTONIC_EXPIRED:
-      return RTEMS_TIMEOUT;
-    default:
-      _Assert( state == RATE_MONOTONIC_ACTIVE );
-      return RTEMS_SUCCESSFUL;
-  }
-}
-
-static rtems_status_code _Rate_monotonic_Activate(
-  Rate_monotonic_Control *the_period,
-  rtems_interval          length,
-  Thread_Control         *executing,
-  ISR_lock_Context       *lock_context
-)
-{
-  _Assert( the_period->postponed_jobs == 0 );
-  the_period->state = RATE_MONOTONIC_ACTIVE;
-  the_period->next_length = length;
-  _Rate_monotonic_Restart( the_period, executing, lock_context );
-  return RTEMS_SUCCESSFUL;
-}
-
-static rtems_status_code _Rate_monotonic_Block_while_active(
-  Rate_monotonic_Control *the_period,
-  rtems_interval          length,
-  Thread_Control         *executing,
-  ISR_lock_Context       *lock_context
-)
-{
-  Per_CPU_Control *cpu_self;
-  bool             success;
-
-  /*
-   *  Update statistics from the concluding period.
-   */
-  _Rate_monotonic_Update_statistics( the_period );
-
-  /*
-   *  This tells the _Rate_monotonic_Timeout that this task is
-   *  in the process of blocking on the period and that we
-   *  may be changing the length of the next period.
-   */
-  the_period->next_length = length;
-  executing->Wait.return_argument = the_period;
-  _Thread_Wait_flags_set( executing, RATE_MONOTONIC_INTEND_TO_BLOCK );
-
-  cpu_self = _Thread_Dispatch_disable_critical( lock_context );
-  _Rate_monotonic_Release( the_period, lock_context );
-
-  _Thread_Set_state( executing, STATES_WAITING_FOR_PERIOD );
-
-  success = _Thread_Wait_flags_try_change_acquire(
-    executing,
-    RATE_MONOTONIC_INTEND_TO_BLOCK,
-    RATE_MONOTONIC_BLOCKED
-  );
-  if ( !success ) {
-    _Assert(
-      _Thread_Wait_flags_get( executing ) == THREAD_WAIT_STATE_READY
-    );
-    _Thread_Unblock( executing );
-  }
-
-  _Thread_Dispatch_direct( cpu_self );
-  return RTEMS_SUCCESSFUL;
-}
-
-/*
- * There are two possible cases: one is that the previous deadline is missed,
- * The other is that the number of postponed jobs is not 0, but the current
- * deadline is still not expired, i.e., state = RATE_MONOTONIC_ACTIVE.
- */
-static rtems_status_code _Rate_monotonic_Block_while_expired(
-  Rate_monotonic_Control *the_period,
-  rtems_interval          length,
-  Thread_Control         *executing,
-  ISR_lock_Context       *lock_context
-)
-{
-  /*
-   * No matter the just finished jobs in time or not,
-   * they are actually missing their deadlines already.
-   */
-  the_period->state = RATE_MONOTONIC_EXPIRED;
-
-  /*
-   * Update statistics from the concluding period
-   */
-  _Rate_monotonic_Update_statistics( the_period );
-
-  the_period->state = RATE_MONOTONIC_ACTIVE;
-  the_period->next_length = length;
-
-  _Rate_monotonic_Release_postponed_job(
-      the_period,
-      executing,
-      length,
-      lock_context
-  );
-  return RTEMS_TIMEOUT;
-}
-
-rtems_status_code rtems_rate_monotonic_period(
-  rtems_id       id,
-  rtems_interval length
-)
-{
-  Rate_monotonic_Control            *the_period;
-  ISR_lock_Context                   lock_context;
-  Thread_Control                    *executing;
-  rtems_status_code                  status;
-  rtems_rate_monotonic_period_states state;
-
-  the_period = _Rate_monotonic_Get( id, &lock_context );
-  if ( the_period == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  executing = _Thread_Executing;
-  if ( executing != the_period->owner ) {
-    _ISR_lock_ISR_enable( &lock_context );
-    return RTEMS_NOT_OWNER_OF_RESOURCE;
-  }
-
-  _Rate_monotonic_Acquire_critical( the_period, &lock_context );
-
-  state = the_period->state;
-
-  if ( length == RTEMS_PERIOD_STATUS ) {
-    status = _Rate_monotonic_Get_status_for_state( state );
-    _Rate_monotonic_Release( the_period, &lock_context );
-  } else {
-    switch ( state ) {
-      case RATE_MONOTONIC_ACTIVE:
-
-        if( the_period->postponed_jobs > 0 ){
-          /*
-           * If the number of postponed jobs is not 0, it means the
-           * previous postponed instance is finished without exceeding
-           * the current period deadline.
-           *
-           * Do nothing on the watchdog deadline assignment but release the
-           * next remaining postponed job.
-           */
-          status = _Rate_monotonic_Block_while_expired(
-            the_period,
-            length,
-            executing,
-            &lock_context
-          );
-        }else{
-          /*
-           * Normal case that no postponed jobs and no expiration, so wait for
-           * the period and update the deadline of watchdog accordingly.
-           */
-          status = _Rate_monotonic_Block_while_active(
-            the_period,
-            length,
-            executing,
-            &lock_context
-          );
-        }
-        break;
-      case RATE_MONOTONIC_INACTIVE:
-        status = _Rate_monotonic_Activate(
-          the_period,
-          length,
-          executing,
-          &lock_context
-        );
-        break;
-      default:
-        /*
-         * As now this period was already TIMEOUT, there must be at least one
-         * postponed job recorded by the watchdog. The one which exceeded
-         * the previous deadlines was just finished.
-         *
-         * Maybe there is more than one job postponed due to the preemption or
-         * the previous finished job.
-         */
-        _Assert( state == RATE_MONOTONIC_EXPIRED );
-        status = _Rate_monotonic_Block_while_expired(
-          the_period,
-          length,
-          executing,
-          &lock_context
-        );
-        break;
-    }
-  }
-
-  return status;
-}
Index: cpukit/rtems/src/ratemonreportstatistics.c
===================================================================
--- cpukit/rtems/src/ratemonreportstatistics.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,183 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   rtems_rate_monotonic_report_statistics_with_plugin().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  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.
- *
- * 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/ratemonimpl.h>
-#include <rtems/rtems/object.h>
-#include <rtems/printer.h>
-
-#include <inttypes.h>
-#include <rtems/inttypes.h>
-
-/* We print to 1/10's of milliseconds */
-#define NANOSECONDS_DIVIDER 1000L
-#define PERCENT_FMT     "%04" PRId32
-#define NANOSECONDS_FMT "%06ld"
-
-void rtems_rate_monotonic_report_statistics_with_plugin(
-  const rtems_printer *printer
-)
-{
-  rtems_status_code                      status;
-  rtems_id                               maximum_id;
-  rtems_id                               id;
-  rtems_rate_monotonic_period_statistics the_stats;
-  rtems_rate_monotonic_period_status     the_status;
-  char                                   name[5];
-
-  rtems_printf( printer, "Period information by period\n" );
-  rtems_printf( printer, "--- CPU times are in seconds ---\n" );
-  rtems_printf( printer, "--- Wall times are in seconds ---\n" );
-/*
-Layout by columns -- in memory of Hollerith :)
-
-1234567890123456789012345678901234567890123456789012345678901234567890123456789\
-   ID     OWNER COUNT MISSED X
-ididididid NNNN ccccc mmmmmm X
-
-  Uncomment the following if you are tinkering with the formatting.
-  Be sure to test the various cases.
-  (*print)( context,"\
-1234567890123456789012345678901234567890123456789012345678901234567890123456789\
-\n");
-*/
-  rtems_printf( printer,
-      "   ID     OWNER COUNT MISSED     "
-      "     CPU TIME                  WALL TIME\n"
-      "                               "
-      "     MIN/MAX/AVG                MIN/MAX/AVG\n"
-  );
-
-  /*
-   * Cycle through all possible ids and try to report on each one.  If it
-   * is a period that is inactive, we just get an error back.  No big deal.
-   */
-  maximum_id = _Rate_monotonic_Information.maximum_id;
-  for (
-    id = _Objects_Get_minimum_id( maximum_id ) ;
-    id <= maximum_id ;
-    ++id
-  ) {
-    status = rtems_rate_monotonic_get_statistics( id, &the_stats );
-    if ( status != RTEMS_SUCCESSFUL )
-      continue;
-
-    /* If the above passed, so should this but check it anyway */
-    #if defined(RTEMS_DEBUG)
-      status = rtems_rate_monotonic_get_status( id, &the_status );
-      if ( status != RTEMS_SUCCESSFUL )
-        continue;
-    #else
-      (void) rtems_rate_monotonic_get_status( id, &the_status );
-    #endif
-
-    rtems_object_get_name( the_status.owner, sizeof(name), name );
-
-    /*
-     *  Print part of report line that is not dependent on granularity
-     */
-    rtems_printf( printer,
-      "0x%08" PRIx32 " %4s %5" PRId32 " %6" PRId32 " ",
-      id, name,
-      the_stats.count, the_stats.missed_count
-    );
-
-    /*
-     *  If the count is zero, don't print statistics
-     */
-    if (the_stats.count == 0) {
-      rtems_printf( printer, "\n" );
-      continue;
-    }
-
-    /*
-     *  print CPU Usage part of statistics
-     */
-    {
-      struct timespec  cpu_average;
-      struct timespec *min_cpu = &the_stats.min_cpu_time;
-      struct timespec *max_cpu = &the_stats.max_cpu_time;
-      struct timespec *total_cpu = &the_stats.total_cpu_time;
-
-      _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
-      rtems_printf( printer,
-        "%" PRIdtime_t "."  NANOSECONDS_FMT "/"        /* min cpu time */
-        "%" PRIdtime_t "."  NANOSECONDS_FMT "/"        /* max cpu time */
-        "%" PRIdtime_t "."  NANOSECONDS_FMT " ",       /* avg cpu time */
-        _Timespec_Get_seconds( min_cpu ),
-	  _Timespec_Get_nanoseconds( min_cpu ) / NANOSECONDS_DIVIDER,
-        _Timespec_Get_seconds( max_cpu ),
-	  _Timespec_Get_nanoseconds( max_cpu ) / NANOSECONDS_DIVIDER,
-        _Timespec_Get_seconds( &cpu_average ),
-	  _Timespec_Get_nanoseconds( &cpu_average ) / NANOSECONDS_DIVIDER
-       );
-    }
-
-    /*
-     *  print wall time part of statistics
-     */
-    {
-      struct timespec  wall_average;
-      struct timespec *min_wall = &the_stats.min_wall_time;
-      struct timespec *max_wall = &the_stats.max_wall_time;
-      struct timespec *total_wall = &the_stats.total_wall_time;
-
-      _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
-      rtems_printf( printer,
-        "%" PRIdtime_t "." NANOSECONDS_FMT "/"        /* min wall time */
-        "%" PRIdtime_t "." NANOSECONDS_FMT "/"        /* max wall time */
-        "%" PRIdtime_t "." NANOSECONDS_FMT "\n",      /* avg wall time */
-        _Timespec_Get_seconds( min_wall ),
-          _Timespec_Get_nanoseconds( min_wall ) / NANOSECONDS_DIVIDER,
-        _Timespec_Get_seconds( max_wall ),
-          _Timespec_Get_nanoseconds( max_wall ) / NANOSECONDS_DIVIDER,
-        _Timespec_Get_seconds( &wall_average ),
-          _Timespec_Get_nanoseconds( &wall_average ) / NANOSECONDS_DIVIDER
-      );
-    }
-  }
-}
-
-void rtems_rate_monotonic_report_statistics( void )
-{
-  rtems_printer printer;
-  rtems_print_printer_printk( &printer );
-  rtems_rate_monotonic_report_statistics_with_plugin( &printer );
-}
Index: cpukit/rtems/src/ratemonresetall.c
===================================================================
--- cpukit/rtems/src/ratemonresetall.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   rtems_rate_monotonic_reset_all_statistics().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  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.
- *
- * 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/ratemonimpl.h>
-
-/*
- *  rtems_rate_monotonic_reset_all_statistics
- */
-void rtems_rate_monotonic_reset_all_statistics( void )
-{
-  rtems_id maximum_id;
-  rtems_id id;
-
-   /*
-    * Prevent allocation or deallocation of any of the periods while we are
-    * cycling.
-    */
-  _Objects_Allocator_lock();
-
-    /*
-     * Cycle through all possible ids and try to reset each one.  If it
-     * is a period that is inactive, we just get an error back.  No big deal.
-     */
-    maximum_id = _Rate_monotonic_Information.maximum_id;
-    for (
-      id = _Objects_Get_minimum_id( maximum_id ) ;
-      id <= maximum_id ;
-      ++id
-    ) {
-      (void) rtems_rate_monotonic_reset_statistics( id );
-    }
-
-  _Objects_Allocator_unlock();
-}
Index: cpukit/rtems/src/ratemonresetstatistics.c
===================================================================
--- cpukit/rtems/src/ratemonresetstatistics.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   rtems_rate_monotonic_reset_statistics().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/ratemonimpl.h>
-
-rtems_status_code rtems_rate_monotonic_reset_statistics(
-  rtems_id id
-)
-{
-  Rate_monotonic_Control *the_period;
-  ISR_lock_Context        lock_context;
-
-  the_period = _Rate_monotonic_Get( id, &lock_context );
-  if ( the_period == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  _Rate_monotonic_Acquire_critical( the_period, &lock_context );
-  _Rate_monotonic_Reset_statistics( the_period );
-  _Rate_monotonic_Release( the_period, &lock_context );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/ratemontimeout.c
===================================================================
--- cpukit/rtems/src/ratemontimeout.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,114 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRateMonotonic
- *
- * @brief This source file contains the implementation of
- *   _Rate_monotonic_Timeout().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2009.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  COPYRIGHT (c) 2016-2017 Kuan-Hsun Chen.
- *
- * 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/ratemonimpl.h>
-
-static void _Rate_monotonic_Renew_deadline(
-  Rate_monotonic_Control *the_period,
-  ISR_lock_Context       *lock_context
-)
-{
-  uint64_t deadline;
-
-  /* stay at 0xffffffff if postponed_jobs is going to overflow */
-  if ( the_period->postponed_jobs != UINT32_MAX ) {
-    ++the_period->postponed_jobs;
-  }
-
-  the_period->state = RATE_MONOTONIC_EXPIRED;
-
-  deadline = _Watchdog_Per_CPU_insert_ticks(
-    &the_period->Timer,
-    _Per_CPU_Get(),
-    the_period->next_length
-  );
-  the_period->latest_deadline = deadline;
-
-  _Rate_monotonic_Release( the_period, lock_context );
-}
-
-void _Rate_monotonic_Timeout( Watchdog_Control *the_watchdog )
-{
-  Rate_monotonic_Control *the_period;
-  Thread_Control         *owner;
-  ISR_lock_Context        lock_context;
-  Thread_Wait_flags       wait_flags;
-
-  the_period = RTEMS_CONTAINER_OF( the_watchdog, Rate_monotonic_Control, Timer );
-  owner = the_period->owner;
-
-  _ISR_lock_ISR_disable( &lock_context );
-  _Rate_monotonic_Acquire_critical( the_period, &lock_context );
-  wait_flags = _Thread_Wait_flags_get( owner );
-
-  if (
-    ( wait_flags & THREAD_WAIT_CLASS_PERIOD ) != 0
-      && owner->Wait.return_argument == the_period
-  ) {
-    bool unblock;
-    bool success;
-
-    owner->Wait.return_argument = NULL;
-
-    success = _Thread_Wait_flags_try_change_release(
-      owner,
-      RATE_MONOTONIC_INTEND_TO_BLOCK,
-      THREAD_WAIT_STATE_READY
-    );
-    if ( success ) {
-      unblock = false;
-    } else {
-      _Assert( _Thread_Wait_flags_get( owner ) == RATE_MONOTONIC_BLOCKED );
-      _Thread_Wait_flags_set( owner, THREAD_WAIT_STATE_READY );
-      unblock = true;
-    }
-
-    _Rate_monotonic_Restart( the_period, owner, &lock_context );
-
-    if ( unblock ) {
-      _Thread_Unblock( owner );
-    }
-  } else {
-    _Rate_monotonic_Renew_deadline( the_period, &lock_context );
-  }
-}
Index: cpukit/rtems/src/region.c
===================================================================
--- cpukit/rtems/src/region.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/region.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,48 +1,456 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains a definition of the ::_Region_Information
- *   with zero objects.
- */
-
 /*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * 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/regiondata.h>
-
-OBJECTS_INFORMATION_DEFINE_ZERO(
-  _Region,
-  OBJECTS_CLASSIC_API,
-  OBJECTS_RTEMS_REGIONS,
-  OBJECTS_NO_STRING_NAME
-);
+ *  Region Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/config.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/region.h>
+#include <rtems/states.h>
+#include <rtems/thread.h>
+
+/*PAGE
+ *
+ *  _Region_Manager_initialization
+ *
+ *  This routine initializes all region manager related data structures.
+ *
+ *  Input parameters:
+ *    maximum_regions - number of regions to initialize
+ *
+ *  Output parameters:  NONE
+ */
+
+void _Region_Manager_initialization(
+  unsigned32 maximum_regions
+)
+{
+  _Objects_Initialize_information(
+     &_Region_Information,
+     FALSE,
+     maximum_regions,
+     sizeof( Region_Control )
+   );
+}
+
+/*PAGE
+ *
+ *  rtems_region_create
+ *
+ *  This directive creates a region of physical contiguous memory area
+ *  from which variable sized segments can be allocated.
+ *
+ *  Input parameters:
+ *    name             - user defined region name
+ *    starting_address - physical start address of region
+ *    length           - physical length in bytes
+ *    page_size        - page size in bytes
+ *    attribute_set    - region attributes
+ *    id               - address of region id to set
+ *
+ *  Output parameters:
+ *    id       - region id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_region_create(
+  Objects_Name        name,
+  void               *starting_address,
+  unsigned32          length,
+  unsigned32          page_size,
+  rtems_attribute  attribute_set,
+  Objects_Id         *id
+)
+{
+  Region_Control *the_region;
+
+  if ( !_Objects_Is_name_valid( name ) )
+    return ( RTEMS_INVALID_NAME );
+
+  if ( !_Addresses_Is_aligned( starting_address ) )
+    return( RTEMS_INVALID_ADDRESS );
+
+  _Thread_Disable_dispatch();             /* to prevent deletion */
+
+  the_region = _Region_Allocate();
+
+  if ( !the_region ) {
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  the_region->maximum_segment_size =
+    _Heap_Initialize(&the_region->Memory, starting_address, length, page_size);
+
+  if ( !the_region->maximum_segment_size ) {
+    _Region_Free( the_region );
+    _Thread_Enable_dispatch();
+    return( RTEMS_INVALID_SIZE );
+  }
+
+  the_region->starting_address      = starting_address;
+  the_region->length                = length;
+  the_region->page_size             = page_size;
+  the_region->attribute_set         = attribute_set;
+  the_region->number_of_used_blocks = 0;
+
+  _Thread_queue_Initialize(
+     &the_region->Wait_queue, attribute_set, STATES_WAITING_FOR_SEGMENT );
+
+  _Objects_Open( &_Region_Information, &the_region->Object, name );
+
+  *id = the_region->Object.id;
+  _Thread_Enable_dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_region_ident
+ *
+ *  This directive returns the system ID associated with
+ *  the region name.
+ *
+ *  Input parameters:
+ *    name - user defined region name
+ *    id   - pointer to region id
+ *
+ *  Output parameters:
+ *    *id      - region id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_region_ident(
+  Objects_Name  name,
+  Objects_Id   *id
+)
+{
+  return _Objects_Name_to_id(
+      &_Region_Information,
+      name,
+      RTEMS_SEARCH_LOCAL_NODE,
+      id
+    );
+}
+
+/*PAGE
+ *
+ *  rtems_region_delete
+ *
+ *  This directive allows a thread to delete a region specified by
+ *  the region identifier, provided that none of its segments are
+ *  still allocated.
+ *
+ *  Input parameters:
+ *    id - region id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_region_delete(
+  Objects_Id id
+)
+{
+  register Region_Control *the_region;
+  Objects_Locations               location;
+
+  the_region = _Region_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:        /* this error cannot be returned */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      _Region_Debug_Walk( the_region, 5 );
+      if ( the_region->number_of_used_blocks == 0 ) {
+        _Objects_Close( &_Region_Information, &the_region->Object );
+        _Region_Free( the_region );
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_RESOURCE_IN_USE );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_region_extend
+ *
+ *  This directive attempts to grow a region of physical contiguous memory area
+ *  from which variable sized segments can be allocated.
+ *
+ *  Input parameters:
+ *    id         - id of region to grow
+ *    start      - starting address of memory area for extension
+ *    length     - physical length in bytes to grow the region
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code       - if unsuccessful
+ */
+
+rtems_status_code rtems_region_extend(
+  Objects_Id          id,
+  void               *starting_address,
+  unsigned32          length
+)
+{
+  Region_Control     *the_region;
+  Objects_Locations   location;
+  unsigned32          amount_extended;
+  Heap_Extend_status  heap_status;
+  rtems_status_code   status;
+
+  status = RTEMS_SUCCESSFUL;
+
+  the_region = _Region_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:        /* this error cannot be returned */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+
+      heap_status = _Heap_Extend(
+        &the_region->Memory,
+        starting_address,
+        length,
+        &amount_extended
+      );
+
+      switch ( heap_status ) {
+        case HEAP_EXTEND_SUCCESSFUL:
+          the_region->length                += amount_extended;
+          the_region->maximum_segment_size  += amount_extended;
+          break;
+        case HEAP_EXTEND_ERROR:
+          status = RTEMS_INVALID_ADDRESS;
+          break;
+        case HEAP_EXTEND_NOT_IMPLEMENTED:
+          status = RTEMS_NOT_IMPLEMENTED;
+          break;
+      }
+      _Thread_Enable_dispatch();
+      return( status );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );
+}
+
+/*PAGE
+ *
+ *  rtems_region_get_segment
+ *
+ *  This directive will obtain a segment from the given region.
+ *
+ *  Input parameters:
+ *    id         - region id
+ *    size       - segment size in bytes
+ *    option_set - wait option
+ *    timeout    - number of ticks to wait (0 means wait forever)
+ *    segment    - pointer to segment address
+ *
+ *  Output parameters:
+ *    segment    - pointer to segment address filled in
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_region_get_segment(
+  Objects_Id         id,
+  unsigned32         size,
+  rtems_option    option_set,
+  rtems_interval  timeout,
+  void              **segment
+)
+{
+  register Region_Control *the_region;
+  Objects_Locations        location;
+  Thread_Control          *executing;
+  void                    *the_segment;
+
+  if ( size == 0 )
+    return( RTEMS_INVALID_SIZE );
+
+  executing  = _Thread_Executing;
+  the_region = _Region_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:        /* this error cannot be returned */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      if ( size > the_region->maximum_segment_size ) {
+        _Thread_Enable_dispatch();
+        return( RTEMS_INVALID_SIZE );
+      }
+
+      _Region_Debug_Walk( the_region, 1 );
+
+      the_segment = _Region_Allocate_segment( the_region, size );
+
+      _Region_Debug_Walk( the_region, 2 );
+
+      if ( the_segment ) {
+        the_region->number_of_used_blocks += 1;
+        _Thread_Enable_dispatch();
+        *segment = the_segment;
+        return( RTEMS_SUCCESSFUL );
+      }
+
+      if ( _Options_Is_no_wait( option_set ) ) {
+        _Thread_Enable_dispatch();
+        return( RTEMS_UNSATISFIED );
+      }
+
+      executing->Wait.queue              = &the_region->Wait_queue;
+      executing->Wait.id                 = id;
+      executing->Wait.Extra.segment_size = size;
+      executing->Wait.return_argument    = (unsigned32 *) segment;
+
+      the_region->Wait_queue.sync = TRUE;
+
+      _Thread_queue_Enqueue( &the_region->Wait_queue, timeout );
+
+      _Thread_Enable_dispatch();
+      return( executing->Wait.return_code );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+/*PAGE
+ *
+ *  rtems_region_get_segment_size
+ *
+ *  This directive will return the size of the segment indicated
+ *
+ *  Input parameters:
+ *    id         - region id
+ *    segment    - segment address
+ *    size       - pointer to segment size in bytes
+ *
+ *  Output parameters:
+ *    size       - segment size in bytes filled in
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_region_get_segment_size(
+  Objects_Id         id,
+  void              *segment,
+  unsigned32        *size
+)
+{
+  register Region_Control *the_region;
+  Objects_Locations        location;
+  Thread_Control          *executing;
+
+  executing  = _Thread_Executing;
+  the_region = _Region_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:        /* this error cannot be returned */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+
+      if ( _Heap_Size_of_user_area( &the_region->Memory, segment, size ) ) {
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_INVALID_ADDRESS );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_region_return_segment
+ *
+ *  This directive will return a segment to its region.
+ *
+ *  Input parameters:
+ *    id      - region id
+ *    segment - pointer to segment address
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_region_return_segment(
+  Objects_Id  id,
+  void       *segment
+)
+{
+  register Region_Control *the_region;
+  Thread_Control          *the_thread;
+  Objects_Locations        location;
+  void                   **the_segment;
+  int                      status;
+
+  the_region = _Region_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:        /* this error cannot be returned */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+
+      _Region_Debug_Walk( the_region, 3 );
+
+      status = _Region_Free_segment( the_region, segment );
+
+      _Region_Debug_Walk( the_region, 4 );
+
+      if ( !status ) {
+        _Thread_Enable_dispatch();
+        return( RTEMS_INVALID_ADDRESS );
+      }
+
+      the_region->number_of_used_blocks -= 1;
+      for ( ; ; ) {
+        the_thread = _Thread_queue_First( &the_region->Wait_queue );
+
+        if ( the_thread == NULL )
+           break;
+
+        the_segment = _Region_Allocate_segment(
+                        the_region, the_thread->Wait.Extra.segment_size );
+
+        if ( the_segment == NULL )
+           break;
+
+        *(void **)the_thread->Wait.return_argument = the_segment;
+        the_region->number_of_used_blocks += 1;
+        _Thread_queue_Extract( &the_region->Wait_queue, the_thread );
+        the_thread->Wait.return_code = RTEMS_SUCCESSFUL;
+      }
+
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
Index: cpukit/rtems/src/regioncreate.c
===================================================================
--- cpukit/rtems/src/regioncreate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,121 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   rtems_region_create() and the Region Manager system initialization.
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  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.
- *
- * 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/regionimpl.h>
-#include <rtems/rtems/attrimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/apimutex.h>
-#include <rtems/score/threadqimpl.h>
-#include <rtems/sysinit.h>
-
-rtems_status_code rtems_region_create(
-  rtems_name          name,
-  void               *starting_address,
-  uintptr_t           length,
-  uintptr_t           page_size,
-  rtems_attribute     attribute_set,
-  rtems_id           *id
-)
-{
-  rtems_status_code  return_status;
-  Region_Control    *the_region;
-
-  if ( !rtems_is_name_valid( name ) ) {
-    return RTEMS_INVALID_NAME;
-  }
-
-  if ( id == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( starting_address == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_region = _Region_Allocate();
-
-    if ( !the_region )
-      return_status = RTEMS_TOO_MANY;
-
-    else {
-      _Thread_queue_Object_initialize( &the_region->Wait_queue );
-
-      if ( _Attributes_Is_priority( attribute_set ) ) {
-        the_region->wait_operations = &_Thread_queue_Operations_priority;
-      } else {
-        the_region->wait_operations = &_Thread_queue_Operations_FIFO;
-      }
-
-      the_region->maximum_segment_size = _Heap_Initialize(
-        &the_region->Memory, starting_address, length, page_size
-      );
-
-      if ( !the_region->maximum_segment_size ) {
-        _Region_Free( the_region );
-        return_status = RTEMS_INVALID_SIZE;
-      } else {
-        the_region->attribute_set = attribute_set;
-
-        *id = _Objects_Open_u32(
-          &_Region_Information,
-          &the_region->Object,
-          name
-        );
-
-        return_status = RTEMS_SUCCESSFUL;
-      }
-    }
-
-  _Objects_Allocator_unlock();
-
-  return return_status;
-}
-
-static void _Region_Manager_initialization( void )
-{
-  _Objects_Initialize_information( &_Region_Information );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Region_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_REGION,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/rtems/src/regiondelete.c
===================================================================
--- cpukit/rtems/src/regiondelete.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   rtems_region_delete().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/regionimpl.h>
-
-rtems_status_code rtems_region_delete(
-  rtems_id id
-)
-{
-  rtems_status_code  status;
-  Region_Control    *the_region;
-
-  _Objects_Allocator_lock();
-
-  the_region = _Region_Get_and_lock( id );
-
-  if ( the_region == NULL ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_INVALID_ID;
-  }
-
-  _Heap_Protection_free_all_delayed_blocks( &the_region->Memory );
-
-  if ( the_region->Memory.stats.used_blocks != 0 ) {
-    status = RTEMS_RESOURCE_IN_USE;
-  } else {
-    _Objects_Close( &_Region_Information, &the_region->Object );
-    _Region_Free( the_region );
-    status = RTEMS_SUCCESSFUL;
-  }
-
-  _Region_Unlock( the_region );
-  _Objects_Allocator_unlock();
-  return status;
-}
Index: cpukit/rtems/src/regionextend.c
===================================================================
--- cpukit/rtems/src/regionextend.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,80 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   rtems_region_extend().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2009.
- *  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.
- *
- * 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/regionimpl.h>
-
-rtems_status_code rtems_region_extend(
-  rtems_id   id,
-  void      *starting_address,
-  uintptr_t  length
-)
-{
-  rtems_status_code  status;
-  Region_Control    *the_region;
-  uintptr_t          amount_extended;
-
-  if ( starting_address == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_region = _Region_Get_and_lock( id );
-
-  if ( the_region == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  amount_extended = _Heap_Extend(
-    &the_region->Memory,
-    starting_address,
-    length,
-    0
-  );
-
-  if ( amount_extended > 0 ) {
-    the_region->maximum_segment_size += amount_extended;
-    status = RTEMS_SUCCESSFUL;
-  } else {
-    status = RTEMS_INVALID_ADDRESS;
-  }
-
-  _Region_Unlock( the_region );
-  return status;
-}
Index: cpukit/rtems/src/regiongetfreeinfo.c
===================================================================
--- cpukit/rtems/src/regiongetfreeinfo.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   rtems_region_get_free_information().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/regionimpl.h>
-
-#include <string.h>
-
-rtems_status_code rtems_region_get_free_information(
-  rtems_id                id,
-  Heap_Information_block *the_info
-)
-{
-  Region_Control *the_region;
-
-  if ( the_info == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_region = _Region_Get_and_lock( id );
-
-  if ( the_region == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  memset( &the_info->Used, 0, sizeof( the_info->Used ) );
-  _Heap_Get_free_information( &the_region->Memory, &the_info->Free );
-
-  _Region_Unlock( the_region );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/regiongetinfo.c
===================================================================
--- cpukit/rtems/src/regiongetinfo.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   rtems_region_get_information().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/regionimpl.h>
-
-rtems_status_code rtems_region_get_information(
-  rtems_id                id,
-  Heap_Information_block *the_info
-)
-{
-  Region_Control *the_region;
-
-  if ( the_info == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_region = _Region_Get_and_lock( id );
-
-  if ( the_region == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  _Heap_Get_information( &the_region->Memory, the_info );
-
-  _Region_Unlock( the_region );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/regiongetsegment.c
===================================================================
--- cpukit/rtems/src/regiongetsegment.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,140 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   rtems_region_get_segment().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/regionimpl.h>
-#include <rtems/rtems/optionsimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/threadqimpl.h>
-#include <rtems/score/statesimpl.h>
-
-static void _Region_Enqueue_callout(
-  Thread_queue_Queue   *queue,
-  Thread_Control       *the_thread,
-  Per_CPU_Control      *cpu_self,
-  Thread_queue_Context *queue_context
-)
-{
-  Region_Control *the_region;
-
-  _Thread_queue_Add_timeout_ticks(
-    queue,
-    the_thread,
-    cpu_self,
-    queue_context
-  );
-
-  the_region = REGION_OF_THREAD_QUEUE_QUEUE( queue );
-  _Region_Unlock( the_region );
-}
-
-rtems_status_code rtems_region_get_segment(
-  rtems_id           id,
-  uintptr_t          size,
-  rtems_option       option_set,
-  rtems_interval     timeout,
-  void              **segment
-)
-{
-  rtems_status_code  status;
-  Region_Control    *the_region;
-
-  if ( segment == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  *segment = NULL;
-
-  if ( size == 0 ) {
-    return RTEMS_INVALID_SIZE;
-  }
-
-  the_region = _Region_Get_and_lock( id );
-
-  if ( the_region == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  if ( size > the_region->maximum_segment_size ) {
-    status = RTEMS_INVALID_SIZE;
-  } else {
-    void *the_segment;
-
-    the_segment = _Region_Allocate_segment( the_region, size );
-
-    if ( the_segment != NULL ) {
-      *segment = the_segment;
-      status = RTEMS_SUCCESSFUL;
-    } else if ( _Options_Is_no_wait( option_set ) ) {
-      status = RTEMS_UNSATISFIED;
-    } else {
-      Thread_queue_Context  queue_context;
-      Thread_Control       *executing;
-
-      _Thread_queue_Context_initialize( &queue_context );
-      _Thread_queue_Acquire( &the_region->Wait_queue, &queue_context );
-
-      executing  = _Thread_Executing;
-      executing->Wait.count           = size;
-      executing->Wait.return_argument = segment;
-
-      /* FIXME: This is a home grown condition variable */
-      _Thread_queue_Context_set_thread_state(
-        &queue_context,
-        STATES_WAITING_FOR_SEGMENT
-      );
-      _Thread_queue_Context_set_timeout_ticks( &queue_context, timeout );
-      _Thread_queue_Context_set_enqueue_callout(
-        &queue_context,
-        _Region_Enqueue_callout
-      );
-      _Thread_queue_Enqueue(
-        &the_region->Wait_queue.Queue,
-        the_region->wait_operations,
-        executing,
-        &queue_context
-      );
-      return _Status_Get_after_wait( executing );
-    }
-  }
-
-  _Region_Unlock( the_region );
-  return status;
-}
Index: cpukit/rtems/src/regiongetsegmentsize.c
===================================================================
--- cpukit/rtems/src/regiongetsegmentsize.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   rtems_region_get_segment_size().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/regionimpl.h>
-
-rtems_status_code rtems_region_get_segment_size(
-  rtems_id   id,
-  void      *segment,
-  uintptr_t *size
-)
-{
-  rtems_status_code  status;
-  Region_Control    *the_region;
-
-  if ( segment == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( size == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_region = _Region_Get_and_lock( id );
-
-  if ( the_region == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  if ( _Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) {
-    status = RTEMS_SUCCESSFUL;
-  } else {
-    status = RTEMS_INVALID_ADDRESS;
-  }
-
-  _Region_Unlock( the_region );
-  return status;
-}
Index: cpukit/rtems/src/regionident.c
===================================================================
--- cpukit/rtems/src/regionident.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   rtems_region_ident().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- * 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.
- *
- * 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/regionimpl.h>
-#include <rtems/rtems/objectimpl.h>
-
-rtems_status_code rtems_region_ident( rtems_name name, rtems_id *id )
-{
-  return _RTEMS_Name_to_id(
-    name,
-    OBJECTS_SEARCH_LOCAL_NODE,
-    id,
-    &_Region_Information
-  );
-}
Index: cpukit/rtems/src/regionmp.c
===================================================================
--- cpukit/rtems/src/regionmp.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ cpukit/rtems/src/regionmp.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,308 @@
+/*
+ *  Multiprocessing Support for the Region Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/mpci.h>
+#include <rtems/mppkt.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/region.h>
+#include <rtems/thread.h>
+
+/*PAGE
+ *
+ *  _Region_MP_Send_process_packet
+ *
+ */
+
+void _Region_MP_Send_process_packet (
+  Region_MP_Remote_operations  operation,
+  Objects_Id                      region_id,
+  Objects_Name                    name,
+  Objects_Id                      proxy_id
+)
+{
+  Region_MP_Packet *the_packet;
+  unsigned32           node;
+
+  switch ( operation ) {
+
+    case REGION_MP_ANNOUNCE_CREATE:
+    case REGION_MP_ANNOUNCE_DELETE:
+    case REGION_MP_EXTRACT_PROXY:
+
+      the_packet                    = _Region_MP_Get_packet();
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_REGION;
+      the_packet->Prefix.length     = sizeof ( Region_MP_Packet );
+      the_packet->Prefix.to_convert = sizeof ( Region_MP_Packet );
+      the_packet->operation         = operation;
+      the_packet->Prefix.id         = region_id;
+      the_packet->name              = name;
+      the_packet->proxy_id          = proxy_id;
+
+      if ( operation == REGION_MP_EXTRACT_PROXY )
+         node = rtems_get_node( region_id );
+      else
+         node = MPCI_ALL_NODES;
+
+      _MPCI_Send_process_packet( node, &the_packet->Prefix );
+      break;
+
+    case REGION_MP_GET_SEGMENT_REQUEST:
+    case REGION_MP_GET_SEGMENT_RESPONSE:
+    case REGION_MP_RETURN_SEGMENT_REQUEST:
+    case REGION_MP_RETURN_SEGMENT_RESPONSE:
+      break;
+  }
+}
+
+/*PAGE
+ *
+ *  _Region_MP_Send_request_packet
+ *
+ */
+
+rtems_status_code _Region_MP_Send_request_packet (
+  Region_MP_Remote_operations  operation,
+  Objects_Id                   region_id,
+  void                        *segment,
+  unsigned32                   size,
+  rtems_option              option_set,
+  rtems_interval            timeout
+)
+{
+  Region_MP_Packet *the_packet;
+
+  switch ( operation ) {
+
+    case REGION_MP_GET_SEGMENT_REQUEST:
+    case REGION_MP_RETURN_SEGMENT_REQUEST:
+
+      the_packet                    = _Region_MP_Get_packet();
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_REGION;
+      the_packet->Prefix.length     = sizeof ( Region_MP_Packet );
+      the_packet->Prefix.to_convert = sizeof ( Region_MP_Packet );
+      if ( ! _Options_Is_no_wait(option_set))
+          the_packet->Prefix.timeout = timeout;
+
+      the_packet->operation         = operation;
+      the_packet->Prefix.id         = region_id;
+      the_packet->segment           = segment;
+      the_packet->size              = size;
+      the_packet->option_set        = option_set;
+
+      return _MPCI_Send_request_packet(
+          rtems_get_node( region_id ),
+          &the_packet->Prefix,
+          STATES_READY      /* Not used */
+        );
+      break;
+
+    case REGION_MP_ANNOUNCE_CREATE:
+    case REGION_MP_ANNOUNCE_DELETE:
+    case REGION_MP_EXTRACT_PROXY:
+    case REGION_MP_GET_SEGMENT_RESPONSE:
+    case REGION_MP_RETURN_SEGMENT_RESPONSE:
+      break;
+
+  }
+  /*
+   *  The following line is included to satisfy compilers which
+   *  produce warnings when a function does not end with a return.
+   */
+  return RTEMS_INTERNAL_ERROR;
+}
+
+/*PAGE
+ *
+ *  _Region_MP_Send_response_packet
+ *
+ */
+
+void _Region_MP_Send_response_packet (
+  Region_MP_Remote_operations  operation,
+  Objects_Id                   region_id,
+  Thread_Control              *the_thread
+)
+{
+  Region_MP_Packet *the_packet;
+
+  switch ( operation ) {
+
+    case REGION_MP_GET_SEGMENT_RESPONSE:
+    case REGION_MP_RETURN_SEGMENT_RESPONSE:
+
+      the_packet = ( Region_MP_Packet *) the_thread->receive_packet;
+
+/*
+ *  The packet being returned already contains the class, length, and
+ *  to_convert fields, therefore they are not set in this routine.
+ */
+      the_packet->operation = operation;
+      the_packet->Prefix.id = the_packet->Prefix.source_tid;
+
+      _MPCI_Send_response_packet(
+        rtems_get_node( the_packet->Prefix.source_tid ),
+        &the_packet->Prefix
+      );
+      break;
+
+    case REGION_MP_ANNOUNCE_CREATE:
+    case REGION_MP_ANNOUNCE_DELETE:
+    case REGION_MP_EXTRACT_PROXY:
+    case REGION_MP_GET_SEGMENT_REQUEST:
+    case REGION_MP_RETURN_SEGMENT_REQUEST:
+      break;
+
+  }
+}
+
+/*PAGE
+ *
+ *
+ *  _Region_MP_Process_packet
+ *
+ */
+
+void _Region_MP_Process_packet (
+  rtems_packet_prefix  *the_packet_prefix
+)
+{
+  Region_MP_Packet *the_packet;
+  Thread_Control   *the_thread;
+  boolean           ignored;
+
+  the_packet = (Region_MP_Packet *) the_packet_prefix;
+
+  switch ( the_packet->operation ) {
+
+    case REGION_MP_ANNOUNCE_CREATE:
+
+      ignored = _Objects_MP_Open(
+                  &_Region_Information,
+                  the_packet->name,
+                  the_packet->Prefix.id,
+                  TRUE
+                );
+
+      _MPCI_Return_packet( the_packet_prefix );
+      break;
+
+    case REGION_MP_ANNOUNCE_DELETE:
+
+      _Objects_MP_Close( &_Region_Information, the_packet->Prefix.id );
+
+      _MPCI_Return_packet( the_packet_prefix );
+      break;
+
+    case REGION_MP_EXTRACT_PROXY:
+
+      the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
+
+      if ( ! _Thread_Is_null( the_thread ) )
+        _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
+
+      _MPCI_Return_packet( the_packet_prefix );
+      break;
+
+    case REGION_MP_GET_SEGMENT_REQUEST:
+
+      the_packet->Prefix.return_code = rtems_region_get_segment(
+        the_packet->Prefix.id,
+        the_packet->size,
+        the_packet->option_set,
+        the_packet->Prefix.timeout,
+        &the_packet->segment
+      );
+
+      _Region_MP_Send_response_packet(
+        REGION_MP_GET_SEGMENT_RESPONSE,
+        the_packet->Prefix.id,
+        _Thread_Executing
+      );
+      break;
+
+    case REGION_MP_GET_SEGMENT_RESPONSE:
+
+      the_thread = _MPCI_Process_response( the_packet_prefix );
+
+      *(void **)the_thread->Wait.return_argument = the_packet->segment;
+
+      _MPCI_Return_packet( the_packet_prefix );
+      break;
+
+    case REGION_MP_RETURN_SEGMENT_REQUEST:
+
+      the_packet->Prefix.return_code = rtems_region_return_segment(
+        the_packet->Prefix.id,
+        the_packet->segment
+      );
+
+      _Region_MP_Send_response_packet(
+        REGION_MP_RETURN_SEGMENT_RESPONSE,
+        the_packet->Prefix.id,
+        _Thread_Executing
+      );
+      break;
+
+    case REGION_MP_RETURN_SEGMENT_RESPONSE:
+
+      the_thread = _MPCI_Process_response( the_packet_prefix );
+
+      _MPCI_Return_packet( the_packet_prefix );
+      break;
+
+  }
+}
+
+/*PAGE
+ *
+ *  _Region_MP_Send_object_was_deleted
+ *
+ *  This routine is not needed by the Region since a region
+ *  cannot be deleted when segments are in use.
+ *
+ */
+
+/*PAGE
+ *
+ *  _Region_MP_Send_extract_proxy
+ *
+ */
+
+void _Region_MP_Send_extract_proxy (
+  Thread_Control *the_thread
+)
+{
+  _Region_MP_Send_process_packet(
+    REGION_MP_EXTRACT_PROXY,
+    the_thread->Wait.id,
+    (Objects_Name) 0,
+    the_thread->Object.id
+  );
+}
+
+/*PAGE
+ *
+ *  _Region_MP_Get_packet
+ *
+ */
+
+Region_MP_Packet *_Region_MP_Get_packet ( void )
+{
+  return ( (Region_MP_Packet *) _MPCI_Get_packet() );
+}
+
+/* end of file */
Index: cpukit/rtems/src/regionprocessqueue.c
===================================================================
--- cpukit/rtems/src/regionprocessqueue.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   _Region_Process_queue().
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  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.
- *
- * 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/regionimpl.h>
-#include <rtems/score/status.h>
-#include <rtems/score/threadqimpl.h>
-
-void _Region_Process_queue(
-  Region_Control *the_region
-)
-{
-  Per_CPU_Control *cpu_self;
-  Thread_Control  *the_thread;
-  void            *the_segment;
-
-  /*
-   *  Switch from using the memory allocation mutex to using a
-   *  dispatching disabled critical section.  We have to do this
-   *  because this thread may unblock one or more threads that were
-   *  waiting on memory.
-   *
-   *  NOTE: Be sure to disable dispatching before unlocking the mutex
-   *        since we do not want to open a window where a context
-   *        switch could occur.
-   */
-  cpu_self = _Thread_Dispatch_disable();
-  _Region_Unlock( the_region );
-
-  /*
-   *  NOTE: The following loop is O(n) where n is the number of
-   *        threads whose memory request is satisfied.
-   */
-  for ( ; ; ) {
-    the_thread = _Thread_queue_First(
-      &the_region->Wait_queue,
-      the_region->wait_operations
-    );
-
-    if ( the_thread == NULL )
-      break;
-
-    the_segment = (void **) _Region_Allocate_segment(
-      the_region,
-      the_thread->Wait.count
-    );
-
-    if ( the_segment == NULL )
-      break;
-
-    *(void **)the_thread->Wait.return_argument = the_segment;
-    _Thread_queue_Extract( the_thread );
-    the_thread->Wait.return_code = STATUS_SUCCESSFUL;
-  }
-
-  _Thread_Dispatch_enable( cpu_self );
-}
Index: cpukit/rtems/src/regionresizesegment.c
===================================================================
--- cpukit/rtems/src/regionresizesegment.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,93 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   rtems_region_resize_segment().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/regionimpl.h>
-
-rtems_status_code rtems_region_resize_segment(
-  rtems_id    id,
-  void       *segment,
-  uintptr_t   size,
-  uintptr_t  *old_size
-)
-{
-  uintptr_t           avail_size;
-  uintptr_t           osize;
-  rtems_status_code   status;
-  Heap_Resize_status  resize_status;
-  Region_Control     *the_region;
-
-  if ( old_size == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_region = _Region_Get_and_lock( id );
-
-  if ( the_region == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  resize_status = _Heap_Resize_block(
-    &the_region->Memory,
-    segment,
-    (uint32_t) size,
-    &osize,
-    &avail_size
-  );
-  *old_size = (uint32_t) osize;
-
-  switch ( resize_status ) {
-    case HEAP_RESIZE_SUCCESSFUL:
-      /* Unlocks allocator */
-      _Region_Process_queue( the_region );
-      return RTEMS_SUCCESSFUL;
-
-    case HEAP_RESIZE_UNSATISFIED:
-      status = RTEMS_UNSATISFIED;
-      break;
-
-    default:
-      status = RTEMS_INVALID_ADDRESS;
-      break;
-  }
-
-  _Region_Unlock( the_region );
-  return status;
-}
Index: cpukit/rtems/src/regionreturnsegment.c
===================================================================
--- cpukit/rtems/src/regionreturnsegment.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicRegion
- *
- * @brief This source file contains the implementation of
- *   rtems_region_return_segment().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/regionimpl.h>
-
-rtems_status_code rtems_region_return_segment(
-  rtems_id  id,
-  void     *segment
-)
-{
-  Region_Control *the_region;
-
-  the_region = _Region_Get_and_lock( id );
-
-  if ( the_region == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  if ( _Region_Free_segment( the_region, segment ) ) {
-    /* Unlocks allocator */
-    _Region_Process_queue( the_region );
-    return RTEMS_SUCCESSFUL;
-  }
-
-  _Region_Unlock( the_region );
-  return RTEMS_INVALID_ADDRESS;
-}
Index: cpukit/rtems/src/rtclock.c
===================================================================
--- cpukit/rtems/src/rtclock.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ cpukit/rtems/src/rtclock.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,153 @@
+/*
+ *  Clock Manager
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/clock.h>
+#include <rtems/config.h>
+#include <rtems/isr.h>
+#include <rtems/thread.h>
+#include <rtems/tod.h>
+#include <rtems/watchdog.h>
+
+/*PAGE
+ *
+ *  rtems_clock_get
+ *
+ *  This directive returns the current date and time.  If the time has
+ *  not been set by a tm_set then an error is returned.
+ *
+ *  Input parameters:
+ *    option      - which value to return
+ *    time_buffer - pointer to output buffer (a time and date structure
+ *                  or an interval)
+ *
+ *  Output parameters:
+ *    time_buffer      - output filled in
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code       - if unsuccessful
+ */
+
+rtems_status_code rtems_clock_get(
+  rtems_clock_get_options  option,
+  void                    *time_buffer
+)
+{
+  ISR_Level      level;
+  rtems_interval tmp;
+
+  switch ( option ) {
+    case RTEMS_CLOCK_GET_TOD:
+      if ( !_TOD_Is_set() )
+        return( RTEMS_NOT_DEFINED );
+
+      *(rtems_time_of_day *)time_buffer = _TOD_Current;
+      return( RTEMS_SUCCESSFUL );
+
+    case RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH:
+      if ( !_TOD_Is_set() )
+        return( RTEMS_NOT_DEFINED );
+
+      *(rtems_interval *)time_buffer = _TOD_Seconds_since_epoch;
+      return( RTEMS_SUCCESSFUL );
+
+    case RTEMS_CLOCK_GET_TICKS_SINCE_BOOT:
+      *(rtems_interval *)time_buffer = _TOD_Ticks_since_boot;
+      return( RTEMS_SUCCESSFUL );
+
+    case RTEMS_CLOCK_GET_TICKS_PER_SECOND:
+      *(rtems_interval *)time_buffer = _TOD_Ticks_per_second;
+      return( RTEMS_SUCCESSFUL );
+
+    case RTEMS_CLOCK_GET_TIME_VALUE:
+      if ( !_TOD_Is_set() )
+        return( RTEMS_NOT_DEFINED );
+
+      _ISR_Disable( level );
+        ((rtems_clock_time_value *)time_buffer)->seconds =
+          _TOD_Seconds_since_epoch;
+        tmp = _TOD_Current.ticks;
+      _ISR_Enable( level );
+
+      tmp *= _Configuration_Table->microseconds_per_tick;
+      ((rtems_clock_time_value *)time_buffer)->microseconds = tmp;
+
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_SUCCESSFUL );   /* should never get here */
+
+}
+
+/*PAGE
+ *
+ *  rtems_clock_set
+ *
+ *  This directive sets the date and time for this node.
+ *
+ *  Input parameters:
+ *    time_buffer - pointer to the time and date structure
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_clock_set(
+  rtems_time_of_day *time_buffer
+)
+{
+  rtems_status_code      local_result;
+  rtems_interval seconds;
+
+  local_result = _TOD_Validate( time_buffer );
+  if ( rtems_is_status_successful( local_result ) ) {
+    seconds = _TOD_To_seconds( time_buffer );
+    _Thread_Disable_dispatch();
+      _TOD_Set( time_buffer, seconds );
+    _Thread_Enable_dispatch();
+
+  }
+  return( local_result );
+}
+
+/*PAGE
+ *
+ *  rtems_clock_tick
+ *
+ *  This directive notifies the executve that a tick has occurred.
+ *  When the tick occurs the time manager updates and maintains
+ *  the calendar time, timeslicing, and any timeout delays.
+ *
+ *  Input parameters:  NONE
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - always succeeds
+ *
+ *  NOTE: This routine only works for leap-years through 2099.
+ */
+
+rtems_status_code rtems_clock_tick( void )
+{
+  _TOD_Tickle_ticks();
+
+  _Watchdog_Tickle_ticks();
+
+  _Thread_Tickle_timeslice();
+
+  if ( _Thread_Is_context_switch_necessary() &&
+       _Thread_Is_dispatching_enabled() )
+    _Thread_Dispatch();
+
+  return( RTEMS_SUCCESSFUL );
+}
Index: cpukit/rtems/src/rtemsbuildid.c
===================================================================
--- cpukit/rtems/src/rtemsbuildid.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_build_id() as a binding for languages other than C/C++.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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/object.h>
-
-static rtems_id _RTEMS_Build_id(
-  uint32_t api,
-  uint32_t class,
-  uint32_t node,
-  uint32_t index
-)
-{
-  return rtems_build_id( api, class, node, index );
-}
-
-#undef rtems_build_id
-
-rtems_id rtems_build_id(
-  uint32_t api,
-  uint32_t class,
-  uint32_t node,
-  uint32_t index
-)
-{
-  return _RTEMS_Build_id( api, class, node, index );
-}
Index: cpukit/rtems/src/rtemsbuildname.c
===================================================================
--- cpukit/rtems/src/rtemsbuildname.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_build_name() as a binding for languages other than C/C++.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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/object.h>
-
-static rtems_name _RTEMS_Build_name( char c1, char c2, char c3, char c4 )
-{
-  return rtems_build_name( c1, c2, c3, c4 );
-}
-
-#undef rtems_build_name
-
-rtems_name rtems_build_name( char c1, char c2, char c3, char c4 )
-{
-  return _RTEMS_Build_name( c1, c2, c3, c4 );
-}
Index: cpukit/rtems/src/rtemsmaxprio.c
===================================================================
--- cpukit/rtems/src/rtemsmaxprio.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   _RTEMS_Maximum_priority().
- */
-
-/*
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * 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/tasks.h>
-#include <rtems/score/scheduler.h>
-
-rtems_task_priority _RTEMS_Maximum_priority( void )
-{
-  return PRIORITY_MAXIMUM;
-}
Index: cpukit/rtems/src/rtemsnametoid.c
===================================================================
--- cpukit/rtems/src/rtemsnametoid.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   _RTEMS_Name_to_id().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * 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
-)
-{
-  Status_Control status;
-
-  status = _Objects_Name_to_id_u32( name, node, id, information );
-
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/rtemsobjectapimaximumclass.c
===================================================================
--- cpukit/rtems/src/rtemsobjectapimaximumclass.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_api_maximum_class().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/object.h>
-#include <rtems/score/objectimpl.h>
-
-int rtems_object_api_maximum_class(
-  int api
-)
-{
-  return _Objects_API_maximum_class(api);
-}
Index: cpukit/rtems/src/rtemsobjectapiminimumclass.c
===================================================================
--- cpukit/rtems/src/rtemsobjectapiminimumclass.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_api_minimum_class().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/object.h>
-#include <rtems/score/objectimpl.h>
-
-int rtems_object_api_minimum_class(
-  int api
-)
-{
-  if ( _Objects_Is_api_valid( api ) )
-    return 1;
-  return -1;
-}
Index: cpukit/rtems/src/rtemsobjectgetapiclassname.c
===================================================================
--- cpukit/rtems/src/rtemsobjectgetapiclassname.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,98 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_get_api_class_name().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/object.h>
-#include <rtems/score/objectimpl.h>
-
-#include <rtems/assoc.h>
-
-static const rtems_assoc_t rtems_object_api_internal_assoc[] = {
-  { "Thread",                  OBJECTS_INTERNAL_THREADS, 0},
-  { NULL,                      0, 0}
-};
-
-static const rtems_assoc_t rtems_object_api_classic_assoc[] = {
-  { "Task",                    OBJECTS_RTEMS_TASKS, 0},
-  { "Timer",                   OBJECTS_RTEMS_TIMERS, 0},
-  { "Semaphore",               OBJECTS_RTEMS_SEMAPHORES, 0},
-  { "Message Queue",           OBJECTS_RTEMS_MESSAGE_QUEUES, 0},
-  { "Partition",               OBJECTS_RTEMS_PARTITIONS, 0},
-  { "Region",                  OBJECTS_RTEMS_REGIONS, 0},
-  { "Port",                    OBJECTS_RTEMS_PORTS, 0},
-  { "Period",                  OBJECTS_RTEMS_PERIODS, 0},
-  { "Extension",               OBJECTS_RTEMS_EXTENSIONS, 0},
-  { "Barrier",                 OBJECTS_RTEMS_BARRIERS, 0},
-  { NULL,                      0, 0}
-};
-
-static const rtems_assoc_t rtems_object_api_posix_assoc[] = {
-  { "Thread",                  OBJECTS_POSIX_THREADS, 0},
-  { "Key",                     OBJECTS_POSIX_KEYS, 0},
-  { "Message Queue",           OBJECTS_POSIX_MESSAGE_QUEUES, 0},
-  { "Semaphore",               OBJECTS_POSIX_SEMAPHORES, 0},
-#ifdef RTEMS_POSIX_API
-  { "Timer",                   OBJECTS_POSIX_TIMERS, 0},
-#endif
-  { "Shared Memory",           OBJECTS_POSIX_SHMS, 0},
-  { NULL,                      0, 0}
-};
-
-const char *rtems_object_get_api_class_name(
-  int the_api,
-  int the_class
-)
-{
-  const rtems_assoc_t *api_assoc;
-  const rtems_assoc_t *class_assoc;
-
-  if ( the_api == OBJECTS_INTERNAL_API )
-    api_assoc = rtems_object_api_internal_assoc;
-  else if ( the_api == OBJECTS_CLASSIC_API )
-    api_assoc = rtems_object_api_classic_assoc;
-  else if ( the_api == OBJECTS_POSIX_API )
-    api_assoc = rtems_object_api_posix_assoc;
-  else
-    return "BAD API";
-  class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
-  if ( class_assoc )
-    return class_assoc->name;
-  return "BAD CLASS";
-}
Index: cpukit/rtems/src/rtemsobjectgetapiname.c
===================================================================
--- cpukit/rtems/src/rtemsobjectgetapiname.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_get_api_name().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/object.h>
-#include <rtems/score/objectimpl.h>
-#include <rtems/assoc.h>
-
-static const rtems_assoc_t rtems_objects_api_assoc[] = {
-  { "Internal", OBJECTS_INTERNAL_API, 0},
-  { "Classic",  OBJECTS_CLASSIC_API, 0},
-  { "POSIX",    OBJECTS_POSIX_API, 0},
-  { 0, 0, 0 }
-};
-
-const char *rtems_object_get_api_name(
-  int api
-)
-{
-  const rtems_assoc_t *api_assoc;
-
-  api_assoc = rtems_assoc_ptr_by_local( rtems_objects_api_assoc, api );
-  if ( api_assoc )
-    return api_assoc->name;
-  return "BAD CLASS";
-}
-
Index: cpukit/rtems/src/rtemsobjectgetclassicname.c
===================================================================
--- cpukit/rtems/src/rtemsobjectgetclassicname.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_get_classic_name().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/object.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/objectimpl.h>
-
-rtems_status_code rtems_object_get_classic_name(
-  rtems_id      id,
-  rtems_name   *name
-)
-{
-  Status_Control status;
-  Objects_Name   name_u;
-
-  if ( !name )
-    return RTEMS_INVALID_ADDRESS;
-
-  status = _Objects_Id_to_name( id, &name_u );
-
-  *name = name_u.name_u32;
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/rtemsobjectgetclassinfo.c
===================================================================
--- cpukit/rtems/src/rtemsobjectgetclassinfo.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,81 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_get_class_information().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/object.h>
-#include <rtems/score/objectimpl.h>
-
-rtems_status_code rtems_object_get_class_information(
-  int                                 the_api,
-  int                                 the_class,
-  rtems_object_api_class_information *info
-)
-{
-  Objects_Information *obj_info;
-  int                  unallocated;
-  int                  i;
-
-  /*
-   * Validate parameters and look up information structure.
-   */
-  if ( !info )
-    return RTEMS_INVALID_ADDRESS;
-
-  obj_info = _Objects_Get_information( the_api, the_class );
-  if ( !obj_info )
-    return RTEMS_INVALID_NUMBER;
-
-  /*
-   * Return information about this object class to the user.
-   */
-  info->minimum_id  = _Objects_Get_minimum_id( obj_info->maximum_id );
-  info->maximum_id  = obj_info->maximum_id;
-  info->auto_extend = _Objects_Is_auto_extend( obj_info );
-  info->maximum     = _Objects_Get_maximum_index( obj_info );
-
-  for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )
-    if ( !obj_info->local_table[i] )
-      unallocated++;
-
-  info->unallocated = unallocated;
-
-  return RTEMS_SUCCESSFUL;
-}
-
Index: cpukit/rtems/src/rtemsobjectgetname.c
===================================================================
--- cpukit/rtems/src/rtemsobjectgetname.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_get_name().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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/object.h>
-#include <rtems/score/objectimpl.h>
-
-char *rtems_object_get_name(
-  Objects_Id     id,
-  size_t         length,
-  char          *name
-)
-{
-  return _Objects_Get_name_as_string( id, length, name );
-}
Index: cpukit/rtems/src/rtemsobjectidapimaximum.c
===================================================================
--- cpukit/rtems/src/rtemsobjectidapimaximum.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_id_api_maximum() as a binding for languages other than C/C++.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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/object.h>
-
-static int _RTEMS_Object_id_api_maximum( void )
-{
-  return rtems_object_id_api_maximum();
-}
-
-#undef rtems_object_id_api_maximum
-
-int rtems_object_id_api_maximum( void )
-{
-  return _RTEMS_Object_id_api_maximum();
-}
Index: cpukit/rtems/src/rtemsobjectidapiminimum.c
===================================================================
--- cpukit/rtems/src/rtemsobjectidapiminimum.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_id_api_minimum() as a binding for languages other than C/C++.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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/object.h>
-
-static int _RTEMS_Object_id_api_minimum( void )
-{
-  return rtems_object_id_api_minimum();
-}
-
-#undef rtems_object_id_api_minimum
-
-int rtems_object_id_api_minimum( void )
-{
-  return _RTEMS_Object_id_api_minimum();
-}
Index: cpukit/rtems/src/rtemsobjectidgetapi.c
===================================================================
--- cpukit/rtems/src/rtemsobjectidgetapi.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_id_get_api() as a binding for languages other than C/C++.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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/object.h>
-
-static int _RTEMS_Object_id_get_api( rtems_id id )
-{
-  return rtems_object_id_get_api( id );
-}
-
-#undef rtems_object_id_get_api
-
-int rtems_object_id_get_api( rtems_id id )
-{
-  return _RTEMS_Object_id_get_api( id );
-}
Index: cpukit/rtems/src/rtemsobjectidgetclass.c
===================================================================
--- cpukit/rtems/src/rtemsobjectidgetclass.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_id_get_class() as a binding for languages other than C/C++.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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/object.h>
-
-static int _RTEMS_Object_id_get_class( rtems_id id )
-{
-  return rtems_object_id_get_class( id );
-}
-
-#undef rtems_object_id_get_class
-
-int rtems_object_id_get_class( rtems_id id )
-{
-  return _RTEMS_Object_id_get_class( id );
-}
Index: cpukit/rtems/src/rtemsobjectidgetindex.c
===================================================================
--- cpukit/rtems/src/rtemsobjectidgetindex.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_id_get_index() as a binding for languages other than C/C++.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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/object.h>
-
-static int _RTEMS_Object_id_get_index( rtems_id id )
-{
-  return rtems_object_id_get_index( id );
-}
-
-#undef rtems_object_id_get_index
-
-int rtems_object_id_get_index( rtems_id id )
-{
-  return _RTEMS_Object_id_get_index( id );
-}
Index: cpukit/rtems/src/rtemsobjectidgetnode.c
===================================================================
--- cpukit/rtems/src/rtemsobjectidgetnode.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_id_get_node() as a binding for languages other than C/C++.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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/object.h>
-
-static int _RTEMS_Object_id_get_node( rtems_id id )
-{
-  return rtems_object_id_get_node( id );
-}
-
-#undef rtems_object_id_get_node
-
-int rtems_object_id_get_node( rtems_id id )
-{
-  return _RTEMS_Object_id_get_node( id );
-}
Index: cpukit/rtems/src/rtemsobjectsetname.c
===================================================================
--- cpukit/rtems/src/rtemsobjectsetname.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,82 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicObject
- *
- * @brief This source file contains the implementation of
- *   rtems_object_set_name().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/object.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/tasks.h>
-#include <rtems/score/objectimpl.h>
-
-/*
- *  This method will set the object name based upon the user string.
- *  If the object class uses 32-bit names, then only the first 4 bytes
- *  of the string will be used.
- */
-rtems_status_code rtems_object_set_name(
-  rtems_id       id,
-  const char    *name
-)
-{
-  Objects_Information *information;
-  Objects_Control     *the_object;
-  Objects_Id           tmpId;
-  Status_Control       status;
-
-  if ( !name )
-    return RTEMS_INVALID_ADDRESS;
-
-  tmpId = (id == OBJECTS_ID_OF_SELF) ? rtems_task_self() : id;
-
-  information  = _Objects_Get_information_id( tmpId );
-  if ( !information )
-    return RTEMS_INVALID_ID;
-
-  _Objects_Allocator_lock();
-  the_object = _Objects_Get_no_protection( tmpId, information );
-
-  if ( the_object == NULL ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_INVALID_ID;
-  }
-
-  status = _Objects_Set_name( information, the_object, name );
-  _Objects_Allocator_unlock();
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/rtemstimer.c
===================================================================
--- cpukit/rtems/src/rtemstimer.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/rtemstimer.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,48 +1,343 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains a definition of the ::_Timer_Information
- *   with zero objects.
- */
-
 /*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * 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/timerdata.h>
-
-OBJECTS_INFORMATION_DEFINE_ZERO(
-  _Timer,
-  OBJECTS_CLASSIC_API,
-  OBJECTS_RTEMS_TIMERS,
-  OBJECTS_NO_STRING_NAME
-);
+ *  Timer Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/object.h>
+#include <rtems/thread.h>
+#include <rtems/timer.h>
+#include <rtems/tod.h>
+#include <rtems/watchdog.h>
+
+/*PAGE
+ *
+ *  _Timer_Manager_initialization
+ *
+ *  This routine initializes all timer manager related data structures.
+ *
+ *  Input parameters:
+ *    maximum_timers - number of timers to initialize
+ *
+ *  Output parameters:  NONE
+ */
+
+void _Timer_Manager_initialization(
+  unsigned32 maximum_timers
+)
+{
+  _Objects_Initialize_information(
+     &_Timer_Information,
+     FALSE,
+     maximum_timers,
+     sizeof( Timer_Control )
+  );
+}
+
+/*PAGE
+ *
+ *  rtems_timer_create
+ *
+ *  This directive creates a timer and performs some initialization.
+ *
+ *  Input parameters:
+ *    name - timer name
+ *    id   - pointer to timer id
+ *
+ *  Output parameters:
+ *    id                - timer id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_timer_create(
+  Objects_Name  name,
+  Objects_Id   *id
+)
+{
+  Timer_Control *the_timer;
+
+  if ( !_Objects_Is_name_valid( name ) )
+    return ( RTEMS_INVALID_NAME );
+
+  _Thread_Disable_dispatch();         /* to prevent deletion */
+
+  the_timer = _Timer_Allocate();
+
+  if ( !the_timer ) {
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  the_timer->the_class = TIMER_DORMANT;
+
+  _Objects_Open( &_Timer_Information, &the_timer->Object, name );
+
+  *id = the_timer->Object.id;
+  _Thread_Enable_dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_timer_ident
+ *
+ *  This directive returns the system ID associated with
+ *  the timer name.
+ *
+ *  Input parameters:
+ *    name - user defined message queue name
+ *    id   - pointer to timer id
+ *
+ *  Output parameters:
+ *    *id               - message queue id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_timer_ident(
+  Objects_Name  name,
+  Objects_Id   *id
+)
+{
+  return _Objects_Name_to_id(
+    &_Timer_Information,
+    name,
+    RTEMS_SEARCH_LOCAL_NODE,
+    id
+  );
+}
+
+/*PAGE
+ *
+ *  rtems_timer_cancel
+ *
+ *  This directive allows a thread to cancel a timer.
+ *
+ *  Input parameters:
+ *    id - timer id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_timer_cancel(
+  Objects_Id id
+)
+{
+  Timer_Control   *the_timer;
+  Objects_Locations       location;
+
+  the_timer = _Timer_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:            /* should never return this */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) {
+        (void) _Watchdog_Remove( &the_timer->Ticker );
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_INCORRECT_STATE );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_timer_delete
+ *
+ *  This directive allows a thread to delete a timer.
+ *
+ *  Input parameters:
+ *    id - timer id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_timer_delete(
+  Objects_Id id
+)
+{
+  Timer_Control   *the_timer;
+  Objects_Locations       location;
+
+  the_timer = _Timer_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:            /* should never return this */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      _Objects_Close( &_Timer_Information, &the_timer->Object );
+      (void) _Watchdog_Remove( &the_timer->Ticker );
+      _Timer_Free( the_timer );
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_timer_fire_after
+ *
+ *  This directive allows a thread to start a timer.
+ *
+ *  Input parameters:
+ *    id      - timer id
+ *    ticks   - interval until routine is fired
+ *    routine - routine to schedule
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_timer_fire_after(
+  Objects_Id         id,
+  rtems_interval  ticks,
+  Timer_Service      routine,
+  void              *user_data
+)
+{
+  Timer_Control   *the_timer;
+  Objects_Locations       location;
+
+  if ( ticks == 0 )
+    return( RTEMS_INVALID_NUMBER );
+
+  the_timer = _Timer_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:            /* should never return this */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      (void) _Watchdog_Remove( &the_timer->Ticker );
+      the_timer->the_class = TIMER_INTERVAL;
+      _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
+      _Watchdog_Insert_ticks( &the_timer->Ticker,
+                                 ticks, WATCHDOG_ACTIVATE_NOW );
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_timer_fire_when
+ *
+ *  This directive allows a thread to start a timer.
+ *
+ *  Input parameters:
+ *    id        - timer id
+ *    wall_time - time of day to fire timer
+ *    routine   - routine to schedule
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_timer_fire_when(
+  Objects_Id          id,
+  rtems_time_of_day        *wall_time,
+  Timer_Service       routine,
+  void               *user_data
+)
+{
+  Timer_Control   *the_timer;
+  Objects_Locations       location;
+  rtems_status_code            validate_status;
+  rtems_interval       seconds;
+
+  if ( !_TOD_Is_set() )
+    return( RTEMS_NOT_DEFINED );
+
+  validate_status = _TOD_Validate( wall_time );
+  if ( !rtems_is_status_successful( validate_status ) )
+    return( validate_status );
+
+  seconds = _TOD_To_seconds( wall_time );
+  if ( seconds <= _TOD_Seconds_since_epoch )
+    return( RTEMS_INVALID_CLOCK );
+
+  the_timer = _Timer_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:            /* should never return this */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      (void) _Watchdog_Remove( &the_timer->Ticker );
+      the_timer->the_class = TIMER_TIME_OF_DAY;
+      _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
+      _Watchdog_Insert_seconds( &the_timer->Ticker,
+                seconds - _TOD_Seconds_since_epoch, WATCHDOG_ACTIVATE_NOW );
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_timer_reset
+ *
+ *  This directive allows a thread to reset a timer.
+ *
+ *  Input parameters:
+ *    id - timer id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_timer_reset(
+  Objects_Id id
+)
+{
+  Timer_Control *the_timer;
+  Objects_Locations     location;
+
+  the_timer = _Timer_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:            /* should never return this */
+      return( RTEMS_INTERNAL_ERROR );
+    case OBJECTS_LOCAL:
+      if ( _Timer_Is_interval_class( the_timer->the_class ) ) {
+        _Watchdog_Reset( &the_timer->Ticker );
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_NOT_DEFINED );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
Index: cpukit/rtems/src/scheduleraddprocessor.c
===================================================================
--- cpukit/rtems/src/scheduleraddprocessor.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,138 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_add_processor().
- */
-
-/*
- * Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-#include <rtems/score/assert.h>
-#include <rtems/score/schedulerimpl.h>
-#include <rtems/config.h>
-
-rtems_status_code rtems_scheduler_add_processor(
-  rtems_id scheduler_id,
-  uint32_t cpu_index
-)
-{
-  uint32_t                 scheduler_index;
-#if defined(RTEMS_SMP)
-  Per_CPU_Control         *cpu;
-  rtems_status_code        status;
-#endif
-
-  scheduler_index = _Scheduler_Get_index_by_id( scheduler_id );
-
-  if ( scheduler_index >= _Scheduler_Count ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  if ( cpu_index >= rtems_configuration_get_maximum_processors() ) {
-    return RTEMS_NOT_CONFIGURED;
-  }
-
-#if defined(RTEMS_SMP)
-  cpu = _Per_CPU_Get_by_index( cpu_index );
-
-  if ( _Scheduler_Initial_assignments[ cpu_index ].scheduler == NULL ) {
-    return RTEMS_NOT_CONFIGURED;
-  }
-
-  if ( !_Per_CPU_Is_processor_online( cpu ) ) {
-    return RTEMS_INCORRECT_STATE;
-  }
-
-  _Objects_Allocator_lock();
-
-  if ( cpu->Scheduler.control == NULL ) {
-    const Scheduler_Control *scheduler;
-    Scheduler_Context       *scheduler_context;
-    Priority_Control         idle_priority;
-    Thread_Control          *idle;
-    Scheduler_Node          *scheduler_node;
-    ISR_lock_Context         lock_context;
-    Per_CPU_Control         *cpu_self;
-
-    scheduler = &_Scheduler_Table[ scheduler_index ];
-    scheduler_context = _Scheduler_Get_context( scheduler );
-    idle_priority =
-      _Scheduler_Map_priority( scheduler, scheduler->maximum_priority );
-
-    idle = cpu->Scheduler.idle_if_online_and_unused;
-    _Assert( idle != NULL );
-    cpu->Scheduler.idle_if_online_and_unused = NULL;
-
-    idle->Scheduler.home_scheduler = scheduler;
-    idle->Start.initial_priority = idle_priority;
-    scheduler_node =
-      _Thread_Scheduler_get_node_by_index( idle, scheduler_index );
-    _Priority_Node_set_priority( &idle->Real_priority, idle_priority );
-    _Priority_Initialize_one(
-      &scheduler_node->Wait.Priority,
-      &idle->Real_priority
-    );
-    _Assert( _Chain_Is_empty( &idle->Scheduler.Wait_nodes ) );
-    _Chain_Initialize_one(
-      &idle->Scheduler.Wait_nodes,
-      &scheduler_node->Thread.Wait_node
-    );
-    _Assert( _Chain_Is_empty( &idle->Scheduler.Scheduler_nodes ) );
-    _Chain_Initialize_one(
-      &idle->Scheduler.Scheduler_nodes,
-      &scheduler_node->Thread.Scheduler_node.Chain
-    );
-
-    _ISR_lock_ISR_disable( &lock_context );
-    _Scheduler_Acquire_critical( scheduler, &lock_context );
-    _Processor_mask_Set( &scheduler_context->Processors, cpu_index );
-    cpu->Scheduler.control = scheduler;
-    cpu->Scheduler.context = scheduler_context;
-    ( *scheduler->Operations.add_processor )( scheduler, idle );
-    cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
-    _Scheduler_Release_critical( scheduler, &lock_context );
-    _ISR_lock_ISR_enable( &lock_context );
-    _Thread_Dispatch_direct( cpu_self );
-    status = RTEMS_SUCCESSFUL;
-  } else {
-    status = RTEMS_RESOURCE_IN_USE;
-  }
-
-  _Objects_Allocator_unlock();
-  return status;
-#else
-  return RTEMS_RESOURCE_IN_USE;
-#endif
-}
Index: cpukit/rtems/src/schedulergetmaxprio.c
===================================================================
--- cpukit/rtems/src/schedulergetmaxprio.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_get_maximum_priority().
- */
-
-/*
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_scheduler_get_maximum_priority(
-  rtems_id             scheduler_id,
-  rtems_task_priority *priority
-)
-{
-  uint32_t index;
-
-  if ( priority == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  index = _Scheduler_Get_index_by_id( scheduler_id );
-  if ( index >= _Scheduler_Count ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  *priority = _Scheduler_Table[ index ].maximum_priority;
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/schedulergetprocessor.c
===================================================================
--- cpukit/rtems/src/schedulergetprocessor.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_get_processor() which may be used by binding for languages
- *   other than C/C++.
- */
-
-/*
- * Copyright (C) 2021 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-
-static uint32_t _RTEMS_Scheduler_get_processor( void )
-{
-  return rtems_scheduler_get_processor();
-}
-
-#undef rtems_scheduler_get_processor
-
-uint32_t rtems_scheduler_get_processor( void )
-{
-  return _RTEMS_Scheduler_get_processor();
-}
Index: cpukit/rtems/src/schedulergetprocessormax.c
===================================================================
--- cpukit/rtems/src/schedulergetprocessormax.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_get_processor_maximum() which may be used by binding for
- *   languages other than C/C++.
- */
-
-/*
- * Copyright (C) 2021 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-
-static uint32_t _RTEMS_Scheduler_get_processor_maximum( void )
-{
-  return rtems_scheduler_get_processor_maximum();
-}
-
-#undef rtems_scheduler_get_processor_maximum
-
-uint32_t rtems_scheduler_get_processor_maximum( void )
-{
-  return _RTEMS_Scheduler_get_processor_maximum();
-}
Index: cpukit/rtems/src/schedulergetprocessorset.c
===================================================================
--- cpukit/rtems/src/schedulergetprocessorset.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,70 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_get_processor_set().
- */
-
-/*
- * Copyright (C) 2014, 2017 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_scheduler_get_processor_set(
-  rtems_id   scheduler_id,
-  size_t     cpusetsize,
-  cpu_set_t *cpuset
-)
-{
-  const Scheduler_Control    *scheduler;
-  const Processor_mask       *processor_set;
-  Processor_mask_Copy_status  status;
-
-  if ( cpuset == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  scheduler = _Scheduler_Get_by_id( scheduler_id );
-  if ( scheduler == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  processor_set = _Scheduler_Get_processors( scheduler );
-  status = _Processor_mask_To_cpu_set_t( processor_set, cpusetsize, cpuset );
-  if ( status != PROCESSOR_MASK_COPY_LOSSLESS ) {
-    return RTEMS_INVALID_SIZE;
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/schedulerident.c
===================================================================
--- cpukit/rtems/src/schedulerident.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_ident().
- */
-
-/*
- * Copyright (C) 2014, 2022 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_scheduler_ident(
-  rtems_name  name,
-  rtems_id   *id
-)
-{
-  size_t i;
-
-  if ( id == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  for ( i = 0; i < _Scheduler_Count; ++i ) {
-    const Scheduler_Control *scheduler = &_Scheduler_Table[ i ];
-
-    if ( scheduler->name == name ) {
-      *id = _Scheduler_Build_id( i );
-      return RTEMS_SUCCESSFUL;
-    }
-  }
-
-  return RTEMS_INVALID_NAME;
-}
Index: cpukit/rtems/src/scheduleridentbyprocessor.c
===================================================================
--- cpukit/rtems/src/scheduleridentbyprocessor.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_ident_by_processor().
- */
-
-/*
- * Copyright (c) 2017 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-#include <rtems/score/assert.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_scheduler_ident_by_processor(
-  uint32_t  cpu_index,
-  rtems_id *id
-)
-{
-  const Scheduler_Control *scheduler;
-
-  if ( id == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( cpu_index >= _SMP_Get_processor_maximum() ) {
-    return RTEMS_INVALID_NAME;
-  }
-
-  scheduler = _Scheduler_Get_by_CPU( _Per_CPU_Get_by_index( cpu_index ) );
-#if defined(RTEMS_SMP)
-  if ( scheduler == NULL ) {
-    return RTEMS_INCORRECT_STATE;
-  }
-#else
-  _Assert( scheduler != NULL );
-#endif
-
-  *id = _Scheduler_Build_id( _Scheduler_Get_index( scheduler ) );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/scheduleridentbyprocessorset.c
===================================================================
--- cpukit/rtems/src/scheduleridentbyprocessorset.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_ident_by_processor_set().
- */
-
-/*
- * Copyright (c) 2017 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-#include <rtems/score/assert.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_scheduler_ident_by_processor_set(
-  size_t           cpusetsize,
-  const cpu_set_t *cpuset,
-  rtems_id        *id
-)
-{
-  Processor_mask              set;
-  Processor_mask_Copy_status  status;
-  uint32_t                    cpu_index;
-  const Scheduler_Control    *scheduler;
-
-  if ( id == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( cpuset == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  status = _Processor_mask_From_cpu_set_t( &set, cpusetsize, cpuset );
-  if ( status == PROCESSOR_MASK_COPY_INVALID_SIZE ) {
-    return RTEMS_INVALID_SIZE;
-  }
-
-  _Processor_mask_And( &set, &set, _SMP_Get_online_processors() );
-  cpu_index = _Processor_mask_Find_last_set( &set );
-  if ( cpu_index == 0 ) {
-    return RTEMS_INVALID_NAME;
-  }
-
-  scheduler = _Scheduler_Get_by_CPU( _Per_CPU_Get_by_index( cpu_index - 1) );
-#if defined(RTEMS_SMP)
-  if ( scheduler == NULL ) {
-    return RTEMS_INCORRECT_STATE;
-  }
-#else
-  _Assert( scheduler != NULL );
-#endif
-
-  *id = _Scheduler_Build_id( _Scheduler_Get_index( scheduler ) );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/schedulermapfromposix.c
===================================================================
--- cpukit/rtems/src/schedulermapfromposix.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_map_priority_from_posix().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_scheduler_map_priority_from_posix(
-  rtems_id             scheduler_id,
-  int                  posix_priority,
-  rtems_task_priority *priority
-)
-{
-  const Scheduler_Control *scheduler;
-
-  if ( priority == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  scheduler = _Scheduler_Get_by_id( scheduler_id );
-  if ( scheduler == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  if ( posix_priority < 1 ) {
-    return RTEMS_INVALID_PRIORITY;
-  }
-
-  if ( posix_priority >= scheduler->maximum_priority ) {
-    return RTEMS_INVALID_PRIORITY;
-  }
-
-  *priority = scheduler->maximum_priority - (Priority_Control) posix_priority;
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/schedulermaptoposix.c
===================================================================
--- cpukit/rtems/src/schedulermaptoposix.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_map_priority_to_posix().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_scheduler_map_priority_to_posix(
-  rtems_id             scheduler_id,
-  rtems_task_priority  priority,
-  int                 *posix_priority
-)
-{
-  const Scheduler_Control *scheduler;
-
-  if ( posix_priority == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  scheduler = _Scheduler_Get_by_id( scheduler_id );
-  if ( scheduler == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  if ( priority < 1 ) {
-    return RTEMS_INVALID_PRIORITY;
-  }
-
-  if ( priority >= scheduler->maximum_priority ) {
-    return RTEMS_INVALID_PRIORITY;
-  }
-
-  *posix_priority = (int) ( scheduler->maximum_priority - priority );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/schedulerremoveprocessor.c
===================================================================
--- cpukit/rtems/src/schedulerremoveprocessor.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,215 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicScheduler
- *
- * @brief This source file contains the implementation of
- *   rtems_scheduler_remove_processor().
- */
-
-/*
- * Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * 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/scheduler.h>
-#include <rtems/score/schedulerimpl.h>
-#include <rtems/config.h>
-
-#if defined(RTEMS_SMP)
-typedef struct {
-  const Scheduler_Control *scheduler;
-  rtems_status_code        status;
-} Scheduler_Processor_removal_context;
-
-static bool _Scheduler_Check_processor_not_required(
-  Thread_Control *the_thread,
-  void           *arg
-)
-{
-  Scheduler_Processor_removal_context *iter_context;
-  Thread_queue_Context                 queue_context;
-  ISR_lock_Context                     state_context;
-
-  if ( the_thread->is_idle ) {
-    return false;
-  }
-
-  iter_context = arg;
-
-  _Thread_queue_Context_initialize( &queue_context );
-  _Thread_Wait_acquire( the_thread, &queue_context );
-  _Thread_State_acquire_critical( the_thread, &state_context );
-
-  if (
-    _Thread_Scheduler_get_home( the_thread ) == iter_context->scheduler
-      && !_Processor_mask_Has_overlap(
-        &the_thread->Scheduler.Affinity,
-        _Scheduler_Get_processors( iter_context->scheduler )
-      )
-  ) {
-    iter_context->status = RTEMS_RESOURCE_IN_USE;
-  }
-
-  _Thread_State_release_critical( the_thread, &state_context );
-  _Thread_Wait_release( the_thread, &queue_context );
-  return iter_context->status != RTEMS_SUCCESSFUL;
-}
-
-static bool _Scheduler_Check_no_helping(
-  Thread_Control *the_thread,
-  void           *arg
-)
-{
-  Scheduler_Processor_removal_context *iter_context;
-  ISR_lock_Context                     lock_context;
-  const Chain_Node                    *node;
-  const Chain_Node                    *tail;
-
-  if ( the_thread->is_idle ) {
-    return false;
-  }
-
-  iter_context = arg;
-
-  _Thread_State_acquire( the_thread, &lock_context );
-  node = _Chain_Immutable_first( &the_thread->Scheduler.Scheduler_nodes );
-  tail = _Chain_Immutable_tail( &the_thread->Scheduler.Scheduler_nodes );
-
-  do {
-    const Scheduler_Node    *scheduler_node;
-    const Scheduler_Control *scheduler;
-
-    scheduler_node = SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE( node );
-    scheduler = _Scheduler_Node_get_scheduler( scheduler_node );
-
-    if ( scheduler == iter_context->scheduler ) {
-      iter_context->status = RTEMS_RESOURCE_IN_USE;
-      break;
-    }
-
-    node = _Chain_Immutable_next( node );
-  } while ( node != tail );
-
-  _Thread_State_release( the_thread, &lock_context );
-  return iter_context->status != RTEMS_SUCCESSFUL;
-}
-#endif
-
-rtems_status_code rtems_scheduler_remove_processor(
-  rtems_id scheduler_id,
-  uint32_t cpu_index
-)
-{
-  const Scheduler_Control             *scheduler;
-#if defined(RTEMS_SMP)
-  Scheduler_Processor_removal_context  iter_context;
-  ISR_lock_Context                     lock_context;
-  Scheduler_Context                   *scheduler_context;
-  Per_CPU_Control                     *cpu;
-  Per_CPU_Control                     *cpu_self;
-#endif
-
-  scheduler = _Scheduler_Get_by_id( scheduler_id );
-  if ( scheduler == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  if ( cpu_index >= rtems_configuration_get_maximum_processors() ) {
-    return RTEMS_INVALID_NUMBER;
-  }
-
-#if defined(RTEMS_SMP)
-  iter_context.scheduler = scheduler;
-  iter_context.status = RTEMS_SUCCESSFUL;
-  scheduler_context = _Scheduler_Get_context( scheduler );
-  cpu = _Per_CPU_Get_by_index( cpu_index );
-
-  _Objects_Allocator_lock();
-
-  if ( cpu->Scheduler.control != scheduler ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_INVALID_NUMBER;
-  }
-
-  /*
-   * This prevents the selection of this scheduler instance by new threads in
-   * case the processor count changes to zero.
-   */
-  _ISR_lock_ISR_disable( &lock_context );
-  _Scheduler_Acquire_critical( scheduler, &lock_context );
-  _Processor_mask_Clear( &scheduler_context->Processors, cpu_index );
-  _Scheduler_Release_critical( scheduler, &lock_context );
-  _ISR_lock_ISR_enable( &lock_context );
-
-  _Thread_Iterate( _Scheduler_Check_processor_not_required, &iter_context );
-
-  if (
-    _Processor_mask_Is_zero( &scheduler_context->Processors ) &&
-    iter_context.status == RTEMS_SUCCESSFUL
-  ) {
-    _Thread_Iterate( _Scheduler_Check_no_helping, &iter_context );
-  }
-
-  _ISR_lock_ISR_disable( &lock_context );
-  _Scheduler_Acquire_critical( scheduler, &lock_context );
-
-  if ( iter_context.status == RTEMS_SUCCESSFUL ) {
-    Thread_Control *idle;
-    Scheduler_Node *scheduler_node;
-
-    cpu->Scheduler.control = NULL;
-    cpu->Scheduler.context = NULL;
-    idle = ( *scheduler->Operations.remove_processor )( scheduler, cpu );
-    cpu->Scheduler.idle_if_online_and_unused = idle;
-
-    scheduler_node = _Thread_Scheduler_get_home_node( idle );
-    _Priority_Plain_extract(
-      &scheduler_node->Wait.Priority,
-      &idle->Real_priority
-    );
-    _Assert( _Priority_Is_empty( &scheduler_node->Wait.Priority ) );
-    _Chain_Extract_unprotected( &scheduler_node->Thread.Wait_node );
-    _Assert( _Chain_Is_empty( &idle->Scheduler.Wait_nodes ) );
-    _Chain_Extract_unprotected( &scheduler_node->Thread.Scheduler_node.Chain );
-    _Assert( _Chain_Is_empty( &idle->Scheduler.Scheduler_nodes ) );
-  } else {
-    _Processor_mask_Set( &scheduler_context->Processors, cpu_index );
-  }
-
-  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
-  _Scheduler_Release_critical( scheduler, &lock_context );
-  _ISR_lock_ISR_enable( &lock_context );
-  _Thread_Dispatch_direct( cpu_self );
-  _Objects_Allocator_unlock();
-  return iter_context.status;
-#else
-  return RTEMS_RESOURCE_IN_USE;
-#endif
-}
Index: cpukit/rtems/src/sem.c
===================================================================
--- cpukit/rtems/src/sem.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/sem.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,48 +1,483 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSemaphore
- *
- * @brief This source file contains a definition of the
- *   ::_Semaphore_Information with zero objects.
- */
-
 /*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * 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/semdata.h>
-
-OBJECTS_INFORMATION_DEFINE_ZERO(
-  _Semaphore,
-  OBJECTS_CLASSIC_API,
-  OBJECTS_RTEMS_SEMAPHORES,
-  OBJECTS_NO_STRING_NAME
-);
+ *  Semaphore Manager
+ *
+ *  DESCRIPTION:
+ *
+ *  This package is the implementation of the Semaphore Manager.
+ *  This manager utilizes standard Dijkstra counting semaphores to provide
+ *  synchronization and mutual exclusion capabilities.
+ *
+ *  Directives provided are:
+ *
+ *     + create a semaphore
+ *     + get an ID of a semaphore
+ *     + delete a semaphore
+ *     + acquire a semaphore
+ *     + release a semaphore
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/attr.h>
+#include <rtems/config.h>
+#include <rtems/isr.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/sem.h>
+#include <rtems/states.h>
+#include <rtems/thread.h>
+#include <rtems/threadq.h>
+#include <rtems/mpci.h>
+
+/*PAGE
+ *
+ *  _Semaphore_Manager_initialization
+ *
+ *  This routine initializes all semaphore manager related data structures.
+ *
+ *  Input parameters:
+ *    maximum_semaphores - maximum configured semaphores
+ *
+ *  Output parameters:  NONE
+ */
+
+void _Semaphore_Manager_initialization(
+  unsigned32 maximum_semaphores
+)
+{
+  _Objects_Initialize_information(
+    &_Semaphore_Information,
+    TRUE,
+    maximum_semaphores,
+    sizeof( Semaphore_Control )
+  );
+}
+
+/*PAGE
+ *
+ *  rtems_semaphore_create
+ *
+ *  This directive creates a semaphore and sets the initial value based
+ *  on the given count.  A semaphore id is returned.
+ *
+ *  Input parameters:
+ *    name          - user defined semaphore name
+ *    count         - initial count of semaphore
+ *    attribute_set - semaphore attributes
+ *    id            - pointer to semaphore id
+ *
+ *  Output parameters:
+ *    id       - semaphore id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_semaphore_create(
+  Objects_Name        name,
+  unsigned32          count,
+  rtems_attribute  attribute_set,
+  Objects_Id         *id
+)
+{
+  register Semaphore_Control *the_semaphore;
+
+  if ( !_Objects_Is_name_valid( name ) )
+    return ( RTEMS_INVALID_NAME );
+
+  if ( _Attributes_Is_global( attribute_set ) ) {
+
+    if ( !_Configuration_Is_multiprocessing() )
+      return( RTEMS_MP_NOT_CONFIGURED );
+
+    if ( _Attributes_Is_inherit_priority( attribute_set ) )
+      return( RTEMS_NOT_DEFINED );
+
+  } else if ( _Attributes_Is_inherit_priority( attribute_set ) ) {
+
+    if ( ! ( _Attributes_Is_binary_semaphore( attribute_set ) &&
+             _Attributes_Is_priority( attribute_set ) ) )
+      return( RTEMS_NOT_DEFINED );
+
+  }
+
+  if ( _Attributes_Is_binary_semaphore( attribute_set ) && ( count > 1 ) )
+    return( RTEMS_INVALID_NUMBER );
+
+  _Thread_Disable_dispatch();             /* prevents deletion */
+
+  the_semaphore = _Semaphore_Allocate();
+
+  if ( !the_semaphore ) {
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  if ( _Attributes_Is_global( attribute_set ) &&
+       !( _Objects_MP_Open( &_Semaphore_Information, name,
+                            the_semaphore->Object.id, FALSE ) ) ) {
+    _Semaphore_Free( the_semaphore );
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  the_semaphore->attribute_set = attribute_set;
+  the_semaphore->count         = count;
+
+  if ( _Attributes_Is_binary_semaphore( attribute_set ) && count == 0 ) {
+    the_semaphore->nest_count = 1;
+    the_semaphore->holder     = _Thread_Executing;
+    the_semaphore->holder_id  = _Thread_Executing->Object.id;
+    _Thread_Executing->resource_count++;
+  } else {
+    the_semaphore->nest_count = 0;
+    the_semaphore->holder     = NULL;
+    the_semaphore->holder_id  = 0;
+  }
+
+  _Thread_queue_Initialize( &the_semaphore->Wait_queue,
+                            attribute_set, STATES_WAITING_FOR_SEMAPHORE );
+
+  _Objects_Open( &_Semaphore_Information, &the_semaphore->Object, name );
+
+  *id = the_semaphore->Object.id;
+
+  if ( _Attributes_Is_global( attribute_set ) )
+    _Semaphore_MP_Send_process_packet(
+      SEMAPHORE_MP_ANNOUNCE_CREATE,
+      the_semaphore->Object.id,
+      name,
+      0                          /* Not used */
+    );
+  _Thread_Enable_dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_semaphore_ident
+ *
+ *  This directive returns the system ID associated with
+ *  the semaphore name.
+ *
+ *  Input parameters:
+ *    name - user defined semaphore name
+ *    node - node(s) to be searched
+ *    id   - pointer to semaphore id
+ *
+ *  Output parameters:
+ *    *id      - semaphore id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_semaphore_ident(
+  Objects_Name  name,
+  unsigned32    node,
+  Objects_Id   *id
+)
+{
+  return( _Objects_Name_to_id( &_Semaphore_Information, name, node, id ) );
+}
+
+/*PAGE
+ *
+ *  rtems_semaphore_delete
+ *
+ *  This directive allows a thread to delete a semaphore specified by
+ *  the semaphore id.  The semaphore is freed back to the inactive
+ *  semaphore chain.
+ *
+ *  Input parameters:
+ *    id - semaphore id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_semaphore_delete(
+  Objects_Id id
+)
+{
+  register Semaphore_Control *the_semaphore;
+  Objects_Locations           location;
+
+  the_semaphore = _Semaphore_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Dispatch();
+      return( RTEMS_ILLEGAL_ON_REMOTE_OBJECT );
+    case OBJECTS_LOCAL:
+      if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set) &&
+                       ( the_semaphore->count == 0 ) ) {
+        _Thread_Enable_dispatch();
+        return( RTEMS_RESOURCE_IN_USE );
+      }
+
+      _Objects_Close( &_Semaphore_Information, &the_semaphore->Object );
+
+      _Thread_queue_Flush(
+        &the_semaphore->Wait_queue,
+        _Semaphore_MP_Send_object_was_deleted
+      );
+
+      _Semaphore_Free( the_semaphore );
+
+      if ( _Attributes_Is_global( the_semaphore->attribute_set ) ) {
+
+        _Objects_MP_Close( &_Semaphore_Information, the_semaphore->Object.id );
+
+        _Semaphore_MP_Send_process_packet(
+          SEMAPHORE_MP_ANNOUNCE_DELETE,
+          the_semaphore->Object.id,
+          0,                         /* Not used */
+          0                          /* Not used */
+        );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_semaphore_obtain
+ *
+ *  This directive allows a thread to acquire a semaphore.
+ *
+ *  Input parameters:
+ *    id         - semaphore id
+ *    option_set - wait option
+ *    timeout    - number of ticks to wait (0 means wait forever)
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_semaphore_obtain(
+  Objects_Id        id,
+  unsigned32        option_set,
+  rtems_interval timeout
+)
+{
+  register Semaphore_Control *the_semaphore;
+  Objects_Locations           location;
+
+  the_semaphore = _Semaphore_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      return _Semaphore_MP_Send_request_packet(
+          SEMAPHORE_MP_OBTAIN_REQUEST,
+          id,
+          option_set,
+          timeout
+      );
+    case OBJECTS_LOCAL:
+      if ( !_Semaphore_Seize( the_semaphore, option_set ) ) {
+        if ( _Attributes_Is_inherit_priority( the_semaphore->attribute_set ) &&
+             the_semaphore->holder->current_priority >
+               _Thread_Executing->current_priority ) {
+            _Thread_Change_priority(
+              the_semaphore->holder, _Thread_Executing->current_priority );
+         }
+        _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout );
+      }
+      _Thread_Enable_dispatch();
+      return( _Thread_Executing->Wait.return_code );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_semaphore_release
+ *
+ *  This directive allows a thread to release a semaphore.
+ *
+ *  Input parameters:
+ *    id - semaphore id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_semaphore_release(
+  Objects_Id id
+)
+{
+  register Semaphore_Control *the_semaphore;
+  Objects_Locations           location;
+  Thread_Control             *the_thread;
+
+  the_semaphore = _Semaphore_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      return(
+        _Semaphore_MP_Send_request_packet(
+          SEMAPHORE_MP_RELEASE_REQUEST,
+          id,
+          0,                               /* Not used */
+          MPCI_DEFAULT_TIMEOUT
+        )
+      );
+    case OBJECTS_LOCAL:
+      if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set)) {
+
+        if ( !_Objects_Are_ids_equal(
+               _Thread_Executing->Object.id, the_semaphore->holder_id ) ) {
+          _Thread_Enable_dispatch();
+          return( RTEMS_NOT_OWNER_OF_RESOURCE );
+        }
+
+        the_semaphore->nest_count--;
+
+        if ( the_semaphore->nest_count != 0 ) {
+          _Thread_Enable_dispatch();
+          return( RTEMS_SUCCESSFUL );
+        }
+
+        _Thread_Executing->resource_count--;
+        the_semaphore->holder    = NULL;
+        the_semaphore->holder_id = 0;
+
+        /*
+         *  Whether or not someone is waiting for the semaphore, an
+         *  inherited priority must be lowered if this is the last
+         *  semaphore (i.e. resource) this task has.
+         */
+
+        if ( _Attributes_Is_inherit_priority(the_semaphore->attribute_set) &&
+             _Thread_Executing->resource_count == 0 &&
+             _Thread_Executing->real_priority !=
+                _Thread_Executing->current_priority ) {
+           _Thread_Change_priority(
+              _Thread_Executing, _Thread_Executing->real_priority );
+        }
+
+      }
+
+      if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
+
+        if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
+          the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
+
+          if ( _Attributes_Is_binary_semaphore(the_semaphore->attribute_set) ) {
+            the_semaphore->holder    = NULL;
+            the_semaphore->holder_id = the_thread->Object.id;
+            the_semaphore->nest_count = 1;
+          }
+
+          _Semaphore_MP_Send_response_packet(
+            SEMAPHORE_MP_OBTAIN_RESPONSE,
+            id,
+            the_thread
+          );
+        } else {
+
+          if ( _Attributes_Is_binary_semaphore(the_semaphore->attribute_set) ) {
+            the_semaphore->holder    = the_thread;
+            the_semaphore->holder_id = the_thread->Object.id;
+            the_thread->resource_count++;
+            the_semaphore->nest_count = 1;
+          }
+
+          /*
+           *  No special action for priority inheritance because the_thread
+           *  is guaranteed to be the highest priority thread waiting for
+           *  the semaphore.
+           */
+        }
+      } else
+        the_semaphore->count += 1;
+
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  _Semaphore_Seize
+ *
+ *  This routine attempts to allocate a semaphore to the calling thread.
+ *
+ *  Input parameters:
+ *    the_semaphore - pointer to semaphore control block
+ *    option_set    - acquire semaphore options
+ *
+ *  Output parameters:
+ *    TRUE  - if semaphore allocated
+ *    FALSE - if semaphore NOT allocated
+ *
+ *  INTERRUPT LATENCY:
+ *    available
+ *    wait
+ */
+
+boolean _Semaphore_Seize(
+  Semaphore_Control *the_semaphore,
+  rtems_option    option_set
+)
+{
+  Thread_Control *executing;
+  ISR_Level       level;
+
+  executing = _Thread_Executing;
+  executing->Wait.return_code = RTEMS_SUCCESSFUL;
+  _ISR_Disable( level );
+  if ( the_semaphore->count != 0 ) {
+    the_semaphore->count -= 1;
+    if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set ) ) {
+      the_semaphore->holder     = executing;
+      the_semaphore->holder_id  = executing->Object.id;
+      the_semaphore->nest_count = 1;
+      executing->resource_count++;
+    }
+    _ISR_Enable( level );
+    return( TRUE );
+  }
+
+  if ( _Options_Is_no_wait( option_set ) ) {
+    _ISR_Enable( level );
+    executing->Wait.return_code = RTEMS_UNSATISFIED;
+    return( TRUE );
+  }
+
+  if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set ) ) {
+    if ( _Objects_Are_ids_equal(
+            _Thread_Executing->Object.id, the_semaphore->holder_id ) ) {
+      the_semaphore->nest_count++;
+      _ISR_Enable( level );
+      return( TRUE );
+    }
+  }
+
+  the_semaphore->Wait_queue.sync = TRUE;
+  executing->Wait.queue      = &the_semaphore->Wait_queue;
+  executing->Wait.id         = the_semaphore->Object.id;
+  executing->Wait.option_set = option_set;
+  _ISR_Enable( level );
+  return( FALSE );
+}
Index: cpukit/rtems/src/semcreate.c
===================================================================
--- cpukit/rtems/src/semcreate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,293 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSemaphore
- *
- * @brief This source file contains the implementation of
- *   rtems_semaphore_create() and the Semaphore Manager system initialization.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/semimpl.h>
-#include <rtems/rtems/attrimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/tasksimpl.h>
-#include <rtems/score/schedulerimpl.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/sysinit.h>
-
-#define SEMAPHORE_KIND_MASK ( RTEMS_SEMAPHORE_CLASS | RTEMS_INHERIT_PRIORITY \
-  | RTEMS_PRIORITY_CEILING | RTEMS_MULTIPROCESSOR_RESOURCE_SHARING )
-
-rtems_status_code rtems_semaphore_create(
-  rtems_name           name,
-  uint32_t             count,
-  rtems_attribute      attribute_set,
-  rtems_task_priority  priority_ceiling,
-  rtems_id            *id
-)
-{
-  Semaphore_Control       *the_semaphore;
-  Thread_Control          *executing;
-  Status_Control           status;
-  rtems_attribute          maybe_global;
-  rtems_attribute          mutex_with_protocol;
-  Semaphore_Variant        variant;
-  const Scheduler_Control *scheduler;
-  bool                     valid;
-  Priority_Control         priority;
-  uintptr_t                flags;
-
-  if ( !rtems_is_name_valid( name ) )
-    return RTEMS_INVALID_NAME;
-
-  if ( !id )
-    return RTEMS_INVALID_ADDRESS;
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( !_System_state_Is_multiprocessing ) {
-    attribute_set = _Attributes_Clear( attribute_set, RTEMS_GLOBAL );
-  }
-#endif
-
-  /* Attribute subset defining a potentially global semaphore variant */
-  maybe_global = attribute_set & SEMAPHORE_KIND_MASK;
-
-  /* Attribute subset defining a mutex variant with a locking protocol */
-  mutex_with_protocol =
-    attribute_set & ( SEMAPHORE_KIND_MASK | RTEMS_GLOBAL | RTEMS_PRIORITY );
-
-  if ( maybe_global == RTEMS_COUNTING_SEMAPHORE ) {
-    variant = SEMAPHORE_VARIANT_COUNTING;
-  } else if ( maybe_global == RTEMS_SIMPLE_BINARY_SEMAPHORE ) {
-    variant = SEMAPHORE_VARIANT_SIMPLE_BINARY;
-  } else if ( maybe_global == RTEMS_BINARY_SEMAPHORE ) {
-    variant = SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL;
-  } else if (
-    mutex_with_protocol
-      == ( RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_INHERIT_PRIORITY )
-  ) {
-    variant = SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY;
-  } else if (
-    mutex_with_protocol
-      == ( RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_PRIORITY_CEILING )
-  ) {
-    variant = SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING;
-  } else if (
-    mutex_with_protocol == ( RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY |
-      RTEMS_MULTIPROCESSOR_RESOURCE_SHARING )
-  ) {
-#if defined(RTEMS_SMP)
-    variant = SEMAPHORE_VARIANT_MRSP;
-#else
-    /*
-     * On uni-processor configurations the Multiprocessor Resource Sharing
-     * Protocol is equivalent to the Priority Ceiling Protocol.
-     */
-    variant = SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING;
-#endif
-  } else {
-    return RTEMS_NOT_DEFINED;
-  }
-
-  if ( count > 1 && variant != SEMAPHORE_VARIANT_COUNTING ) {
-    return RTEMS_INVALID_NUMBER;
-  }
-
-  the_semaphore = _Semaphore_Allocate();
-
-  if ( !the_semaphore ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_TOO_MANY;
-  }
-
-  flags = _Semaphore_Set_variant( 0, variant );
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( _Attributes_Is_global( attribute_set ) ) {
-    bool ok;
-
-    ok = _Objects_MP_Allocate_and_open(
-      &_Semaphore_Information,
-      name,
-      the_semaphore->Object.id,
-      false
-    );
-
-    if ( !ok ) {
-      _Semaphore_Free( the_semaphore );
-      _Objects_Allocator_unlock();
-      return RTEMS_TOO_MANY;
-    }
-
-    flags = _Semaphore_Make_global( flags );
-  }
-#endif
-
-  if ( _Attributes_Is_priority( attribute_set ) ) {
-    flags = _Semaphore_Set_discipline( flags, SEMAPHORE_DISCIPLINE_PRIORITY );
-  } else {
-    flags = _Semaphore_Set_discipline( flags, SEMAPHORE_DISCIPLINE_FIFO );
-  }
-
-  _Semaphore_Set_flags( the_semaphore, flags );
-  executing = _Thread_Get_executing();
-
-  switch ( variant ) {
-    case SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL:
-    case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY:
-      _CORE_recursive_mutex_Initialize(
-        &the_semaphore->Core_control.Mutex.Recursive
-      );
-
-      if ( count == 0 ) {
-        _CORE_mutex_Set_owner(
-          &the_semaphore->Core_control.Mutex.Recursive.Mutex,
-          executing
-        );
-        _Thread_Resource_count_increment( executing );
-      }
-
-      status = STATUS_SUCCESSFUL;
-      break;
-    case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
-      scheduler = _Thread_Scheduler_get_home( executing );
-      priority = _RTEMS_Priority_To_core( scheduler, priority_ceiling, &valid );
-
-      if ( valid ) {
-        _CORE_ceiling_mutex_Initialize(
-          &the_semaphore->Core_control.Mutex,
-          scheduler,
-          priority
-        );
-
-        if ( count == 0 ) {
-          Thread_queue_Context queue_context;
-
-          _Thread_queue_Context_initialize( &queue_context );
-          _Thread_queue_Context_clear_priority_updates( &queue_context );
-          _ISR_lock_ISR_disable( &queue_context.Lock_context.Lock_context );
-          _CORE_mutex_Acquire_critical(
-            &the_semaphore->Core_control.Mutex.Recursive.Mutex,
-            &queue_context
-          );
-          status = _CORE_ceiling_mutex_Set_owner(
-            &the_semaphore->Core_control.Mutex,
-            executing,
-            &queue_context
-          );
-
-          if ( status != STATUS_SUCCESSFUL ) {
-            _Thread_queue_Destroy( &the_semaphore->Core_control.Wait_queue );
-          }
-        } else {
-          status = STATUS_SUCCESSFUL;
-        }
-      } else {
-        status = STATUS_INVALID_PRIORITY;
-      }
-
-      break;
-#if defined(RTEMS_SMP)
-    case SEMAPHORE_VARIANT_MRSP:
-      scheduler = _Thread_Scheduler_get_home( executing );
-      priority = _RTEMS_Priority_To_core( scheduler, priority_ceiling, &valid );
-
-      if ( valid ) {
-        status = _MRSP_Initialize(
-          &the_semaphore->Core_control.MRSP,
-          scheduler,
-          priority,
-          executing,
-          count == 0
-        );
-      } else {
-        status = STATUS_INVALID_PRIORITY;
-      }
-
-      break;
-#endif
-    default:
-      _Assert(
-        variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
-          || variant == SEMAPHORE_VARIANT_COUNTING
-      );
-      _CORE_semaphore_Initialize(
-        &the_semaphore->Core_control.Semaphore,
-        count
-      );
-      status = STATUS_SUCCESSFUL;
-      break;
-  }
-
-  if ( status != STATUS_SUCCESSFUL ) {
-    _Semaphore_Free( the_semaphore );
-    _Objects_Allocator_unlock();
-    return _Status_Get( status );
-  }
-
-  /*
-   *  Whether we initialized it as a mutex or counting semaphore, it is
-   *  now ready to be "offered" for use as a Classic API Semaphore.
-   */
-  *id = _Objects_Open_u32(
-    &_Semaphore_Information,
-    &the_semaphore->Object,
-    name
-  );
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( _Attributes_Is_global( attribute_set ) )
-    _Semaphore_MP_Send_process_packet(
-      SEMAPHORE_MP_ANNOUNCE_CREATE,
-      the_semaphore->Object.id,
-      name,
-      0                          /* Not used */
-    );
-#endif
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
-
-static void _Semaphore_Manager_initialization( void )
-{
-  _Objects_Initialize_information( &_Semaphore_Information );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Semaphore_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_SEMAPHORE,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/rtems/src/semdelete.c
===================================================================
--- cpukit/rtems/src/semdelete.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,158 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSemaphore
- *
- * @brief This source file contains the implementation of
- *   rtems_semaphore_delete().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/semimpl.h>
-#include <rtems/rtems/statusimpl.h>
-
-rtems_status_code rtems_semaphore_delete(
-  rtems_id   id
-)
-{
-  Semaphore_Control    *the_semaphore;
-  Thread_queue_Context  queue_context;
-  uintptr_t             flags;
-  Semaphore_Variant     variant;
-  Status_Control        status;
-
-  _Objects_Allocator_lock();
-  the_semaphore = _Semaphore_Get( id, &queue_context );
-
-  if ( the_semaphore == NULL ) {
-    _Objects_Allocator_unlock();
-
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Semaphore_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  _Thread_queue_Acquire_critical(
-    &the_semaphore->Core_control.Wait_queue,
-    &queue_context
-  );
-  flags = _Semaphore_Get_flags( the_semaphore );
-  variant = _Semaphore_Get_variant( flags );
-
-  switch ( variant ) {
-    case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY:
-    case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
-    case SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL:
-      if (
-        _CORE_mutex_Is_locked(
-          &the_semaphore->Core_control.Mutex.Recursive.Mutex
-        )
-      ) {
-        status = STATUS_RESOURCE_IN_USE;
-      } else {
-        status = STATUS_SUCCESSFUL;
-      }
-
-      break;
-#if defined(RTEMS_SMP)
-    case SEMAPHORE_VARIANT_MRSP:
-      status = _MRSP_Can_destroy( &the_semaphore->Core_control.MRSP );
-      break;
-#endif
-    default:
-      _Assert(
-        variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
-          || variant == SEMAPHORE_VARIANT_COUNTING
-      );
-      status = STATUS_SUCCESSFUL;
-      break;
-  }
-
-  if ( status != STATUS_SUCCESSFUL ) {
-    _Thread_queue_Release(
-      &the_semaphore->Core_control.Wait_queue,
-      &queue_context
-    );
-    _Objects_Allocator_unlock();
-    return _Status_Get( status );
-  }
-
-  _Objects_Close( &_Semaphore_Information, &the_semaphore->Object );
-
-  switch ( variant ) {
-#if defined(RTEMS_SMP)
-    case SEMAPHORE_VARIANT_MRSP:
-      _MRSP_Destroy( &the_semaphore->Core_control.MRSP, &queue_context );
-      break;
-#endif
-    default:
-      _Assert(
-        variant == SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY
-          || variant == SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING
-          || variant == SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL
-          || variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
-          || variant == SEMAPHORE_VARIANT_COUNTING
-      );
-      _Thread_queue_Flush_critical(
-        &the_semaphore->Core_control.Wait_queue.Queue,
-        _Semaphore_Get_operations( flags ),
-        _Thread_queue_Flush_status_object_was_deleted,
-        &queue_context
-      );
-      _Thread_queue_Destroy( &the_semaphore->Core_control.Wait_queue );
-      break;
-  }
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( _Semaphore_Is_global( flags ) ) {
-
-    _Objects_MP_Close( &_Semaphore_Information, id );
-
-    _Semaphore_MP_Send_process_packet(
-      SEMAPHORE_MP_ANNOUNCE_DELETE,
-      id,
-      0,                         /* Not used */
-      0                          /* Not used */
-    );
-  }
-#endif
-
-  _Semaphore_Free( the_semaphore );
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/semflush.c
===================================================================
--- cpukit/rtems/src/semflush.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,101 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSemaphore
- *
- * @brief This source file contains the implementation of
- *   rtems_semaphore_flush().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/semimpl.h>
-
-rtems_status_code rtems_semaphore_flush( rtems_id id )
-{
-  Semaphore_Control    *the_semaphore;
-  Thread_queue_Context  queue_context;
-  uintptr_t             flags;
-  Semaphore_Variant     variant;
-
-  the_semaphore = _Semaphore_Get( id, &queue_context );
-
-  if ( the_semaphore == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Semaphore_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  _Thread_queue_Acquire_critical(
-    &the_semaphore->Core_control.Wait_queue,
-    &queue_context
-  );
-  _Thread_queue_Context_set_MP_callout(
-    &queue_context,
-    _Semaphore_MP_Send_object_was_deleted
-  );
-  flags = _Semaphore_Get_flags( the_semaphore );
-  variant = _Semaphore_Get_variant( flags );
-
-  switch ( variant ) {
-#if defined(RTEMS_SMP)
-    case SEMAPHORE_VARIANT_MRSP:
-      _Thread_queue_Release(
-        &the_semaphore->Core_control.Wait_queue,
-        &queue_context
-      );
-      return RTEMS_NOT_DEFINED;
-#endif
-    default:
-      _Assert(
-        variant == SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY
-          || variant == SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING
-          || variant == SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL
-          || variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
-          || variant == SEMAPHORE_VARIANT_COUNTING
-      );
-      _Thread_queue_Flush_critical(
-        &the_semaphore->Core_control.Wait_queue.Queue,
-        _Semaphore_Get_operations( flags ),
-        _Thread_queue_Flush_status_unavailable,
-        &queue_context
-      );
-      break;
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/semident.c
===================================================================
--- cpukit/rtems/src/semident.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSemaphore
- *
- * @brief This source file contains the implementation of
- *   rtems_semaphore_ident().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- * 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.
- *
- * 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/semimpl.h>
-#include <rtems/rtems/objectimpl.h>
-
-rtems_status_code rtems_semaphore_ident(
-  rtems_name  name,
-  uint32_t    node,
-  rtems_id   *id
-)
-{
-  return _RTEMS_Name_to_id( name, node, id, &_Semaphore_Information );
-}
Index: cpukit/rtems/src/semmp.c
===================================================================
--- cpukit/rtems/src/semmp.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/semmp.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,67 +1,41 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSemaphoreMP
- *
- * @brief This source file contains the implementation to support the Semaphore
- *   Manager in multiprocessing (MP) configurations.
- */
-
 /*
- *  COPYRIGHT (c) 1989-2008.
+ *  Multiprocessing Support for the Semaphore Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
  *  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.
- *
- * 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/semimpl.h>
-#include <rtems/rtems/optionsimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/sysinit.h>
-
-RTEMS_STATIC_ASSERT(
-  sizeof(Semaphore_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE,
-  Semaphore_MP_Packet
-);
-
-static Semaphore_MP_Packet *_Semaphore_MP_Get_packet( void )
-{
-  return (Semaphore_MP_Packet *) _MPCI_Get_packet();
-}
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/mpci.h>
+#include <rtems/mppkt.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/sem.h>
+#include <rtems/thread.h>
+#include <rtems/watchdog.h>
+
+/*PAGE
+ *
+ *  _Semaphore_MP_Send_process_packet
+ *
+ */
 
 void _Semaphore_MP_Send_process_packet (
   Semaphore_MP_Remote_operations  operation,
   Objects_Id                      semaphore_id,
-  rtems_name                      name,
+  Objects_Name                    name,
   Objects_Id                      proxy_id
 )
 {
   Semaphore_MP_Packet *the_packet;
-  uint32_t             node;
+  unsigned32           node;
 
   switch ( operation ) {
@@ -72,5 +46,5 @@
 
       the_packet                    = _Semaphore_MP_Get_packet();
-      the_packet->Prefix.the_class  = MP_PACKET_SEMAPHORE;
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_SEMAPHORE;
       the_packet->Prefix.length     = sizeof ( Semaphore_MP_Packet );
       the_packet->Prefix.to_convert = sizeof ( Semaphore_MP_Packet );
@@ -81,5 +55,5 @@
 
       if ( operation == SEMAPHORE_MP_EXTRACT_PROXY )
-         node = _Objects_Get_node( semaphore_id );
+         node = rtems_get_node( semaphore_id );
       else
          node = MPCI_ALL_NODES;
@@ -96,17 +70,18 @@
 }
 
-static rtems_status_code _Semaphore_MP_Send_request_packet(
+/*PAGE
+ *
+ *  _Semaphore_MP_Send_request_packet
+ *
+ */
+
+rtems_status_code _Semaphore_MP_Send_request_packet (
+  Semaphore_MP_Remote_operations operation,
   Objects_Id                     semaphore_id,
-  rtems_option                   option_set,
-  rtems_interval                 timeout,
-  Semaphore_MP_Remote_operations operation
+  rtems_option                option_set,
+  rtems_interval              timeout
 )
 {
   Semaphore_MP_Packet *the_packet;
-  Status_Control       status;
-
-  if ( !_Semaphore_MP_Is_remote( semaphore_id ) ) {
-    return RTEMS_INVALID_ID;
-  }
 
   switch ( operation ) {
@@ -116,5 +91,5 @@
 
       the_packet                    = _Semaphore_MP_Get_packet();
-      the_packet->Prefix.the_class  = MP_PACKET_SEMAPHORE;
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_SEMAPHORE;
       the_packet->Prefix.length     = sizeof ( Semaphore_MP_Packet );
       the_packet->Prefix.to_convert = sizeof ( Semaphore_MP_Packet );
@@ -126,10 +101,10 @@
       the_packet->option_set        = option_set;
 
-      status = _MPCI_Send_request_packet(
-        _Objects_Get_node( semaphore_id ),
-        &the_packet->Prefix,
-        STATES_WAITING_FOR_SEMAPHORE
-      );
-      return _Status_Get( status );
+      return _MPCI_Send_request_packet(
+          rtems_get_node( semaphore_id ),
+          &the_packet->Prefix,
+          STATES_WAITING_FOR_SEMAPHORE
+        );
+      break;
 
     case SEMAPHORE_MP_ANNOUNCE_CREATE:
@@ -148,29 +123,11 @@
 }
 
-rtems_status_code _Semaphore_MP_Obtain(
-  rtems_id        id,
-  rtems_option    option_set,
-  rtems_interval  timeout
-)
-{
-  return _Semaphore_MP_Send_request_packet(
-    id,
-    option_set,
-    timeout,
-    SEMAPHORE_MP_OBTAIN_REQUEST
-  );
-}
-
-rtems_status_code _Semaphore_MP_Release( rtems_id id )
-{
-  return _Semaphore_MP_Send_request_packet(
-    id,
-    0,
-    MPCI_DEFAULT_TIMEOUT,
-    SEMAPHORE_MP_RELEASE_REQUEST
-  );
-}
-
-static void _Semaphore_MP_Send_response_packet (
+/*PAGE
+ *
+ *  _Semaphore_MP_Send_response_packet
+ *
+ */
+
+void _Semaphore_MP_Send_response_packet (
   Semaphore_MP_Remote_operations  operation,
   Objects_Id                      semaphore_id,
@@ -195,5 +152,5 @@
 
       _MPCI_Send_response_packet(
-        _Objects_Get_node( the_packet->Prefix.source_tid ),
+        rtems_get_node( the_packet->Prefix.source_tid ),
         &the_packet->Prefix
       );
@@ -210,5 +167,12 @@
 }
 
-static void _Semaphore_MP_Process_packet (
+/*PAGE
+ *
+ *
+ *  _Semaphore_MP_Process_packet
+ *
+ */
+
+void _Semaphore_MP_Process_packet (
   rtems_packet_prefix  *the_packet_prefix
 )
@@ -216,4 +180,5 @@
   Semaphore_MP_Packet *the_packet;
   Thread_Control      *the_thread;
+  boolean              ignored;
 
   the_packet = (Semaphore_MP_Packet *) the_packet_prefix;
@@ -223,10 +188,10 @@
     case SEMAPHORE_MP_ANNOUNCE_CREATE:
 
-      _Objects_MP_Allocate_and_open(
-        &_Semaphore_Information,
-        the_packet->name,
-        the_packet->Prefix.id,
-        true
-      );
+      ignored = _Objects_MP_Open(
+                  &_Semaphore_Information,
+                  the_packet->name,
+                  the_packet->Prefix.id,
+                  TRUE
+                );
 
       _MPCI_Return_packet( the_packet_prefix );
@@ -244,7 +209,6 @@
       the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
 
-      if ( the_thread != NULL ) {
-        _Thread_queue_Extract( the_thread );
-      }
+      if ( ! _Thread_Is_null( the_thread ) )
+        _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
 
       _MPCI_Return_packet( the_packet_prefix );
@@ -259,5 +223,5 @@
       );
 
-      if ( the_packet->Prefix.return_code != RTEMS_PROXY_BLOCKING )
+      if ( ! _Status_Is_proxy_blocking( the_packet->Prefix.return_code ) )
         _Semaphore_MP_Send_response_packet(
            SEMAPHORE_MP_OBTAIN_RESPONSE,
@@ -290,7 +254,12 @@
 }
 
+/*PAGE
+ *
+ *  _Semaphore_MP_Send_object_was_deleted
+ *
+ */
+
 void _Semaphore_MP_Send_object_was_deleted (
-  Thread_Control *the_proxy,
-  Objects_Id      mp_id
+  Thread_Control *the_proxy
 )
 {
@@ -299,5 +268,5 @@
   _Semaphore_MP_Send_response_packet(
     SEMAPHORE_MP_OBTAIN_RESPONSE,
-    mp_id,
+    the_proxy->Wait.id,
     the_proxy
   );
@@ -305,13 +274,18 @@
 }
 
+/*PAGE
+ *
+ *  _Semaphore_MP_Send_extract_proxy
+ *
+ */
+
 void _Semaphore_MP_Send_extract_proxy (
-  Thread_Control *the_thread,
-  Objects_Id      id
+  Thread_Control *the_thread
 )
 {
   _Semaphore_MP_Send_process_packet(
     SEMAPHORE_MP_EXTRACT_PROXY,
-    id,
-    (rtems_name) 0,
+    the_thread->Wait.id,
+    (Objects_Name) 0,
     the_thread->Object.id
   );
@@ -319,43 +293,14 @@
 }
 
-void  _Semaphore_Core_mutex_mp_support (
-  Thread_Control *the_thread,
-  Objects_Id      id
-)
-{
-  the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
-
-  _Semaphore_MP_Send_response_packet(
-     SEMAPHORE_MP_OBTAIN_RESPONSE,
-     id,
-     the_thread
-   );
-}
-
-void  _Semaphore_Core_semaphore_mp_support (
-  Thread_Control *the_thread,
-  Objects_Id      id
-)
-{
-  the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
-
-  _Semaphore_MP_Send_response_packet(
-     SEMAPHORE_MP_OBTAIN_RESPONSE,
-     id,
-     the_thread
-   );
-}
-
-static void _Semaphore_MP_Initialize( void )
-{
-  _MPCI_Register_packet_processor(
-    MP_PACKET_SEMAPHORE,
-    _Semaphore_MP_Process_packet
-  );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Semaphore_MP_Initialize,
-  RTEMS_SYSINIT_CLASSIC_SEMAPHORE_MP,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
+/*PAGE
+ *
+ *  _Semaphore_MP_Get_packet
+ *
+ */
+
+Semaphore_MP_Packet *_Semaphore_MP_Get_packet ( void )
+{
+  return ( (Semaphore_MP_Packet *) _MPCI_Get_packet() );
+}
+
+/* end of file */
Index: cpukit/rtems/src/semobtain.c
===================================================================
--- cpukit/rtems/src/semobtain.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,164 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSemaphore
- *
- * @brief This source file contains the implementation of
- *   rtems_semaphore_obtain().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/semimpl.h>
-#include <rtems/rtems/optionsimpl.h>
-#include <rtems/rtems/statusimpl.h>
-
-THREAD_QUEUE_OBJECT_ASSERT(
-  Semaphore_Control,
-  Core_control.Wait_queue,
-  SEMAPHORE_CONTROL_GENERIC
-);
-
-THREAD_QUEUE_OBJECT_ASSERT(
-  Semaphore_Control,
-  Core_control.Mutex.Recursive.Mutex.Wait_queue,
-  SEMAPHORE_CONTROL_MUTEX
-);
-
-THREAD_QUEUE_OBJECT_ASSERT(
-  Semaphore_Control,
-  Core_control.Semaphore.Wait_queue,
-  SEMAPHORE_CONTROL_SEMAPHORE
-);
-
-#if defined(RTEMS_SMP)
-THREAD_QUEUE_OBJECT_ASSERT(
-  Semaphore_Control,
-  Core_control.MRSP.Wait_queue,
-  SEMAPHORE_CONTROL_MRSP
-);
-#endif
-
-rtems_status_code rtems_semaphore_obtain(
-  rtems_id        id,
-  rtems_option    option_set,
-  rtems_interval  timeout
-)
-{
-  Semaphore_Control    *the_semaphore;
-  Thread_queue_Context  queue_context;
-  Thread_Control       *executing;
-  bool                  wait;
-  uintptr_t             flags;
-  Semaphore_Variant     variant;
-  Status_Control        status;
-
-  the_semaphore = _Semaphore_Get( id, &queue_context );
-
-  if ( the_semaphore == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Semaphore_MP_Obtain( id, option_set, timeout );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  executing = _Thread_Executing;
-  wait = !_Options_Is_no_wait( option_set );
-
-  if ( wait ) {
-    _Thread_queue_Context_set_enqueue_timeout_ticks( &queue_context, timeout );
-  } else {
-    _Thread_queue_Context_set_enqueue_do_nothing_extra( &queue_context );
-  }
-
-  flags = _Semaphore_Get_flags( the_semaphore );
-  variant = _Semaphore_Get_variant( flags );
-
-  switch ( variant ) {
-    case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY:
-      status = _CORE_recursive_mutex_Seize(
-        &the_semaphore->Core_control.Mutex.Recursive,
-        CORE_MUTEX_TQ_PRIORITY_INHERIT_OPERATIONS,
-        executing,
-        wait,
-        _CORE_recursive_mutex_Seize_nested,
-        &queue_context
-      );
-      break;
-    case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
-      status = _CORE_ceiling_mutex_Seize(
-        &the_semaphore->Core_control.Mutex,
-        executing,
-        wait,
-        _CORE_recursive_mutex_Seize_nested,
-        &queue_context
-      );
-      break;
-    case SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL:
-      status = _CORE_recursive_mutex_Seize(
-        &the_semaphore->Core_control.Mutex.Recursive,
-        _Semaphore_Get_operations( flags ),
-        executing,
-        wait,
-        _CORE_recursive_mutex_Seize_nested,
-        &queue_context
-      );
-      break;
-#if defined(RTEMS_SMP)
-    case SEMAPHORE_VARIANT_MRSP:
-      status = _MRSP_Seize(
-        &the_semaphore->Core_control.MRSP,
-        executing,
-        wait,
-        &queue_context
-      );
-      break;
-#endif
-    default:
-      _Assert(
-        variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
-          || variant == SEMAPHORE_VARIANT_COUNTING
-      );
-      status = _CORE_semaphore_Seize(
-        &the_semaphore->Core_control.Semaphore,
-        _Semaphore_Get_operations( flags ),
-        executing,
-        wait,
-        &queue_context
-      );
-      break;
-  }
-
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/semrelease.c
===================================================================
--- cpukit/rtems/src/semrelease.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,132 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSemaphore
- *
- * @brief This source file contains the implementation of
- *   rtems_semaphore_release().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/semimpl.h>
-#include <rtems/rtems/statusimpl.h>
-
-rtems_status_code rtems_semaphore_release( rtems_id id )
-{
-  Semaphore_Control    *the_semaphore;
-  Thread_queue_Context  queue_context;
-  Thread_Control       *executing;
-  uintptr_t             flags;
-  Semaphore_Variant     variant;
-  Status_Control        status;
-
-  the_semaphore = _Semaphore_Get( id, &queue_context );
-
-  if ( the_semaphore == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Semaphore_MP_Release( id );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  executing = _Thread_Executing;
-
-  _Thread_queue_Context_set_MP_callout(
-    &queue_context,
-    _Semaphore_Core_mutex_mp_support
-  );
-  flags = _Semaphore_Get_flags( the_semaphore );
-  variant = _Semaphore_Get_variant( flags );
-
-  switch ( variant ) {
-    case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY:
-      status = _CORE_recursive_mutex_Surrender(
-        &the_semaphore->Core_control.Mutex.Recursive,
-        CORE_MUTEX_TQ_PRIORITY_INHERIT_OPERATIONS,
-        executing,
-        &queue_context
-      );
-      break;
-    case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
-      status = _CORE_ceiling_mutex_Surrender(
-        &the_semaphore->Core_control.Mutex,
-        executing,
-        &queue_context
-      );
-      break;
-    case SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL:
-      status = _CORE_recursive_mutex_Surrender(
-        &the_semaphore->Core_control.Mutex.Recursive,
-        _Semaphore_Get_operations( flags ),
-        executing,
-        &queue_context
-      );
-      break;
-    case SEMAPHORE_VARIANT_SIMPLE_BINARY:
-      status = _CORE_semaphore_Surrender(
-        &the_semaphore->Core_control.Semaphore,
-        _Semaphore_Get_operations( flags ),
-        1,
-        &queue_context
-      );
-      _Assert(
-        status == STATUS_SUCCESSFUL
-          || status == STATUS_MAXIMUM_COUNT_EXCEEDED
-      );
-      (void) status;
-      status = STATUS_SUCCESSFUL;
-      break;
-#if defined(RTEMS_SMP)
-    case SEMAPHORE_VARIANT_MRSP:
-      status = _MRSP_Surrender(
-        &the_semaphore->Core_control.MRSP,
-        executing,
-        &queue_context
-      );
-      break;
-#endif
-    default:
-      _Assert( variant == SEMAPHORE_VARIANT_COUNTING );
-      status = _CORE_semaphore_Surrender(
-        &the_semaphore->Core_control.Semaphore,
-        _Semaphore_Get_operations( flags ),
-        UINT32_MAX,
-        &queue_context
-      );
-      break;
-  }
-
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/semsetpriority.c
===================================================================
--- cpukit/rtems/src/semsetpriority.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,184 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSemaphore
- *
- * @brief This source file contains the implementation of
- *   rtems_semaphore_set_priority().
- */
-
-/*
- * Copyright (c) 2014 embedded brains GmbH & Co. KG
- *
- * 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/semimpl.h>
-#include <rtems/rtems/tasksimpl.h>
-#include <rtems/score/schedulerimpl.h>
-
-static rtems_status_code _Semaphore_Set_priority(
-  Semaphore_Control       *the_semaphore,
-  const Scheduler_Control *scheduler,
-  rtems_task_priority      new_priority,
-  rtems_task_priority     *old_priority_p,
-  Thread_queue_Context    *queue_context
-)
-{
-  bool               valid;
-  Priority_Control   core_priority;
-  Priority_Control   old_priority;
-  Per_CPU_Control   *cpu_self;
-  Semaphore_Variant  variant;
-
-  core_priority = _RTEMS_Priority_To_core( scheduler, new_priority, &valid );
-  if ( new_priority != RTEMS_CURRENT_PRIORITY && !valid ) {
-    _ISR_lock_ISR_enable( &queue_context->Lock_context.Lock_context );
-    return RTEMS_INVALID_PRIORITY;
-  }
-
-  _Thread_queue_Context_clear_priority_updates( queue_context );
-  _Thread_queue_Acquire_critical(
-    &the_semaphore->Core_control.Wait_queue,
-    queue_context
-  );
-  variant = _Semaphore_Get_variant( _Semaphore_Get_flags( the_semaphore ) );
-
-  switch ( variant ) {
-    case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
-#if defined(RTEMS_SMP)
-      if (
-        scheduler != _CORE_ceiling_mutex_Get_scheduler(
-          &the_semaphore->Core_control.Mutex
-        )
-      ) {
-        _Thread_queue_Release(
-          &the_semaphore->Core_control.Wait_queue,
-          queue_context
-        );
-
-        return RTEMS_NOT_DEFINED;
-      }
-#endif
-
-      old_priority = _CORE_ceiling_mutex_Get_priority(
-        &the_semaphore->Core_control.Mutex
-      );
-
-      if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
-        _CORE_ceiling_mutex_Set_priority(
-          &the_semaphore->Core_control.Mutex,
-          core_priority
-        );
-      }
-
-      break;
-#if defined(RTEMS_SMP)
-    case SEMAPHORE_VARIANT_MRSP:
-      old_priority = _MRSP_Get_priority(
-        &the_semaphore->Core_control.MRSP,
-        scheduler
-      );
-
-      if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
-        _MRSP_Set_priority(
-          &the_semaphore->Core_control.MRSP,
-          scheduler,
-          core_priority
-        );
-      }
-
-      break;
-#endif
-    default:
-      _Assert(
-        variant == SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY
-          || variant == SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL
-          || variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
-          || variant == SEMAPHORE_VARIANT_COUNTING
-      );
-      _Thread_queue_Release(
-        &the_semaphore->Core_control.Wait_queue,
-        queue_context
-      );
-
-      return RTEMS_NOT_DEFINED;
-  }
-
-  cpu_self = _Thread_queue_Dispatch_disable( queue_context );
-  _Thread_queue_Release(
-    &the_semaphore->Core_control.Wait_queue,
-    queue_context
-  );
-  _Thread_Priority_update( queue_context );
-  _Thread_Dispatch_enable( cpu_self );
-
-  *old_priority_p = _RTEMS_Priority_From_core( scheduler, old_priority );
-  return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code rtems_semaphore_set_priority(
-  rtems_id             semaphore_id,
-  rtems_id             scheduler_id,
-  rtems_task_priority  new_priority,
-  rtems_task_priority *old_priority
-)
-{
-  const Scheduler_Control *scheduler;
-  Semaphore_Control       *the_semaphore;
-  Thread_queue_Context     queue_context;
-
-  if ( old_priority == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  scheduler = _Scheduler_Get_by_id( scheduler_id );
-  if ( scheduler == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  the_semaphore = _Semaphore_Get( semaphore_id, &queue_context );
-
-  if ( the_semaphore == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Semaphore_MP_Is_remote( semaphore_id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  return _Semaphore_Set_priority(
-    the_semaphore,
-    scheduler,
-    new_priority,
-    old_priority,
-    &queue_context
-  );
-}
Index: cpukit/rtems/src/signal.c
===================================================================
--- cpukit/rtems/src/signal.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ cpukit/rtems/src/signal.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,110 @@
+/*
+ *  Signal Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/asr.h>
+#include <rtems/isr.h>
+#include <rtems/modes.h>
+#include <rtems/signal.h>
+#include <rtems/thread.h>
+
+/*PAGE
+ *
+ *  rtems_signal_catch
+ *
+ *  This directive allows a thread to specify what action to take when
+ *  catching signals.
+ *
+ *  Input parameters:
+ *    handler  - address of asynchronous signal routine (asr)
+ *              ( NULL indicates asr is invalid )
+ *    mode_set - mode value for asr
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - always succeeds
+ */
+
+rtems_status_code rtems_signal_catch(
+  rtems_asr_entry   handler,
+  rtems_mode mode_set
+)
+{
+  Thread_Control *executing;
+
+  executing = _Thread_Executing;
+  _Thread_Disable_dispatch(); /* cannot reschedule while */
+                              /*   the thread is inconsistent */
+
+  if ( ! _ASR_Is_null_handler( handler ) ) {
+    executing->Signal.mode_set = mode_set;
+    executing->Signal.handler  = handler;
+  }
+  else
+    _ASR_Initialize( &executing->Signal );
+  _Thread_Enable_dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_signal_send
+ *
+ *  This directive allows a thread to send signals to a thread.
+ *
+ *  Input parameters:
+ *    id         - thread id
+ *    signal_set - signal set
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code - if unsuccessful
+ */
+
+rtems_status_code rtems_signal_send(
+  Objects_Id             id,
+  rtems_signal_set signal_set
+)
+{
+  register Thread_Control *the_thread;
+  Objects_Locations        location;
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      return _Signal_MP_Send_request_packet(
+        SIGNAL_MP_SEND_REQUEST,
+        id,
+        signal_set
+      );
+    case OBJECTS_LOCAL:
+      if ( ! _ASR_Is_null_handler( the_thread->Signal.handler ) ) {
+        if ( _Modes_Is_asr_disabled( the_thread->current_modes ) )
+          _ASR_Post_signals( signal_set, &the_thread->Signal.signals_pending );
+        else {
+          _ASR_Post_signals( signal_set, &the_thread->Signal.signals_posted );
+          if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
+            _ISR_Signals_to_thread_executing = TRUE;
+        }
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_NOT_DEFINED );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
Index: cpukit/rtems/src/signalcatch.c
===================================================================
--- cpukit/rtems/src/signalcatch.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,118 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSignal
- *
- * @brief This source file contains the implementation of
- *   rtems_signal_catch() and the Signal Manager multiprocessing (MP) support
- *   system initialization.
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  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.
- *
- * 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/signalimpl.h>
-#include <rtems/rtems/modesimpl.h>
-#include <rtems/rtems/tasksdata.h>
-#include <rtems/score/threadimpl.h>
-
-RTEMS_STATIC_ASSERT( RTEMS_DEFAULT_MODES == 0, _ASR_Create_mode_set );
-
-rtems_status_code rtems_signal_catch(
-  rtems_asr_entry   asr_handler,
-  rtems_mode        mode_set
-)
-{
-  Thread_Control     *executing;
-  RTEMS_API_Control  *api;
-  ASR_Information    *asr;
-  ISR_lock_Context    lock_context;
-
-#if defined(RTEMS_SMP) || CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE
-  if (
-    asr_handler != NULL &&
-    !_Modes_Is_interrupt_level_supported( mode_set )
-  ) {
-    return RTEMS_NOT_IMPLEMENTED;
-  }
-#endif
-
-  executing = _Thread_State_acquire_for_executing( &lock_context );
-
-#if defined(RTEMS_SMP)
-  if (
-    asr_handler != NULL &&
-    !_Modes_Is_preempt_mode_supported( mode_set, executing )
-  ) {
-    _Thread_State_release( executing, &lock_context );
-    return RTEMS_NOT_IMPLEMENTED;
-  }
-#endif
-
-  api = executing->API_Extensions[ THREAD_API_RTEMS ];
-  asr = &api->Signal;
-  asr->handler = asr_handler;
-  asr->mode_set = mode_set;
-
-#if defined(RTEMS_SMP)
-  if ( asr_handler == NULL ) {
-    Chain_Node *node;
-
-    /*
-     * In SMP configurations, signals may be sent on other processors
-     * (interrupts or threads) in parallel.  This will cause an inter-processor
-     * interrupt which may be blocked by the above interrupt disable.
-     */
-
-    node = &api->Signal_action.Node;
-    _Assert( asr->signals_pending == 0 || !_Chain_Is_node_off_chain( node ) );
-    _Assert( asr->signals_pending != 0 || _Chain_Is_node_off_chain( node ) );
-
-    if ( !_Chain_Is_node_off_chain( node ) ) {
-      asr->signals_pending = 0;
-      _Chain_Extract_unprotected( node );
-      _Chain_Set_off_chain( node );
-    }
-  }
-#else
-  /*
-   * In uniprocessor configurations, as soon as interrupts are disabled above
-   * nobody can send signals to the executing thread.  So, pending signals at
-   * this point cannot appear.
-   */
-  _Assert( asr->signals_pending == 0 );
-  _Assert( _Chain_Is_node_off_chain( &api->Signal_action.Node ) );
-#endif
-
-  _Thread_State_release( executing, &lock_context );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/signalmp.c
===================================================================
--- cpukit/rtems/src/signalmp.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/signalmp.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,84 +1,29 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
+/*
+ *  Multiprocessing Support for the Signal Manager
  *
- * @ingroup RTEMSImplClassicSignalMP
  *
- * @brief This source file contains the implementation to support the Signal
- *   Manager in multiprocessing (MP) configurations.
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
  */
 
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
+#include <rtems/system.h>
+#include <rtems/mpci.h>
+#include <rtems/mppkt.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/signal.h>
+#include <rtems/states.h>
+#include <rtems/thread.h>
+#include <rtems/watchdog.h>
+
+/*PAGE
  *
- * 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/signalimpl.h>
-#include <rtems/rtems/optionsimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/statesimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/threadqimpl.h>
-
-/**
- *  The following enumerated type defines the list of
- *  remote signal operations.
- */
-typedef enum {
-  SIGNAL_MP_SEND_REQUEST  = 0,
-  SIGNAL_MP_SEND_RESPONSE = 1
-}   Signal_MP_Remote_operations;
-
-/**
- *  The following data structure defines the packet used to perform
- *  remote signal operations.
- */
-typedef struct {
-  rtems_packet_prefix          Prefix;
-  Signal_MP_Remote_operations  operation;
-  rtems_signal_set             signal_set;
-}   Signal_MP_Packet;
-
-RTEMS_STATIC_ASSERT(
-  sizeof(Signal_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE,
-  Signal_MP_Packet
-);
-
-static Signal_MP_Packet *_Signal_MP_Get_packet( Objects_Id id )
-{
-  if ( !_Thread_MP_Is_remote( id ) ) {
-    return NULL;
-  }
-
-  return (Signal_MP_Packet *) _MPCI_Get_packet();
-}
-
-/*
  *  _Signal_MP_Send_process_packet
  *
@@ -88,33 +33,55 @@
  */
 
-rtems_status_code _Signal_MP_Send(
-  rtems_id         id,
-  rtems_signal_set signal_set
+/*PAGE
+ *
+ *  _Signal_MP_Send_request_packet
+ *
+ */
+
+rtems_status_code _Signal_MP_Send_request_packet (
+  Signal_MP_Remote_operations operation,
+  Objects_Id                  task_id,
+  rtems_signal_set      signal_in
 )
 {
   Signal_MP_Packet *the_packet;
-  Status_Control    status;
 
-  the_packet = _Signal_MP_Get_packet( id );
-  if ( the_packet == NULL ) {
-    return RTEMS_INVALID_ID;
+  switch ( operation ) {
+
+    case SIGNAL_MP_SEND_REQUEST:
+
+      the_packet                    = _Signal_MP_Get_packet();
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_SIGNAL;
+      the_packet->Prefix.length     = sizeof ( Signal_MP_Packet );
+      the_packet->Prefix.to_convert = sizeof ( Signal_MP_Packet );
+      the_packet->operation         = operation;
+      the_packet->Prefix.id         = task_id;
+      the_packet->signal_in         = signal_in;
+
+      return _MPCI_Send_request_packet(
+        rtems_get_node( task_id ),
+        &the_packet->Prefix,
+        STATES_READY   /* Not used */
+      );
+      break;
+
+    case SIGNAL_MP_SEND_RESPONSE:
+      break;
+
   }
-
-  the_packet->Prefix.the_class  = MP_PACKET_SIGNAL;
-  the_packet->Prefix.length     = sizeof( *the_packet );
-  the_packet->Prefix.to_convert = sizeof( *the_packet );
-  the_packet->operation         = SIGNAL_MP_SEND_REQUEST;
-  the_packet->Prefix.id         = id;
-  the_packet->signal_set        = signal_set;
-
-  status = _MPCI_Send_request_packet(
-    _Objects_Get_node( id ),
-    &the_packet->Prefix,
-    STATES_READY
-  );
-  return _Status_Get( status );
+  /*
+   *  The following line is included to satisfy compilers which
+   *  produce warnings when a function does not end with a return.
+   */
+  return RTEMS_INTERNAL_ERROR;
 }
 
-static void _Signal_MP_Send_response_packet (
+/*PAGE
+ *
+ *  _Signal_MP_Send_response_packet
+ *
+ */
+
+void _Signal_MP_Send_response_packet (
   Signal_MP_Remote_operations  operation,
   Thread_Control              *the_thread
@@ -137,5 +104,5 @@
 
       _MPCI_Send_response_packet(
-        _Objects_Get_node( the_packet->Prefix.source_tid ),
+        rtems_get_node( the_packet->Prefix.source_tid ),
         &the_packet->Prefix
       );
@@ -148,4 +115,11 @@
 }
 
+/*PAGE
+ *
+ *
+ *  _Signal_MP_Process_packet
+ *
+ */
+
 void _Signal_MP_Process_packet (
   rtems_packet_prefix  *the_packet_prefix
@@ -153,4 +127,5 @@
 {
   Signal_MP_Packet *the_packet;
+  Thread_Control   *the_thread;
 
   the_packet = (Signal_MP_Packet *) the_packet_prefix;
@@ -162,5 +137,5 @@
       the_packet->Prefix.return_code = rtems_signal_send(
         the_packet->Prefix.id,
-        the_packet->signal_set
+        the_packet->signal_in
       );
 
@@ -173,5 +148,6 @@
     case SIGNAL_MP_SEND_RESPONSE:
 
-      _MPCI_Process_response( the_packet_prefix );
+      the_thread = _MPCI_Process_response( the_packet_prefix );
+
       _MPCI_Return_packet( the_packet_prefix );
       break;
@@ -180,5 +156,6 @@
 }
 
-/*
+/*PAGE
+ *
  *  _Signal_MP_Send_object_was_deleted
  *
@@ -188,5 +165,6 @@
  */
 
-/*
+/*PAGE
+ *
  *  _Signal_MP_Send_extract_proxy
  *
@@ -196,3 +174,14 @@
  */
 
+/*PAGE
+ *
+ *  _Signal_MP_Get_packet
+ *
+ */
+
+Signal_MP_Packet *_Signal_MP_Get_packet ( void )
+{
+  return ( (Signal_MP_Packet *) _MPCI_Get_packet() );
+}
+
 /* end of file */
Index: cpukit/rtems/src/signalsend.c
===================================================================
--- cpukit/rtems/src/signalsend.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,227 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicSignal
- *
- * @brief This source file contains the implementation of
- *   rtems_signal_send().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/signalimpl.h>
-#include <rtems/rtems/modesimpl.h>
-#include <rtems/rtems/tasksdata.h>
-#include <rtems/score/schedulerimpl.h>
-#include <rtems/score/threaddispatch.h>
-#include <rtems/score/threadimpl.h>
-
-#include <rtems/sysinit.h>
-
-static void _Signal_Action_handler(
-  Thread_Control   *executing,
-  Thread_Action    *action,
-  ISR_lock_Context *lock_context
-)
-{
-  RTEMS_API_Control        *api;
-  ASR_Information          *asr;
-  rtems_signal_set          signal_set;
-  bool                      normal_is_preemptible;
-  Thread_CPU_budget_control normal_cpu_budget;
-  uint32_t                  normal_isr_level;
-  uint32_t                  before_call_isr_level;
-  bool                      after_call_is_preemptible;
-  bool                      after_call_asr_is_enabled;
-
-  (void) action;
-
-  /*
-   * For the variable names the following notation is used.  The prefix
-   * "normal" specifies the mode associated with the normal task execution.
-   * The prefix "before_call" specifies the mode set up right before the ASR
-   * handler is called.  The prefix "after_call" specifies the mode after the
-   * ASR handler call returned.  This mode may differ from the "before_call"
-   * mode since an ASR handler is free to change the task mode.
-   */
-
-  api = executing->API_Extensions[ THREAD_API_RTEMS ];
-  asr = &api->Signal;
-
-  /* Get and clear the pending signals */
-  signal_set = asr->signals_pending;
-  _Assert( signal_set != 0 );
-  asr->signals_pending = 0;
-
-  /* Save normal mode */
-
-  _Assert( asr->is_enabled );
-  normal_is_preemptible = executing->is_preemptible;
-  normal_cpu_budget = executing->CPU_budget;
-
-  /* Set mode for ASR processing */
-
-  executing->is_preemptible = _Modes_Is_preempt( asr->mode_set );
-  asr->is_enabled = !_Modes_Is_asr_disabled( asr->mode_set );
-  _Modes_Apply_timeslice_to_thread( asr->mode_set, executing );
-  before_call_isr_level = _Modes_Get_interrupt_level( asr->mode_set );
-
-  if ( executing->is_preemptible && !normal_is_preemptible ) {
-    Per_CPU_Control *cpu_self;
-
-    cpu_self = _Thread_Dispatch_disable_critical( lock_context );
-    _Scheduler_Schedule( executing );
-    _Thread_State_release( executing, lock_context );
-    _Thread_Dispatch_direct( cpu_self );
-  } else {
-    _Thread_State_release( executing, lock_context );
-  }
-
-  normal_isr_level = _ISR_Get_level();
-  _ISR_Set_level( before_call_isr_level );
-
-  /* Call the ASR handler in the ASR processing mode */
-  ( *asr->handler )( signal_set );
-
-  /* Restore normal mode */
-
-  _ISR_Set_level( normal_isr_level );
-
-  _Thread_State_acquire( executing, lock_context );
-
-  executing->CPU_budget = normal_cpu_budget;
-  after_call_is_preemptible = executing->is_preemptible;
-  executing->is_preemptible = normal_is_preemptible;
-
-  /*
-   * We do the best to avoid recursion in the ASR processing.  A well behaved
-   * application will disable ASR processing during ASR processing.  In this
-   * case, ASR processing is currently disabled.  We do now the thread dispatch
-   * necessary due to a re-enabled preemption mode.  This helps to avoid doing
-   * the next round of ASR processing recursively in _Thread_Dispatch_direct().
-   */
-  if ( normal_is_preemptible && !after_call_is_preemptible ) {
-    Per_CPU_Control *cpu_self;
-
-    cpu_self = _Thread_Dispatch_disable_critical( lock_context );
-    _Scheduler_Schedule( executing );
-    _Thread_State_release( executing, lock_context );
-    _Thread_Dispatch_direct( cpu_self );
-    _Thread_State_acquire( executing, lock_context );
-  }
-
-  /*
-   * Restore the normal ASR processing mode.  If we enable ASR processing and
-   * there are pending signals, then add us as a post-switch action.  The loop
-   * in _Thread_Run_post_switch_actions() will continue after our return and
-   * call us again.  This avoids a recursion.
-   */
-
-  after_call_asr_is_enabled = asr->is_enabled;
-  asr->is_enabled = true;
-
-  if ( !after_call_asr_is_enabled && asr->signals_pending != 0 ) {
-    _Thread_Append_post_switch_action( executing, action );
-  }
-}
-
-rtems_status_code rtems_signal_send(
-  rtems_id          id,
-  rtems_signal_set  signal_set
-)
-{
-  Thread_Control    *the_thread;
-  ISR_lock_Context   lock_context;
-  RTEMS_API_Control *api;
-  ASR_Information   *asr;
-
-  if ( signal_set == 0 ) {
-    return RTEMS_INVALID_NUMBER;
-  }
-
-  the_thread = _Thread_Get( id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _Signal_MP_Send( id, signal_set );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
-  asr = &api->Signal;
-
-  _Thread_State_acquire_critical( the_thread, &lock_context );
-
-  if ( asr->handler == NULL ) {
-    _Thread_State_release( the_thread, &lock_context );
-    return RTEMS_NOT_DEFINED;
-  }
-
-  /* Make the signals of the set pending */
-  asr->signals_pending |= signal_set;
-
-  if ( asr->is_enabled ) {
-    Per_CPU_Control *cpu_self;
-
-    _Thread_Add_post_switch_action(
-      the_thread,
-      &api->Signal_action,
-      _Signal_Action_handler
-    );
-    cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
-    _Thread_State_release( the_thread, &lock_context );
-    _Thread_Dispatch_enable( cpu_self );
-  } else {
-    _Thread_State_release( the_thread, &lock_context );
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
-
-#if defined(RTEMS_MULTIPROCESSING)
-static void _Signal_MP_Initialize( void )
-{
-  _MPCI_Register_packet_processor(
-    MP_PACKET_SIGNAL,
-    _Signal_MP_Process_packet
-  );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Signal_MP_Initialize,
-  RTEMS_SYSINIT_CLASSIC_SIGNAL_MP,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
-#endif
Index: cpukit/rtems/src/statustext.c
===================================================================
--- cpukit/rtems/src/statustext.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassic
- *
- * @brief This source file contains the implementation of
- *   rtems_status_text().
- */
-
-/*
- * Copyright (c) 2014 embedded brains GmbH & Co. KG
- *
- * 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.h>
-
-static const char *const status_code_text[] = {
-  "RTEMS_SUCCESSFUL",
-  "RTEMS_TASK_EXITTED",
-  "RTEMS_MP_NOT_CONFIGURED",
-  "RTEMS_INVALID_NAME",
-  "RTEMS_INVALID_ID",
-  "RTEMS_TOO_MANY",
-  "RTEMS_TIMEOUT",
-  "RTEMS_OBJECT_WAS_DELETED",
-  "RTEMS_INVALID_SIZE",
-  "RTEMS_INVALID_ADDRESS",
-  "RTEMS_INVALID_NUMBER",
-  "RTEMS_NOT_DEFINED",
-  "RTEMS_RESOURCE_IN_USE",
-  "RTEMS_UNSATISFIED",
-  "RTEMS_INCORRECT_STATE",
-  "RTEMS_ALREADY_SUSPENDED",
-  "RTEMS_ILLEGAL_ON_SELF",
-  "RTEMS_ILLEGAL_ON_REMOTE_OBJECT",
-  "RTEMS_CALLED_FROM_ISR",
-  "RTEMS_INVALID_PRIORITY",
-  "RTEMS_INVALID_CLOCK",
-  "RTEMS_INVALID_NODE",
-  "RTEMS_NOT_CONFIGURED",
-  "RTEMS_NOT_OWNER_OF_RESOURCE",
-  "RTEMS_NOT_IMPLEMENTED",
-  "RTEMS_INTERNAL_ERROR",
-  "RTEMS_NO_MEMORY",
-  "RTEMS_IO_ERROR",
-  "RTEMS_INTERRUPTED",
-  "RTEMS_PROXY_BLOCKING"
-};
-
-const char *rtems_status_text( rtems_status_code code )
-{
-  size_t i = code;
-  const char *text = "?";
-
-  if ( i < RTEMS_ARRAY_SIZE( status_code_text ) ) {
-    text = status_code_text [i];
-  }
-
-  return text;
-}
Index: cpukit/rtems/src/statustoerrno.c
===================================================================
--- cpukit/rtems/src/statustoerrno.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,88 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassic
- *
- * @brief This source file contains the implementation of
- *   rtems_status_code_to_errno().
- */
-
-/*  COPYRIGHT (c) 1989-2013.
- *  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.
- *
- * 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.
- */
-
-#include <rtems/rtems/statusimpl.h>
-#include <errno.h>
-
-static const int status_code_to_errno [RTEMS_STATUS_CODES_LAST + 1] = {
-  [RTEMS_SUCCESSFUL]               = 0,
-  [RTEMS_TASK_EXITTED]             = EIO,
-  [RTEMS_MP_NOT_CONFIGURED]        = EIO,
-  [RTEMS_INVALID_NAME]             = EINVAL,
-  [RTEMS_INVALID_ID]               = EIO,
-  [RTEMS_TOO_MANY]                 = EIO,
-  [RTEMS_TIMEOUT]                  = ETIMEDOUT,
-  [RTEMS_OBJECT_WAS_DELETED]       = EIO,
-  [RTEMS_INVALID_SIZE]             = EIO,
-  [RTEMS_INVALID_ADDRESS]          = EIO,
-  [RTEMS_INVALID_NUMBER]           = EBADF,
-  [RTEMS_NOT_DEFINED]              = EIO,
-  [RTEMS_RESOURCE_IN_USE]          = EBUSY,
-  [RTEMS_UNSATISFIED]              = ENODEV,
-  [RTEMS_INCORRECT_STATE]          = EIO,
-  [RTEMS_ALREADY_SUSPENDED]        = EIO,
-  [RTEMS_ILLEGAL_ON_SELF]          = EIO,
-  [RTEMS_ILLEGAL_ON_REMOTE_OBJECT] = EIO,
-  [RTEMS_CALLED_FROM_ISR]          = EIO,
-  [RTEMS_INVALID_PRIORITY]         = EIO,
-  [RTEMS_INVALID_CLOCK]            = EINVAL,
-  [RTEMS_INVALID_NODE]             = EINVAL,
-  [RTEMS_NOT_CONFIGURED]           = ENOSYS,
-  [RTEMS_NOT_OWNER_OF_RESOURCE]    = EPERM,
-  [RTEMS_NOT_IMPLEMENTED]          = ENOSYS,
-  [RTEMS_INTERNAL_ERROR]           = EIO,
-  [RTEMS_NO_MEMORY]                = ENOMEM,
-  [RTEMS_IO_ERROR]                 = EIO,
-  [RTEMS_INTERRUPTED]              = EINTR,
-  [RTEMS_PROXY_BLOCKING]           = EIO
-};
-
-int rtems_status_code_to_errno(rtems_status_code sc)
-{
-  if (sc == RTEMS_SUCCESSFUL) {
-    return 0;
-  } else {
-    int eno = EINVAL;
-
-    if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
-      eno = status_code_to_errno [sc];
-    }
-
-    errno = eno;
-
-    return -1;
-  }
-}
Index: cpukit/rtems/src/systemeventreceive.c
===================================================================
--- cpukit/rtems/src/systemeventreceive.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,87 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicEvent
- *
- * @brief This source file contains the implementation of
- *   rtems_event_system_receive().
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * 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/eventimpl.h>
-#include <rtems/rtems/tasksdata.h>
-#include <rtems/score/statesimpl.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_event_system_receive(
-  rtems_event_set  event_in,
-  rtems_option     option_set,
-  rtems_interval   ticks,
-  rtems_event_set *event_out
-)
-{
-  rtems_status_code sc;
-
-  if ( event_out != NULL ) {
-    ISR_lock_Context   lock_context;
-    Thread_Control    *executing;
-    RTEMS_API_Control *api;
-    Event_Control     *event;
-
-    executing = _Thread_Wait_acquire_default_for_executing( &lock_context );
-    api = executing->API_Extensions[ THREAD_API_RTEMS ];
-    event = &api->System_event;
-
-    if ( !_Event_sets_Is_empty( event_in ) ) {
-      sc = _Event_Seize(
-        event_in,
-        option_set,
-        ticks,
-        event_out,
-        executing,
-        event,
-        THREAD_WAIT_CLASS_SYSTEM_EVENT,
-        STATES_WAITING_FOR_SYSTEM_EVENT,
-        &lock_context
-      );
-    } else {
-      *event_out = event->pending_events;
-      _Thread_Wait_release_default( executing, &lock_context );
-      sc = RTEMS_SUCCESSFUL;
-    }
-  } else {
-    sc = RTEMS_INVALID_ADDRESS;
-  }
-
-  return sc;
-}
Index: cpukit/rtems/src/systemeventsend.c
===================================================================
--- cpukit/rtems/src/systemeventsend.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,74 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicEvent
- *
- * @brief This source file contains the implementation of
- *   rtems_event_system_send().
- */
-
-/*
- * Copyright (C) 2012, 2016 embedded brains GmbH & Co. KG
- *
- * 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/eventimpl.h>
-#include <rtems/rtems/tasksdata.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_event_system_send(
-  rtems_id        id,
-  rtems_event_set event_in
-)
-{
-  Thread_Control    *the_thread;
-  RTEMS_API_Control *api;
-  ISR_lock_Context   lock_context;
-
-  the_thread = _Thread_Get( id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Thread_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
-  return _Event_Surrender(
-    the_thread,
-    event_in,
-    &api->System_event,
-    THREAD_WAIT_CLASS_SYSTEM_EVENT,
-    &lock_context
-  );
-}
Index: cpukit/rtems/src/taskconstruct.c
===================================================================
--- cpukit/rtems/src/taskconstruct.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,354 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_construct() and the Task Manager system initialization.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014,2016.
- *  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.
- *
- * 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/tasksimpl.h>
-#include <rtems/rtems/attrimpl.h>
-#include <rtems/rtems/eventimpl.h>
-#include <rtems/rtems/modesimpl.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/apimutex.h>
-#include <rtems/score/schedulerimpl.h>
-#include <rtems/score/stackimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/userextimpl.h>
-#include <rtems/sysinit.h>
-
-#include <string.h>
-
-#define STATUS_ASSERT( status ) \
-  RTEMS_STATIC_ASSERT( \
-    (int) STATUS_CLASSIC_##status == (int) RTEMS_##status, \
-    status \
-  )
-
-STATUS_ASSERT( INCORRECT_STATE );
-STATUS_ASSERT( INTERNAL_ERROR );
-STATUS_ASSERT( INVALID_ADDRESS );
-STATUS_ASSERT( INVALID_ID );
-STATUS_ASSERT( INVALID_NAME );
-STATUS_ASSERT( INVALID_NODE );
-STATUS_ASSERT( INVALID_NUMBER );
-STATUS_ASSERT( INVALID_PRIORITY );
-STATUS_ASSERT( INVALID_SIZE );
-STATUS_ASSERT( NO_MEMORY );
-STATUS_ASSERT( NOT_DEFINED );
-STATUS_ASSERT( NOT_OWNER_OF_RESOURCE );
-STATUS_ASSERT( OBJECT_WAS_DELETED );
-STATUS_ASSERT( PROXY_BLOCKING );
-STATUS_ASSERT( RESOURCE_IN_USE );
-STATUS_ASSERT( SUCCESSFUL );
-STATUS_ASSERT( TIMEOUT );
-STATUS_ASSERT( TOO_MANY );
-STATUS_ASSERT( UNSATISFIED );
-
-static rtems_status_code _RTEMS_tasks_Prepare_user_stack(
-  Thread_Configuration    *thread_config,
-  const rtems_task_config *config
-)
-{
-  size_t size;
-
-  size = _TLS_Get_allocation_size();
-
-  if ( config->maximum_thread_local_storage_size < size ) {
-    return RTEMS_INVALID_SIZE;
-  }
-
-#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
-  if ( thread_config->is_fp ) {
-    size += CONTEXT_FP_SIZE;
-  }
-#endif
-
-  size += _Stack_Minimum();
-
-  if ( config->storage_size < size ) {
-    return RTEMS_INVALID_SIZE;
-  }
-
-  thread_config->stack_size = config->storage_size;
-  thread_config->stack_area = config->storage_area;
-
-  if ( config->storage_free != NULL ) {
-    thread_config->stack_free = config->storage_free;
-  } else {
-    thread_config->stack_free = _Objects_Free_nothing;
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code rtems_task_construct(
-  const rtems_task_config *config,
-  rtems_id                *id
-)
-{
-  if ( config == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  return _RTEMS_tasks_Create( config, id, _RTEMS_tasks_Prepare_user_stack );
-}
-
-rtems_status_code _RTEMS_tasks_Create(
-  const rtems_task_config   *config,
-  rtems_id                  *id,
-  RTEMS_tasks_Prepare_stack  prepare_stack
-)
-{
-  Thread_Control          *the_thread;
-  Thread_Configuration     thread_config;
-#if defined(RTEMS_MULTIPROCESSING)
-  Objects_MP_Control      *the_global_object = NULL;
-  bool                     is_global;
-#endif
-  rtems_status_code        status;
-  rtems_attribute          attributes;
-  bool                     valid;
-  RTEMS_API_Control       *api;
-  ASR_Information         *asr;
-
-  if ( !rtems_is_name_valid( config->name ) ) {
-    return RTEMS_INVALID_NAME;
-  }
-
-  if ( id == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  /*
-   *  Core Thread Initialize insures we get the minimum amount of
-   *  stack space.
-   */
-
-  /*
-   *  Fix the attribute set to match the attributes which
-   *  this processor (1) requires and (2) is able to support.
-   *  First add in the required flags for attributes
-   *  Typically this might include FP if the platform
-   *  or application required all tasks to be fp aware.
-   *  Then turn off the requested bits which are not supported.
-   */
-
-  attributes = _Attributes_Set( config->attributes, ATTRIBUTES_REQUIRED );
-  attributes = _Attributes_Clear( attributes, ATTRIBUTES_NOT_SUPPORTED );
-
-  memset( &thread_config, 0, sizeof( thread_config ) );
-  thread_config.isr_level =  _Modes_Get_interrupt_level( config->initial_modes );
-  thread_config.name = config->name;
-  thread_config.is_fp = _Attributes_Is_floating_point( attributes );
-  thread_config.is_preemptible = _Modes_Is_preempt( config->initial_modes );
-
-  if ( _Modes_Is_timeslice( config->initial_modes ) ) {
-    thread_config.cpu_budget_operations = &_Thread_CPU_budget_reset_timeslice;
-  } else {
-    thread_config.cpu_budget_operations = NULL;
-  }
-
-  /*
-   *  Validate the RTEMS API priority and convert it to the core priority range.
-   */
-
-  if ( !_Attributes_Is_system_task( attributes ) ) {
-    if ( config->initial_priority == PRIORITY_MINIMUM ) {
-      return RTEMS_INVALID_PRIORITY;
-    }
-  }
-
-  thread_config.scheduler =
-    _Thread_Scheduler_get_home( _Thread_Get_executing() );
-
-  thread_config.priority = _RTEMS_Priority_To_core(
-    thread_config.scheduler,
-    config->initial_priority,
-    &valid
-  );
-  if ( !valid ) {
-    return RTEMS_INVALID_PRIORITY;
-  }
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( !_System_state_Is_multiprocessing ) {
-    attributes = _Attributes_Clear( attributes, RTEMS_GLOBAL );
-  }
-
-  is_global = _Attributes_Is_global( attributes );
-#endif
-
-  /*
-   *  Allocate the thread control block and -- if the task is global --
-   *  allocate a global object control block.
-   *
-   *  NOTE:  This routine does not use the combined allocate and open
-   *         global object routine (_Objects_MP_Allocate_and_open) because
-   *         this results in a lack of control over when memory is allocated
-   *         and can be freed in the event of an error.
-   */
-  the_thread = _RTEMS_tasks_Allocate();
-
-  if ( !the_thread ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_TOO_MANY;
-  }
-
-#if defined(RTEMS_MULTIPROCESSING)
-  if ( is_global ) {
-    the_global_object = _Objects_MP_Allocate_global_object();
-
-    if ( the_global_object == NULL ) {
-      _Objects_Free( &_RTEMS_tasks_Information.Objects, &the_thread->Object );
-      _Objects_Allocator_unlock();
-      return RTEMS_TOO_MANY;
-    }
-  }
-#endif
-
-  status = ( *prepare_stack )( &thread_config, config );
-
-  /*
-   *  Initialize the core thread for this task.
-   */
-
-  if ( status == RTEMS_SUCCESSFUL ) {
-    Status_Control score_status;
-
-    score_status = _Thread_Initialize(
-      &_RTEMS_tasks_Information,
-      the_thread,
-      &thread_config
-    );
-    status = _Status_Get( score_status );
-  } else {
-    _Objects_Free( &_RTEMS_tasks_Information.Objects, &the_thread->Object );
-  }
-
-  if ( status != RTEMS_SUCCESSFUL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( is_global )
-      _Objects_MP_Free_global_object( the_global_object );
-#endif
-    _Objects_Allocator_unlock();
-    return status;
-  }
-
-  api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
-  asr = &api->Signal;
-
-  asr->is_enabled = !_Modes_Is_asr_disabled( config->initial_modes );
-
-  *id = the_thread->Object.id;
-
-#if defined(RTEMS_MULTIPROCESSING)
-  the_thread->is_global = is_global;
-  if ( is_global ) {
-
-    _Objects_MP_Open(
-      &_RTEMS_tasks_Information.Objects,
-      the_global_object,
-      config->name,
-      the_thread->Object.id
-    );
-
-    _RTEMS_tasks_MP_Send_process_packet(
-      RTEMS_TASKS_MP_ANNOUNCE_CREATE,
-      the_thread->Object.id,
-      config->name
-    );
-
-   }
-#endif
-
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
-
-static void _RTEMS_tasks_Start_extension(
-  Thread_Control *executing,
-  Thread_Control *started
-)
-{
-  RTEMS_API_Control *api;
-
-  api = started->API_Extensions[ THREAD_API_RTEMS ];
-
-  _Event_Initialize( &api->Event );
-  _Event_Initialize( &api->System_event );
-}
-
-#if defined(RTEMS_MULTIPROCESSING)
-static void _RTEMS_tasks_Terminate_extension( Thread_Control *executing )
-{
-  if ( executing->is_global ) {
-    _Objects_MP_Close(
-      &_RTEMS_tasks_Information.Objects,
-      executing->Object.id
-    );
-    _RTEMS_tasks_MP_Send_process_packet(
-      RTEMS_TASKS_MP_ANNOUNCE_DELETE,
-      executing->Object.id,
-      0                                /* Not used */
-    );
-  }
-}
-#endif
-
-static User_extensions_Control _RTEMS_tasks_User_extensions = {
-  .Callouts = {
-#if defined(RTEMS_MULTIPROCESSING)
-    .thread_terminate = _RTEMS_tasks_Terminate_extension,
-#endif
-    .thread_start     = _RTEMS_tasks_Start_extension,
-    .thread_restart   = _RTEMS_tasks_Start_extension
-  }
-};
-
-static void _RTEMS_tasks_Manager_initialization( void )
-{
-  _Thread_Initialize_information( &_RTEMS_tasks_Information );
-  _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _RTEMS_tasks_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_TASKS,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/rtems/src/taskconstructuser.c
===================================================================
--- cpukit/rtems/src/taskconstructuser.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   _RTEMS_tasks_Construct_user_task().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * 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/tasksimpl.h>
-#include <rtems/score/assert.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/interr.h>
-
-void _RTEMS_tasks_Construct_user_task( void )
-{
-  const RTEMS_tasks_User_task_config *config;
-  rtems_status_code                   status;
-  rtems_id                            id;
-
-  config = &_RTEMS_tasks_User_task_config;
-  status = rtems_task_construct( &config->config, &id );
-
-  if ( status != RTEMS_SUCCESSFUL ) {
-    _Internal_error( INTERNAL_ERROR_RTEMS_INIT_TASK_CONSTRUCT_FAILED );
-  }
-
-  status = rtems_task_start( id, config->entry_point, config->argument );
-  _Assert( status == RTEMS_SUCCESSFUL );
-  (void) status;
-
-  _Assert( _Thread_Global_constructor == 0 );
-  _Thread_Global_constructor = id;
-}
Index: cpukit/rtems/src/taskcreate.c
===================================================================
--- cpukit/rtems/src/taskcreate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,89 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_create().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * 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/tasksimpl.h>
-#include <rtems/score/stackimpl.h>
-
-#include <string.h>
-
-static rtems_status_code _RTEMS_tasks_Allocate_and_prepare_stack(
-  Thread_Configuration    *thread_config,
-  const rtems_task_config *config
-)
-{
-  size_t size;
-
-  thread_config->stack_free = _Stack_Free;
-  size = _Stack_Ensure_minimum( config->storage_size );
-  size = _Stack_Extend_size( size, thread_config->is_fp );
-  thread_config->stack_size = size;
-  thread_config->stack_area = _Stack_Allocate( size );
-
-  if ( thread_config->stack_area == NULL ) {
-    return RTEMS_UNSATISFIED;
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code rtems_task_create(
-  rtems_name           name,
-  rtems_task_priority  initial_priority,
-  size_t               stack_size,
-  rtems_mode           initial_modes,
-  rtems_attribute      attribute_set,
-  rtems_id            *id
-)
-{
-  rtems_task_config config;
-
-  memset( &config, 0, sizeof( config ) );
-  config.name = name;
-  config.initial_priority = initial_priority;
-  config.storage_size = stack_size;
-  config.initial_modes = initial_modes;
-  config.attributes = attribute_set;
-
-  return _RTEMS_tasks_Create(
-    &config,
-    id,
-    _RTEMS_tasks_Allocate_and_prepare_stack
-  );
-}
Index: cpukit/rtems/src/taskdelete.c
===================================================================
--- cpukit/rtems/src/taskdelete.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,90 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_delete().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/tasksimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_task_delete(
-  rtems_id id
-)
-{
-  Thread_Control       *the_thread;
-  Thread_queue_Context  queue_context;
-  Per_CPU_Control      *cpu_self;
-  Thread_Control       *executing;
-  Status_Control        status;
-
-  _Thread_queue_Context_initialize( &queue_context );
-  the_thread = _Thread_Get( id, &queue_context.Lock_context.Lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Thread_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  cpu_self = _Per_CPU_Get();
-
-  if ( _Per_CPU_Is_ISR_in_progress( cpu_self ) ) {
-    _ISR_lock_ISR_enable( &queue_context.Lock_context.Lock_context );
-    return RTEMS_CALLED_FROM_ISR;
-  }
-
-  executing = _Per_CPU_Get_executing( cpu_self );
-
-  if ( the_thread == executing ) {
-    _ISR_lock_ISR_enable( &queue_context.Lock_context.Lock_context );
-
-    /*
-     * The Classic tasks are neither detached nor joinable.  In case of
-     * self deletion, they are detached, otherwise joinable by default.
-     */
-    _Thread_Exit( NULL, THREAD_LIFE_TERMINATING | THREAD_LIFE_DETACHED );
-  }
-
-  status = _Thread_Close( the_thread, executing, &queue_context );
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/taskexit.c
===================================================================
--- cpukit/rtems/src/taskexit.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_exit().
- */
-
-/*
- * Copyright (c) 2018 embedded brains GmbH & Co. KG
- *
- * 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/tasks.h>
-#include <rtems/score/threadimpl.h>
-
-void rtems_task_exit( void )
-{
-  _Thread_Exit( NULL, THREAD_LIFE_TERMINATING | THREAD_LIFE_DETACHED );
-}
Index: cpukit/rtems/src/taskgetaffinity.c
===================================================================
--- cpukit/rtems/src/taskgetaffinity.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,83 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_get_affinity().
- */
-
-/*
- *  COPYRIGHT (c) 2014.
- *  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.
- *
- * 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/tasks.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_task_get_affinity(
-  rtems_id   id,
-  size_t     cpusetsize,
-  cpu_set_t *cpuset
-)
-{
-  Thread_Control   *the_thread;
-  ISR_lock_Context  lock_context;
-  Status_Control    status;
-
-  if ( cpuset == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_thread = _Thread_Get( id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Thread_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  _Thread_State_acquire_critical( the_thread, &lock_context );
-
-  status = _Scheduler_Get_affinity(
-    the_thread,
-    cpusetsize,
-    cpuset
-  );
-
-  _Thread_State_release( the_thread, &lock_context );
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/taskgetpriority.c
===================================================================
--- cpukit/rtems/src/taskgetpriority.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,100 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_get_priority().
- */
-
-/*
- * Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * 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/tasksimpl.h>
-#include <rtems/score/schedulerimpl.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_task_get_priority(
-  rtems_id             task_id,
-  rtems_id             scheduler_id,
-  rtems_task_priority *priority
-)
-{
-  Thread_Control          *the_thread;
-  Thread_queue_Context     queue_context;
-  const Scheduler_Control *scheduler;
-  const Scheduler_Node    *scheduler_node;
-  Priority_Control         core_priority;
-
-  if ( priority == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  scheduler = _Scheduler_Get_by_id( scheduler_id );
-  if ( scheduler == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  _Thread_queue_Context_initialize( &queue_context );
-  the_thread = _Thread_Get( task_id,
-    &queue_context.Lock_context.Lock_context
-  );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Thread_MP_Is_remote( task_id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  scheduler_node = _Thread_Scheduler_get_node_by_index(
-     the_thread,
-    _Scheduler_Get_index( scheduler )
-  );
-
-  _Thread_Wait_acquire_critical( the_thread, &queue_context );
-
-#if defined(RTEMS_SMP)
-  if ( _Priority_Is_empty( &scheduler_node->Wait.Priority ) ) {
-    _Thread_Wait_release( the_thread, &queue_context );
-    return RTEMS_NOT_DEFINED;
-  }
-#endif
-
-  core_priority = _Priority_Get_priority( &scheduler_node->Wait.Priority );
-
-  _Thread_Wait_release( the_thread, &queue_context );
-  *priority = _RTEMS_Priority_From_core( scheduler, core_priority );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/taskgetscheduler.c
===================================================================
--- cpukit/rtems/src/taskgetscheduler.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_get_scheduler().
- */
-
-/*
- * Copyright (c) 2014 embedded brains GmbH & Co. KG
- *
- * 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/tasks.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_task_get_scheduler(
-  rtems_id  task_id,
-  rtems_id *scheduler_id
-)
-{
-  Thread_Control          *the_thread;
-  ISR_lock_Context         lock_context;
-  const Scheduler_Control *scheduler;
-
-  if ( scheduler_id == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_thread = _Thread_Get( task_id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Thread_MP_Is_remote( task_id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  _Thread_State_acquire_critical( the_thread, &lock_context );
-
-  scheduler = _Thread_Scheduler_get_home( the_thread );
-  *scheduler_id = _Scheduler_Build_id( _Scheduler_Get_index( scheduler ) );
-
-  _Thread_State_release( the_thread, &lock_context );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/taskident.c
===================================================================
--- cpukit/rtems/src/taskident.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_ident().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- * 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.
- *
- * 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/tasksimpl.h>
-#include <rtems/rtems/object.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
-)
-{
-  if ( id == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  if ( name == RTEMS_WHO_AM_I ) {
-    *id = _Thread_Get_executing()->Object.id;
-    return RTEMS_SUCCESSFUL;
-  }
-
-  return _RTEMS_Name_to_id(
-    name,
-    node,
-    id,
-    &_RTEMS_tasks_Information.Objects
-  );
-}
Index: cpukit/rtems/src/taskinitdefault.c
===================================================================
--- cpukit/rtems/src/taskinitdefault.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/**
- * @file
- *
- * @ingroup RTEMSImplClassic
- *
- * @brief This source file contains a definition of
- *   ::_RTEMS_tasks_User_task_table without a task entry.
- */
-
-/*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * 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/tasks.h>
-
-const rtems_initialization_tasks_table _RTEMS_tasks_User_task_table;
Index: cpukit/rtems/src/taskinitusers.c
===================================================================
--- cpukit/rtems/src/taskinitusers.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   _RTEMS_tasks_Initialize_user_task().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- *
- * 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/tasksimpl.h>
-#include <rtems/score/assert.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/interr.h>
-
-void _RTEMS_tasks_Initialize_user_task( void )
-{
-  rtems_id                                id;
-  rtems_status_code                       return_value;
-  const rtems_initialization_tasks_table *user_task;
-
-  user_task = &_RTEMS_tasks_User_task_table;
-  return_value = rtems_task_create(
-    user_task->name,
-    user_task->initial_priority,
-    user_task->stack_size,
-    user_task->mode_set,
-    user_task->attribute_set,
-    &id
-  );
-  if ( !rtems_is_status_successful( return_value ) ) {
-    _Internal_error( INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED );
-  }
-
-  return_value = rtems_task_start(
-    id,
-    user_task->entry_point,
-    user_task->argument
-  );
-  _Assert( rtems_is_status_successful( return_value ) );
-  (void) return_value;
-
-  _Assert( _Thread_Global_constructor == 0 );
-  _Thread_Global_constructor = id;
-}
Index: cpukit/rtems/src/taskissuspended.c
===================================================================
--- cpukit/rtems/src/taskissuspended.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,67 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_is_suspended().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/tasks.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_task_is_suspended( rtems_id id )
-{
-  Thread_Control   *the_thread;
-  ISR_lock_Context  lock_context;
-  States_Control    current_state;
-
-  the_thread = _Thread_Get( id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Thread_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  current_state = the_thread->current_state;
-  _ISR_lock_ISR_enable( &lock_context);
-  return _States_Is_suspended( current_state ) ?
-    RTEMS_ALREADY_SUSPENDED : RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/taskiterate.c
===================================================================
--- cpukit/rtems/src/taskiterate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_iterate().
- */
-
-/*
- * Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * 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/tasks.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/objectimpl.h>
-
-void rtems_task_iterate(
-  rtems_task_visitor  visitor,
-  void               *arg
-)
-{
-  _Objects_Allocator_lock();
-  _Thread_Iterate( visitor, arg );
-  _Objects_Allocator_unlock();
-}
Index: cpukit/rtems/src/taskmode.c
===================================================================
--- cpukit/rtems/src/taskmode.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,161 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_mode().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/tasksdata.h>
-#include <rtems/rtems/modesimpl.h>
-#include <rtems/rtems/signalimpl.h>
-#include <rtems/score/isrlevel.h>
-#include <rtems/score/schedulerimpl.h>
-#include <rtems/score/smpimpl.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_task_mode(
-  rtems_mode  mode_set,
-  rtems_mode  mask,
-  rtems_mode *previous_mode_set
-)
-{
-  Thread_Control     *executing;
-  RTEMS_API_Control  *api;
-  ASR_Information    *asr;
-  rtems_mode          old_mode;
-
-  executing = _Thread_Get_executing();
-
-  if ( !previous_mode_set )
-    return RTEMS_INVALID_ADDRESS;
-
-#if defined(RTEMS_SMP)
-  if (
-    ( mask & RTEMS_PREEMPT_MASK ) != 0 &&
-    !_Modes_Is_preempt_mode_supported( mode_set, executing )
-  ) {
-    return RTEMS_NOT_IMPLEMENTED;
-  }
-#endif
-
-#if defined(RTEMS_SMP) || CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE
-  if (
-    ( mask & RTEMS_INTERRUPT_MASK ) != 0 &&
-    !_Modes_Is_interrupt_level_supported( mode_set )
-  ) {
-    return RTEMS_NOT_IMPLEMENTED;
-  }
-#endif
-
-  /*
-   * Complete all error checking before doing any operations which
-   * impact the executing thread. There should be no errors returned
-   * past this point.
-   */
-
-  api = executing->API_Extensions[ THREAD_API_RTEMS ];
-  asr = &api->Signal;
-
-  old_mode  = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
-
-  if ( executing->CPU_budget.operations == NULL )
-    old_mode |= RTEMS_NO_TIMESLICE;
-  else
-    old_mode |= RTEMS_TIMESLICE;
-
-  old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
-  old_mode |= _ISR_Get_level();
-
-  *previous_mode_set = old_mode;
-
-  if ( ( mask & RTEMS_TIMESLICE_MASK ) != 0 ) {
-    _Modes_Apply_timeslice_to_thread( mode_set, executing );
-  }
-
-  if ( ( mask & RTEMS_INTERRUPT_MASK ) != 0 ) {
-    _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
-  }
-
-  if ( ( mask & ( RTEMS_ASR_MASK | RTEMS_PREEMPT_MASK ) ) != 0 ) {
-    bool             need_thread_dispatch;
-    ISR_lock_Context lock_context;
-
-    need_thread_dispatch = false;
-
-    _Thread_State_acquire( executing, &lock_context );
-
-    if ( ( mask & RTEMS_ASR_MASK ) != 0 ) {
-      bool previous_asr_is_enabled;
-
-      previous_asr_is_enabled = asr->is_enabled;
-      asr->is_enabled = !_Modes_Is_asr_disabled( mode_set );
-
-      if (
-        !previous_asr_is_enabled &&
-          asr->is_enabled &&
-          asr->signals_pending != 0
-      ) {
-        need_thread_dispatch = true;
-        _Thread_Append_post_switch_action( executing, &api->Signal_action );
-      }
-    }
-
-    if ( ( mask & RTEMS_PREEMPT_MASK ) != 0 ) {
-      bool previous_is_preemptible;
-
-      previous_is_preemptible = executing->is_preemptible;
-      executing->is_preemptible = _Modes_Is_preempt( mode_set );
-
-      if ( executing->is_preemptible && !previous_is_preemptible ) {
-        need_thread_dispatch = true;
-        _Scheduler_Schedule( executing );
-      }
-    }
-
-    if ( need_thread_dispatch ) {
-      Per_CPU_Control *cpu_self;
-
-      cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
-      _Thread_State_release( executing, &lock_context );
-      _Thread_Dispatch_direct( cpu_self );
-    } else {
-      _Thread_State_release( executing, &lock_context );
-    }
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/taskmp.c
===================================================================
--- cpukit/rtems/src/taskmp.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/taskmp.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,84 +1,28 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTaskMP
- *
- * @brief This source file contains the implementation to support the Task
- *   Manager in multiprocessing (MP) configurations.
- */
-
 /*
- *  COPYRIGHT (c) 1989-2008.
+ *  Multiprocessing Support for the RTEMS Task Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
  *  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.
- *
- * 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/tasksimpl.h>
-#include <rtems/rtems/optionsimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/statesimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/threadqimpl.h>
-#include <rtems/sysinit.h>
-
-/**
- *  The following data structure defines the packet used to perform
- *  remote task operations.
- */
-typedef struct {
-  rtems_packet_prefix               Prefix;
-  RTEMS_tasks_MP_Remote_operations  operation;
-  rtems_name                        name;
-  rtems_task_priority               the_priority;
-}   RTEMS_tasks_MP_Packet;
-
-RTEMS_STATIC_ASSERT(
-  sizeof(RTEMS_tasks_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE,
-  RTEMS_tasks_MP_Packet
-);
-
-static RTEMS_tasks_MP_Packet *_RTEMS_tasks_MP_Get_packet( void )
-{
-  return (RTEMS_tasks_MP_Packet *) _MPCI_Get_packet();
-}
-
-static RTEMS_tasks_MP_Packet *_RTEMS_tasks_MP_Get_request_packet(
-  Objects_Id id
-)
-{
-  if ( !_Thread_MP_Is_remote( id ) ) {
-    return NULL;
-  }
-
-  return _RTEMS_tasks_MP_Get_packet();
-}
-
-/*
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/mpci.h>
+#include <rtems/mppkt.h>
+#include <rtems/object.h>
+#include <rtems/options.h>
+#include <rtems/tasks.h>
+#include <rtems/thread.h>
+#include <rtems/watchdog.h>
+
+/*PAGE
+ *
  *  _RTEMS_tasks_MP_Send_process_packet
  *
@@ -88,5 +32,5 @@
   RTEMS_tasks_MP_Remote_operations operation,
   Objects_Id                       task_id,
-  rtems_name                       name
+  Objects_Name                     name
 )
 {
@@ -99,5 +43,5 @@
 
       the_packet                    = _RTEMS_tasks_MP_Get_packet();
-      the_packet->Prefix.the_class  = MP_PACKET_TASKS;
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_TASKS;
       the_packet->Prefix.length     = sizeof ( RTEMS_tasks_MP_Packet );
       the_packet->Prefix.to_convert = sizeof ( RTEMS_tasks_MP_Packet );
@@ -115,90 +59,77 @@
     case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
     case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
+    case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
+    case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
+    case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
+    case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
       break;
   }
 }
 
-static rtems_status_code _RTEMS_tasks_MP_Send_request_packet(
-  RTEMS_tasks_MP_Packet            *the_packet,
-  Objects_Id                        id,
-  RTEMS_tasks_MP_Remote_operations  operation
+/*PAGE
+ *
+ *  _RTEMS_tasks_MP_Send_request_packet
+ *
+ */
+
+rtems_status_code _RTEMS_tasks_MP_Send_request_packet (
+  RTEMS_tasks_MP_Remote_operations operation,
+  Objects_Id                       task_id,
+  rtems_task_priority                 new_priority,
+  unsigned32                       notepad,
+  unsigned32                       note
 )
 {
-  Status_Control status;
-
-  the_packet->Prefix.the_class  = MP_PACKET_TASKS;
-  the_packet->Prefix.length     = sizeof( *the_packet );
-  the_packet->Prefix.to_convert = sizeof( *the_packet );
-  the_packet->Prefix.id         = id;
-  the_packet->operation         = operation;
-
-  status = _MPCI_Send_request_packet(
-    _Objects_Get_node( id ),
-    &the_packet->Prefix,
-    STATES_READY /* Not used */
-  );
-  return _Status_Get( status );
-}
-
-rtems_status_code _RTEMS_tasks_MP_Set_priority(
-  rtems_id             id,
-  rtems_task_priority  new_priority,
-  rtems_task_priority *old_priority
-)
-{
   RTEMS_tasks_MP_Packet *the_packet;
 
-  the_packet = _RTEMS_tasks_MP_Get_request_packet( id );
-  if ( the_packet == NULL ) {
-    return RTEMS_INVALID_ID;
+  switch ( operation ) {
+
+    case RTEMS_TASKS_MP_SUSPEND_REQUEST:
+    case RTEMS_TASKS_MP_RESUME_REQUEST:
+    case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
+    case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
+    case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
+
+      the_packet                    = _RTEMS_tasks_MP_Get_packet();
+      the_packet->Prefix.the_class  = RTEMS_MP_PACKET_TASKS;
+      the_packet->Prefix.length     = sizeof ( RTEMS_tasks_MP_Packet );
+      the_packet->Prefix.to_convert = sizeof ( RTEMS_tasks_MP_Packet );
+      the_packet->operation         = operation;
+      the_packet->Prefix.id         = task_id;
+      the_packet->the_priority      = new_priority;
+      the_packet->notepad           = notepad;
+      the_packet->note              = note;
+
+      return _MPCI_Send_request_packet(
+        rtems_get_node( task_id ),
+        &the_packet->Prefix,
+        STATES_READY     /* Not used */
+      );
+      break;
+
+    case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
+    case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
+    case RTEMS_TASKS_MP_SUSPEND_RESPONSE:
+    case RTEMS_TASKS_MP_RESUME_RESPONSE:
+    case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
+    case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
+    case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
+      break;
+
   }
-
-  the_packet->the_priority = new_priority;
-  _Thread_Executing->Wait.return_argument = old_priority;
-  return _RTEMS_tasks_MP_Send_request_packet(
-    the_packet,
-    id,
-    RTEMS_TASKS_MP_SET_PRIORITY_REQUEST
-  );
-}
-
-rtems_status_code _RTEMS_tasks_MP_Suspend( rtems_id id )
-{
-  RTEMS_tasks_MP_Packet *the_packet;
-
-  the_packet = _RTEMS_tasks_MP_Get_request_packet( id );
-  if ( the_packet == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  return _RTEMS_tasks_MP_Send_request_packet(
-    the_packet,
-    id,
-    RTEMS_TASKS_MP_SUSPEND_REQUEST
-  );
-}
-
-rtems_status_code _RTEMS_tasks_MP_Resume( rtems_id id )
-{
-  RTEMS_tasks_MP_Packet *the_packet;
-
-  the_packet = _RTEMS_tasks_MP_Get_request_packet( id );
-  if ( the_packet == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  return _RTEMS_tasks_MP_Send_request_packet(
-    the_packet,
-    id,
-    RTEMS_TASKS_MP_RESUME_REQUEST
-  );
-}
-
-/*
+  /*
+   *  The following line is included to satisfy compilers which
+   *  produce warnings when a function does not end with a return.
+   */
+  return RTEMS_SUCCESSFUL;
+}
+
+/*PAGE
+ *
  *  _RTEMS_tasks_MP_Send_response_packet
  *
  */
 
-static void _RTEMS_tasks_MP_Send_response_packet (
+void _RTEMS_tasks_MP_Send_response_packet (
   RTEMS_tasks_MP_Remote_operations  operation,
   Thread_Control                   *the_thread
@@ -212,4 +143,6 @@
     case RTEMS_TASKS_MP_RESUME_RESPONSE:
     case RTEMS_TASKS_MP_SET_PRIORITY_RESPONSE:
+    case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
+    case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
 
       the_packet = (RTEMS_tasks_MP_Packet *) the_thread->receive_packet;
@@ -223,5 +156,5 @@
 
       _MPCI_Send_response_packet(
-        _Objects_Get_node( the_packet->Prefix.source_tid ),
+        rtems_get_node( the_packet->Prefix.source_tid ),
         &the_packet->Prefix
       );
@@ -233,4 +166,6 @@
     case RTEMS_TASKS_MP_RESUME_REQUEST:
     case RTEMS_TASKS_MP_SET_PRIORITY_REQUEST:
+    case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
+    case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
       break;
 
@@ -238,5 +173,6 @@
 }
 
-/*
+/*PAGE
+ *
  *
  *  _RTEMS_tasks_MP_Process_packet
@@ -244,5 +180,5 @@
  */
 
-static void _RTEMS_tasks_MP_Process_packet (
+void _RTEMS_tasks_MP_Process_packet (
   rtems_packet_prefix  *the_packet_prefix
 )
@@ -250,4 +186,5 @@
   RTEMS_tasks_MP_Packet *the_packet;
   Thread_Control   *the_thread;
+  boolean           ignored;
 
   the_packet = (RTEMS_tasks_MP_Packet *) the_packet_prefix;
@@ -257,10 +194,10 @@
     case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
 
-      _Objects_MP_Allocate_and_open(
-        &_RTEMS_tasks_Information.Objects,
-        the_packet->name,
-        the_packet->Prefix.id,
-        true
-      );
+      ignored = _Objects_MP_Open(
+                  &_Thread_Information,
+                  the_packet->name,
+                  the_packet->Prefix.id,
+                  TRUE
+                );
 
       _MPCI_Return_packet( the_packet_prefix );
@@ -269,8 +206,5 @@
     case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
 
-      _Objects_MP_Close(
-        &_RTEMS_tasks_Information.Objects,
-        the_packet->Prefix.id
-      );
+      _Objects_MP_Close( &_Thread_Information, the_packet->Prefix.id );
 
       _MPCI_Return_packet( the_packet_prefix );
@@ -291,4 +225,5 @@
     case RTEMS_TASKS_MP_SUSPEND_RESPONSE:
     case RTEMS_TASKS_MP_RESUME_RESPONSE:
+    case RTEMS_TASKS_MP_SET_NOTE_RESPONSE:
 
       the_thread = _MPCI_Process_response( the_packet_prefix );
@@ -332,18 +267,72 @@
       _MPCI_Return_packet( the_packet_prefix );
       break;
+
+    case RTEMS_TASKS_MP_GET_NOTE_REQUEST:
+
+      the_packet->Prefix.return_code = rtems_task_get_note(
+        the_packet->Prefix.id,
+        the_packet->notepad,
+        &the_packet->note
+      );
+
+      _RTEMS_tasks_MP_Send_response_packet(
+        RTEMS_TASKS_MP_GET_NOTE_RESPONSE,
+        _Thread_Executing
+      );
+      break;
+
+    case RTEMS_TASKS_MP_GET_NOTE_RESPONSE:
+
+      the_thread = _MPCI_Process_response( the_packet_prefix );
+
+      *(unsigned32 *)the_thread->Wait.return_argument = the_packet->note;
+
+      _MPCI_Return_packet( the_packet_prefix );
+      break;
+
+    case RTEMS_TASKS_MP_SET_NOTE_REQUEST:
+
+      the_packet->Prefix.return_code = rtems_task_set_note(
+        the_packet->Prefix.id,
+        the_packet->notepad,
+        the_packet->note
+      );
+
+      _RTEMS_tasks_MP_Send_response_packet(
+        RTEMS_TASKS_MP_SET_NOTE_RESPONSE,
+        _Thread_Executing
+      );
+      break;
   }
 }
 
-static void _RTEMS_tasks_MP_Initialize( void )
-{
-  _MPCI_Register_packet_processor(
-    MP_PACKET_TASKS,
-    _RTEMS_tasks_MP_Process_packet
-  );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _RTEMS_tasks_MP_Initialize,
-  RTEMS_SYSINIT_CLASSIC_TASKS_MP,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
+/*PAGE
+ *
+ *  _RTEMS_tasks_MP_Send_object_was_deleted
+ *
+ *  This routine is not neededby the Tasks since a task
+ *  cannot be globally deleted.
+ *
+ */
+
+/*PAGE
+ *
+ *  _RTEMS_tasks_MP_Send_extract_proxy
+ *
+ *  This routine is not neededby the Tasks since a task
+ *  cannot be globally deleted.
+ *
+ */
+
+/*PAGE
+ *
+ *  _RTEMS_tasks_MP_Get_packet
+ *
+ */
+
+RTEMS_tasks_MP_Packet *_RTEMS_tasks_MP_Get_packet ( void )
+{
+  return ( (RTEMS_tasks_MP_Packet *) _MPCI_Get_packet() );
+}
+
+/* end of file */
Index: cpukit/rtems/src/taskrestart.c
===================================================================
--- cpukit/rtems/src/taskrestart.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_restart().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/tasks.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_task_restart(
-  rtems_id            id,
-  rtems_task_argument argument
-)
-{
-  Thread_Control           *the_thread;
-  ISR_lock_Context          lock_context;
-  Thread_Entry_information  entry;
-  Status_Control            status;
-
-  the_thread = _Thread_Get( id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Thread_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  entry = the_thread->Start.Entry;
-  entry.Kinds.Numeric.argument = argument;
-  status = _Thread_Restart( the_thread, &entry, &lock_context );
-
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/taskresume.c
===================================================================
--- cpukit/rtems/src/taskresume.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_resume().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/tasksimpl.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_task_resume(
-  rtems_id id
-)
-{
-  Thread_Control   *the_thread;
-  ISR_lock_Context  lock_context;
-  Per_CPU_Control  *cpu_self;
-  States_Control    previous_state;
-
-  the_thread = _Thread_Get( id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _RTEMS_tasks_MP_Resume( id );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
-  _ISR_lock_ISR_enable( &lock_context );
-
-  previous_state = _Thread_Clear_state( the_thread, STATES_SUSPENDED );
-
-  _Thread_Dispatch_enable( cpu_self );
-  return _States_Is_suspended( previous_state ) ?
-    RTEMS_SUCCESSFUL : RTEMS_INCORRECT_STATE;
-}
Index: cpukit/rtems/src/tasks.c
===================================================================
--- cpukit/rtems/src/tasks.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ cpukit/rtems/src/tasks.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,48 +1,816 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains a definition of the
- *   ::_RTEMS_tasks_Information with zero objects.
- */
-
 /*
- *  COPYRIGHT (c) 1989-2014.
+ *  RTEMS Task Manager
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
  *  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.
- *
- * 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"
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/modes.h>
+#include <rtems/object.h>
+#include <rtems/stack.h>
+#include <rtems/states.h>
+#include <rtems/tasks.h>
+#include <rtems/thread.h>
+#include <rtems/threadq.h>
+#include <rtems/tod.h>
+#include <rtems/userext.h>
+#include <rtems/wkspace.h>
+
+/*PAGE
+ *
+ *  rtems_task_create
+ *
+ *  This directive creates a thread by allocating and initializing a
+ *  thread control block and a stack.  The newly created thread is
+ *  placed in the dormant state.
+ *
+ *  Input parameters:
+ *    name             - user defined thread name
+ *    initial_priority - thread priority
+ *    stack_size       - stack size in bytes
+ *    initial_modes    - initial thread mode
+ *    attribute_set    - thread attributes
+ *    id               - pointer to thread id
+ *
+ *  Output parameters:
+ *    id                - thread id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_create(
+  Objects_Name         name,
+  rtems_task_priority  initial_priority,
+  unsigned32           stack_size,
+  rtems_mode           initial_modes,
+  rtems_attribute      attribute_set,
+  Objects_Id          *id
+)
+{
+  register Thread_Control *the_thread;
+  unsigned32               actual_stack_size;
+  unsigned32               memory_needed;
+  void                    *memory;
+  rtems_attribute          the_attribute_set;
+
+  if ( !_Objects_Is_name_valid( name ) )
+    return ( RTEMS_INVALID_NAME );
+
+#if 0
+  if ( !_Stack_Is_enough( stack_size ) )
+    return( RTEMS_INVALID_SIZE );
 #endif
 
-#include <rtems/rtems/tasksdata.h>
-
-THREAD_INFORMATION_DEFINE_ZERO(
-  _RTEMS_tasks,
-  OBJECTS_CLASSIC_API,
-  OBJECTS_RTEMS_TASKS
-);
+  if ( !_Stack_Is_enough( stack_size ) )
+    actual_stack_size = RTEMS_MINIMUM_STACK_SIZE;
+  else
+    actual_stack_size = stack_size;
+
+  if ( !_Priority_Is_valid( initial_priority ) )
+    return( RTEMS_INVALID_PRIORITY );
+
+  /*
+   *  Fix the attribute set to match the attributes which
+   *  this processor (1) requires and (2) is able to support.
+   *  First add in the required flags for attribute_set
+   *  Typically this might include FP if the platform
+   *  or application required all tasks to be fp aware.
+   *  Then turn off the requested bits which are not supported.
+   */
+
+  the_attribute_set = _Attributes_Set( attribute_set, ATTRIBUTES_REQUIRED );
+  the_attribute_set =
+    _Attributes_Clear( the_attribute_set, ATTRIBUTES_NOT_SUPPORTED );
+
+  if ( _Attributes_Is_global( the_attribute_set ) &&
+       !_Configuration_Is_multiprocessing() )
+    return( RTEMS_MP_NOT_CONFIGURED );
+
+  _Thread_Disable_dispatch();          /* to prevent deletion */
+
+  the_thread = _RTEMS_tasks_Allocate();
+
+  if ( !the_thread ) {
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  actual_stack_size = _Stack_Adjust_size( actual_stack_size );
+  memory_needed = actual_stack_size;
+
+  if ( _Attributes_Is_floating_point( the_attribute_set ) )
+    memory_needed += CONTEXT_FP_SIZE;
+
+  memory = _Workspace_Allocate( memory_needed );
+
+  if ( !memory ) {
+    _RTEMS_tasks_Free( the_thread );
+    _Thread_Enable_dispatch();
+    return( RTEMS_UNSATISFIED );
+  }
+
+  /*
+   *  Stack is put in the lower address regions of the allocated memory.
+   *  The optional floating point context area goes into the higher part
+   *  of the allocated memory.
+   */
+
+  _Stack_Initialize(
+     &the_thread->Start.Initial_stack, memory, actual_stack_size );
+
+  if ( _Attributes_Is_floating_point( the_attribute_set ) )
+    the_thread->fp_context = _Context_Fp_start( memory, actual_stack_size );
+  else
+    the_thread->fp_context = NULL;
+
+  the_thread->Start.fp_context = the_thread->fp_context;
+
+  if ( _Attributes_Is_global( the_attribute_set ) &&
+       !( _Objects_MP_Open( &_Thread_Information, name,
+                            the_thread->Object.id, FALSE ) ) ) {
+    _RTEMS_tasks_Free( the_thread );
+    (void) _Workspace_Free( memory );
+    _Thread_Enable_dispatch();
+    return( RTEMS_TOO_MANY );
+  }
+
+  the_thread->name                   = name;
+  the_thread->attribute_set          = the_attribute_set;
+  the_thread->current_state          = STATES_DORMANT;
+  the_thread->current_modes          = initial_modes;
+  the_thread->pending_events         = EVENT_SETS_NONE_PENDING;
+  the_thread->resource_count         = 0;
+  the_thread->real_priority          = initial_priority;
+  the_thread->Start.initial_priority = initial_priority;
+  the_thread->Start.initial_modes    = initial_modes;
+
+  _Thread_Set_priority( the_thread, initial_priority );
+
+  _ASR_Initialize( &the_thread->Signal );
+
+  _Objects_Open( &_Thread_Information, &the_thread->Object, name );
+
+  *id = the_thread->Object.id;
+
+  _User_extensions_Task_create( the_thread );
+
+  if ( _Attributes_Is_global( the_attribute_set ) )
+    _RTEMS_tasks_MP_Send_process_packet(
+      RTEMS_TASKS_MP_ANNOUNCE_CREATE,
+      the_thread->Object.id,
+      name
+    );
+
+  _Thread_Enable_dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_task_ident
+ *
+ *  This directive returns the system ID associated with
+ *  the thread name.
+ *
+ *  Input parameters:
+ *    name - user defined thread name
+ *    node - node(s) to be searched
+ *    id   - pointer to thread id
+ *
+ *  Output parameters:
+ *    *id               - thread id
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_ident(
+  Objects_Name  name,
+  unsigned32    node,
+  Objects_Id   *id
+)
+{
+  if ( name != OBJECTS_ID_OF_SELF )
+    return( _Objects_Name_to_id( &_Thread_Information, name, node, id ) );
+
+  *id = _Thread_Executing->Object.id;
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_task_start
+ *
+ *  This directive readies the thread identified by the "id"
+ *  based on its current priorty, to await execution.  A thread
+ *  can be started only from the dormant state.
+ *
+ *  Input parameters:
+ *    id          - thread id
+ *    entry_point - start execution address of thread
+ *    argument    - thread argument
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_start(
+  Objects_Id   id,
+  rtems_task_entry entry_point,
+  unsigned32   argument
+)
+{
+  register Thread_Control *the_thread;
+  Objects_Locations        location;
+
+  if ( entry_point == NULL )
+    return( RTEMS_INVALID_ADDRESS );
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Dispatch();
+      return( RTEMS_ILLEGAL_ON_REMOTE_OBJECT );
+    case OBJECTS_LOCAL:
+      if ( _States_Is_dormant( the_thread->current_state ) ) {
+
+        the_thread->Start.entry_point      = entry_point;
+        the_thread->Start.initial_argument = argument;
+
+        _Thread_Load_environment( the_thread );
+
+        _Thread_Ready( the_thread );
+
+        _User_extensions_Task_start( the_thread );
+
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_INCORRECT_STATE );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_task_restart
+ *
+ *  This directive readies the specified thread.  It restores
+ *  the thread environment to the original values established
+ *  at thread creation and start time.  A thread can be restarted
+ *  from any state except the dormant state.
+ *
+ *  Input parameters:
+ *    id       - thread id
+ *    argument - thread argument
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_restart(
+  Objects_Id id,
+  unsigned32 argument
+)
+{
+  register Thread_Control *the_thread;
+  Objects_Locations               location;
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Dispatch();
+      return( RTEMS_ILLEGAL_ON_REMOTE_OBJECT );
+    case OBJECTS_LOCAL:
+      if ( !_States_Is_dormant( the_thread->current_state ) ) {
+
+        _Thread_Set_transient( the_thread );
+        _ASR_Initialize( &the_thread->Signal );
+        the_thread->pending_events = EVENT_SETS_NONE_PENDING;
+        the_thread->resource_count = 0;
+        the_thread->current_modes  = the_thread->Start.initial_modes;
+        the_thread->Start.initial_argument = argument;
+
+        _RTEMS_tasks_Cancel_wait( the_thread );
+
+        if ( the_thread->current_priority !=
+                         the_thread->Start.initial_priority ) {
+          the_thread->real_priority = the_thread->Start.initial_priority;
+          _Thread_Set_priority( the_thread,
+             the_thread->Start.initial_priority );
+        }
+
+        _Thread_Load_environment( the_thread );
+
+        _Thread_Ready( the_thread );
+
+        _User_extensions_Task_restart( the_thread );
+
+        if ( _Thread_Is_executing ( the_thread ) )
+          _Thread_Restart_self();
+
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_INCORRECT_STATE );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_task_delete
+ *
+ *  This directive allows a thread to delete itself or the thread
+ *  identified in the id field.  The executive halts execution
+ *  of the thread and frees the thread control block.
+ *
+ *  Input parameters:
+ *    id - thread id
+ *
+ *  Output parameters:
+ *    nothing           - if id is the requesting thread (always succeeds)
+ *    RTEMS_SUCCESSFUL - if successful and id is
+ *                           not the requesting thread
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_delete(
+  Objects_Id id
+)
+{
+  register Thread_Control *the_thread;
+  Objects_Locations        location;
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Dispatch();
+      return( RTEMS_ILLEGAL_ON_REMOTE_OBJECT );
+    case OBJECTS_LOCAL:
+      _Objects_Close( &_Thread_Information, &the_thread->Object );
+
+      _Thread_Set_state( the_thread, STATES_TRANSIENT );
+
+      _User_extensions_Task_delete( the_thread );
+
+#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
+      if ( _Thread_Is_allocated_fp( the_thread ) )
+        _Thread_Deallocate_fp();
+#endif
+      the_thread->fp_context = NULL;
+
+      _RTEMS_tasks_Cancel_wait( the_thread );
+
+      (void) _Workspace_Free( the_thread->Start.Initial_stack.area );
+
+      _RTEMS_tasks_Free( the_thread );
+
+      if ( _Attributes_Is_global( the_thread->attribute_set ) ) {
+
+        _Objects_MP_Close( &_Thread_Information, the_thread->Object.id );
+
+        _RTEMS_tasks_MP_Send_process_packet(
+          RTEMS_TASKS_MP_ANNOUNCE_DELETE,
+          the_thread->Object.id,
+          0                                /* Not used */
+        );
+      }
+
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_task_suspend
+ *
+ *  This directive will place the specified thread in the "suspended"
+ *  state.  Note that the suspended state can be in addition to
+ *  other waiting states.
+ *
+ *  Input parameters:
+ *    id - thread id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_suspend(
+  Objects_Id id
+)
+{
+  register Thread_Control *the_thread;
+  Objects_Locations               location;
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      return(
+        _RTEMS_tasks_MP_Send_request_packet(
+          RTEMS_TASKS_MP_SUSPEND_REQUEST,
+          id,
+          0,          /* Not used */
+          0,          /* Not used */
+          0           /* Not used */
+        )
+      );
+    case OBJECTS_LOCAL:
+      if ( !_States_Is_suspended( the_thread->current_state ) ) {
+        _Thread_Set_state( the_thread, STATES_SUSPENDED );
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_ALREADY_SUSPENDED );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_task_resume
+ *
+ *  This directive will remove the specified thread
+ *  from the suspended state.
+ *
+ *  Input parameters:
+ *    id - thread id
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_resume(
+  Objects_Id id
+)
+{
+  register Thread_Control *the_thread;
+  Objects_Locations        location;
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      return(
+        _RTEMS_tasks_MP_Send_request_packet(
+          RTEMS_TASKS_MP_RESUME_REQUEST,
+          id,
+          0,          /* Not used */
+          0,          /* Not used */
+          0           /* Not used */
+        )
+      );
+    case OBJECTS_LOCAL:
+      if ( _States_Is_suspended( the_thread->current_state ) ) {
+        _Thread_Resume( the_thread );
+        _Thread_Enable_dispatch();
+        return( RTEMS_SUCCESSFUL );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_INCORRECT_STATE );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_task_set_priority
+ *
+ *  This directive changes the priority of the specified thread.
+ *  The specified thread can be any thread in the system including
+ *  the requesting thread.
+ *
+ *  Input parameters:
+ *    id           - thread id (0 indicates requesting thread)
+ *    new_priority - thread priority (0 indicates current priority)
+ *    old_priority - pointer to previous priority
+ *
+ *  Output parameters:
+ *    old_priority      - previous priority
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_set_priority(
+  Objects_Id        id,
+  rtems_task_priority  new_priority,
+  rtems_task_priority *old_priority
+)
+{
+  register Thread_Control *the_thread;
+  Objects_Locations               location;
+
+  if ( new_priority != RTEMS_CURRENT_PRIORITY &&
+       !_Priority_Is_valid( new_priority ) )
+    return( RTEMS_INVALID_PRIORITY );
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Executing->Wait.return_argument = old_priority;
+      return(
+        _RTEMS_tasks_MP_Send_request_packet(
+          RTEMS_TASKS_MP_SET_PRIORITY_REQUEST,
+          id,
+          new_priority,
+          0,          /* Not used */
+          0           /* Not used */
+        )
+      );
+    case OBJECTS_LOCAL:
+      *old_priority = the_thread->current_priority;
+      if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
+        the_thread->real_priority = new_priority;
+        if ( the_thread->resource_count == 0 ||
+             the_thread->current_priority > new_priority )
+          _Thread_Change_priority( the_thread, new_priority );
+      }
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_task_mode
+ *
+ *  This directive enables and disables several modes of
+ *  execution for the requesting thread.
+ *
+ *  Input parameters:
+ *    mode_set          - new mode
+ *    mask              - mask
+ *    previous_mode_set - address of previous mode set
+ *
+ *  Output:
+ *    *previous_mode_set - previous mode set
+ *     always returns RTEMS_SUCCESSFUL
+ */
+
+rtems_status_code rtems_task_mode(
+  rtems_mode  mode_set,
+  rtems_mode  mask,
+  rtems_mode *previous_mode_set
+)
+{
+  if ( _Thread_Change_mode( mode_set, mask, previous_mode_set ) )
+    _Thread_Dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_task_get_note
+ *
+ *  This directive obtains the note from the specified notepad
+ *  of the specified thread.
+ *
+ *  Input parameters:
+ *    id      - thread id
+ *    notepad - notepad number
+ *    note    - pointer to note
+ *
+ *  Output parameters:
+ *    note              - filled in if successful
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_get_note(
+  Objects_Id  id,
+  unsigned32  notepad,
+  unsigned32 *note
+)
+{
+  register Thread_Control *the_thread;
+  Objects_Locations        location;
+
+  /*
+   *  NOTE:  There is no check for < RTEMS_NOTEPAD_FIRST because that would
+   *         be checking an unsigned number for being negative.
+   */
+
+  if ( notepad > RTEMS_NOTEPAD_LAST )
+    return( RTEMS_INVALID_NUMBER );
+
+  /*
+   *  Optimize the most likely case to avoid the Thread_Dispatch.
+   */
+
+  if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ||
+       _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) {
+      *note = _Thread_Executing->Notepads[ notepad ];
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      _Thread_Executing->Wait.return_argument = note;
+
+      return _RTEMS_tasks_MP_Send_request_packet(
+        RTEMS_TASKS_MP_GET_NOTE_REQUEST,
+        id,
+        0,          /* Not used */
+        notepad,
+        0           /* Not used */
+      );
+    case OBJECTS_LOCAL:
+      *note= the_thread->Notepads[ notepad ];
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ * rtems_task_set_note
+ *
+ *  This directive sets the specified notepad contents to the given
+ *  note.
+ *
+ *  Input parameters:
+ *    id      - thread id
+ *    notepad - notepad number
+ *    note    - note value
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_set_note(
+  Objects_Id id,
+  unsigned32 notepad,
+  unsigned32 note
+)
+{
+  register Thread_Control *the_thread;
+  Objects_Locations        location;
+
+  /*
+   *  NOTE:  There is no check for < RTEMS_NOTEPAD_FIRST because that would
+   *         be checking an unsigned number for being negative.
+   */
+
+  if ( notepad > RTEMS_NOTEPAD_LAST )
+    return( RTEMS_INVALID_NUMBER );
+
+  /*
+   *  Optimize the most likely case to avoid the Thread_Dispatch.
+   */
+
+  if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ||
+       _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) {
+      _Thread_Executing->Notepads[ notepad ] = note;
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  the_thread = _Thread_Get( id, &location );
+  switch ( location ) {
+    case OBJECTS_ERROR:
+      return( RTEMS_INVALID_ID );
+    case OBJECTS_REMOTE:
+      return _RTEMS_tasks_MP_Send_request_packet(
+        RTEMS_TASKS_MP_SET_NOTE_REQUEST,
+        id,
+        0,          /* Not used */
+        notepad,
+        note
+      );
+
+    case OBJECTS_LOCAL:
+      the_thread->Notepads[ notepad ] = note;
+      _Thread_Enable_dispatch();
+      return( RTEMS_SUCCESSFUL );
+  }
+
+  return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
+}
+
+/*PAGE
+ *
+ *  rtems_task_wake_after
+ *
+ *  This directive suspends the requesting thread for the given amount
+ *  of ticks.
+ *
+ *  Input parameters:
+ *    ticks - number of ticks to wait
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - always successful
+ */
+
+rtems_status_code rtems_task_wake_after(
+  rtems_interval ticks
+)
+{
+  if ( ticks == 0 ) {
+    _Thread_Yield_processor();
+    _Thread_Dispatch();
+  } else {
+    _Thread_Disable_dispatch();
+      _Thread_Set_state( _Thread_Executing, STATES_DELAYING );
+      _Watchdog_Initialize(
+        &_Thread_Executing->Timer,
+        _Thread_Delay_ended,
+        _Thread_Executing->Object.id,
+        NULL
+      );
+      _Watchdog_Insert_ticks( &_Thread_Executing->Timer,
+                              ticks, WATCHDOG_ACTIVATE_NOW );
+    _Thread_Enable_dispatch();
+  }
+  return( RTEMS_SUCCESSFUL );
+}
+
+/*PAGE
+ *
+ *  rtems_task_wake_when
+ *
+ *  This directive blocks the requesting thread until the given date and
+ *  time is reached.
+ *
+ *  Input parameters:
+ *    time_buffer - pointer to the time and date structure
+ *
+ *  Output parameters:
+ *    RTEMS_SUCCESSFUL - if successful
+ *    error code        - if unsuccessful
+ */
+
+rtems_status_code rtems_task_wake_when(
+rtems_time_of_day *time_buffer
+)
+{
+  rtems_interval seconds;
+  rtems_status_code      local_result;
+
+  if ( !_TOD_Is_set() )
+    return( RTEMS_NOT_DEFINED );
+
+  time_buffer->ticks = 0;
+
+  local_result = _TOD_Validate( time_buffer );
+
+  if  ( !rtems_is_status_successful( local_result ) )
+    return( local_result );
+
+  seconds = _TOD_To_seconds( time_buffer );
+
+  if ( seconds <= _TOD_Seconds_since_epoch )
+    return( RTEMS_INVALID_CLOCK );
+
+  _Thread_Disable_dispatch();
+    _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME );
+    _Watchdog_Initialize(
+      &_Thread_Executing->Timer,
+      _Thread_Delay_ended,
+      _Thread_Executing->Object.id,
+      NULL
+    );
+    _Watchdog_Insert_seconds( &_Thread_Executing->Timer,
+            seconds - _TOD_Seconds_since_epoch, WATCHDOG_ACTIVATE_NOW );
+  _Thread_Enable_dispatch();
+  return( RTEMS_SUCCESSFUL );
+}
Index: cpukit/rtems/src/tasksetaffinity.c
===================================================================
--- cpukit/rtems/src/tasksetaffinity.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_set_affinity().
- */
-
-/*
- *  COPYRIGHT (c) 2014.
- *  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.
- *
- * 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/tasks.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_task_set_affinity(
-  rtems_id         id,
-  size_t           cpusetsize,
-  const cpu_set_t *cpuset
-)
-{
-  Thread_Control   *the_thread;
-  ISR_lock_Context  lock_context;
-  Per_CPU_Control  *cpu_self;
-  Status_Control    status;
-
-  if ( cpuset == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_thread = _Thread_Get( id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Thread_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
-  _Thread_State_acquire_critical( the_thread, &lock_context );
-
-  status = _Scheduler_Set_affinity(
-    the_thread,
-    cpusetsize,
-    cpuset
-  );
-
-  _Thread_State_release( the_thread, &lock_context );
-  _Thread_Dispatch_enable( cpu_self );
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/tasksetpriority.c
===================================================================
--- cpukit/rtems/src/tasksetpriority.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,129 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_set_priority().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/tasksimpl.h>
-#include <rtems/score/schedulerimpl.h>
-#include <rtems/score/threadimpl.h>
-
-static rtems_status_code _RTEMS_tasks_Set_priority(
-  Thread_Control          *the_thread,
-  const Scheduler_Control *scheduler,
-  Priority_Control         new_priority,
-  Thread_queue_Context    *queue_context
-)
-{
-  Priority_Control core_new_priority;
-  bool             valid;
-  Per_CPU_Control *cpu_self;
-
-  core_new_priority = _RTEMS_Priority_To_core(
-    scheduler,
-    new_priority,
-    &valid
-  );
-
-  if ( !valid ) {
-    _Thread_Wait_release( the_thread, queue_context );
-    return RTEMS_INVALID_PRIORITY;
-  }
-
-  _Thread_Priority_change(
-    the_thread,
-    &the_thread->Real_priority,
-    core_new_priority,
-    PRIORITY_GROUP_LAST,
-    queue_context
-  );
-  cpu_self = _Thread_queue_Dispatch_disable( queue_context );
-  _Thread_Wait_release( the_thread, queue_context );
-  _Thread_Priority_update( queue_context );
-  _Thread_Dispatch_enable( cpu_self );
-  return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code rtems_task_set_priority(
-  rtems_id             id,
-  rtems_task_priority  new_priority,
-  rtems_task_priority *old_priority_p
-)
-{
-  Thread_Control          *the_thread;
-  Thread_queue_Context     queue_context;
-  const Scheduler_Control *scheduler;
-  Priority_Control         old_priority;
-  rtems_status_code        status;
-
-  if ( old_priority_p == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  _Thread_queue_Context_initialize( &queue_context );
-  _Thread_queue_Context_clear_priority_updates( &queue_context );
-  the_thread = _Thread_Get( id, &queue_context.Lock_context.Lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _RTEMS_tasks_MP_Set_priority( id, new_priority, old_priority_p );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  _Thread_Wait_acquire_critical( the_thread, &queue_context );
-
-  scheduler = _Thread_Scheduler_get_home( the_thread );
-  old_priority = _Thread_Get_priority( the_thread );
-
-  if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
-    status = _RTEMS_tasks_Set_priority(
-      the_thread,
-      scheduler,
-      new_priority,
-      &queue_context
-    );
-  } else {
-    _Thread_Wait_release( the_thread, &queue_context );
-    status = RTEMS_SUCCESSFUL;
-  }
-
-  *old_priority_p = _RTEMS_Priority_From_core( scheduler, old_priority );
-  return status;
-}
Index: cpukit/rtems/src/tasksetscheduler.c
===================================================================
--- cpukit/rtems/src/tasksetscheduler.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,93 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_set_scheduler().
- */
-
-/*
- * Copyright (c) 2014 embedded brains GmbH & Co. KG
- *
- * 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/tasksimpl.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/schedulerimpl.h>
-
-rtems_status_code rtems_task_set_scheduler(
-  rtems_id            task_id,
-  rtems_id            scheduler_id,
-  rtems_task_priority priority
-)
-{
-  const Scheduler_Control *scheduler;
-  Thread_Control          *the_thread;
-  Thread_queue_Context     queue_context;
-  ISR_lock_Context         state_context;
-  Per_CPU_Control         *cpu_self;
-  bool                     valid;
-  Priority_Control         core_priority;
-  Status_Control           status;
-
-  scheduler = _Scheduler_Get_by_id( scheduler_id );
-  if ( scheduler == NULL ) {
-    return RTEMS_INVALID_ID;
-  }
-
-  core_priority = _RTEMS_Priority_To_core( scheduler, priority, &valid );
-  if ( !valid ) {
-    return RTEMS_INVALID_PRIORITY;
-  }
-
-  _Thread_queue_Context_initialize( &queue_context );
-  the_thread = _Thread_Get( task_id, &queue_context.Lock_context.Lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Thread_MP_Is_remote( task_id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  cpu_self = _Thread_queue_Dispatch_disable( &queue_context );
-  _Thread_Wait_acquire_critical( the_thread, &queue_context );
-  _Thread_State_acquire_critical( the_thread, &state_context );
-
-  status = _Scheduler_Set( scheduler, the_thread, core_priority );
-
-  _Thread_State_release_critical( the_thread, &state_context );
-  _Thread_Wait_release( the_thread, &queue_context );
-  _Thread_Dispatch_enable( cpu_self );
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/taskstart.c
===================================================================
--- cpukit/rtems/src/taskstart.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,84 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_start().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/tasks.h>
-#include <rtems/rtems/statusimpl.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_task_start(
-  rtems_id            id,
-  rtems_task_entry    entry_point,
-  rtems_task_argument argument
-)
-{
-  Thread_Entry_information entry = {
-    .adaptor = _Thread_Entry_adaptor_numeric,
-    .Kinds = {
-      .Numeric = {
-        .entry = entry_point,
-        .argument = argument
-      }
-    }
-  };
-  Thread_Control   *the_thread;
-  ISR_lock_Context  lock_context;
-  Status_Control    status;
-
-  if ( entry_point == NULL ) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  the_thread = _Thread_Get( id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    if ( _Thread_MP_Is_remote( id ) ) {
-      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
-    }
-#endif
-
-    return RTEMS_INVALID_ID;
-  }
-
-  status = _Thread_Start( the_thread, &entry, &lock_context );
-
-  return _Status_Get( status );
-}
Index: cpukit/rtems/src/tasksuspend.c
===================================================================
--- cpukit/rtems/src/tasksuspend.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_suspend().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.
- *
- * 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/tasksimpl.h>
-#include <rtems/score/threadimpl.h>
-
-rtems_status_code rtems_task_suspend(
-  rtems_id id
-)
-{
-  Thread_Control   *the_thread;
-  ISR_lock_Context  lock_context;
-  Per_CPU_Control  *cpu_self;
-  States_Control    previous_state;
-
-  the_thread = _Thread_Get( id, &lock_context );
-
-  if ( the_thread == NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
-    return _RTEMS_tasks_MP_Suspend( id );
-#else
-    return RTEMS_INVALID_ID;
-#endif
-  }
-
-  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
-  _ISR_lock_ISR_enable( &lock_context );
-
-  previous_state = _Thread_Set_state( the_thread, STATES_SUSPENDED );
-
-  _Thread_Dispatch_enable( cpu_self );
-  return _States_Is_suspended( previous_state ) ?
-    RTEMS_ALREADY_SUSPENDED : RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/taskwakeafter.c
===================================================================
--- cpukit/rtems/src/taskwakeafter.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_wake_after().
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  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.
- *
- * 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/tasks.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/watchdogimpl.h>
-
-rtems_status_code rtems_task_wake_after(
-  rtems_interval ticks
-)
-{
-  /*
-   * It is critical to obtain the executing thread after thread dispatching is
-   * disabled on SMP configurations.
-   */
-  Thread_Control  *executing;
-  Per_CPU_Control *cpu_self;
-
-  cpu_self = _Thread_Dispatch_disable();
-    executing = _Per_CPU_Get_executing( cpu_self );
-
-    if ( ticks == 0 ) {
-      _Thread_Yield( executing );
-    } else {
-      _Thread_Set_state( executing, STATES_WAITING_FOR_TIME );
-      _Thread_Wait_flags_set( executing, THREAD_WAIT_STATE_BLOCKED );
-      _Thread_Add_timeout_ticks( executing, cpu_self, ticks );
-    }
-  _Thread_Dispatch_direct( cpu_self );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/taskwakewhen.c
===================================================================
--- cpukit/rtems/src/taskwakewhen.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,83 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTask
- *
- * @brief This source file contains the implementation of
- *   rtems_task_wake_when().
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  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.
- *
- * 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/tasks.h>
-#include <rtems/rtems/clockimpl.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/todimpl.h>
-#include <rtems/score/watchdogimpl.h>
-
-rtems_status_code rtems_task_wake_when(
-  const rtems_time_of_day *time_buffer
-)
-{
-  uint32_t          seconds;
-  Thread_Control   *executing;
-  Per_CPU_Control  *cpu_self;
-  rtems_status_code status;
-
-  if ( !_TOD_Is_set() )
-    return RTEMS_NOT_DEFINED;
-
-  status = _TOD_Validate( time_buffer, TOD_DISABLE_TICKS_VALIDATION );
-
-  if ( status != RTEMS_SUCCESSFUL ) {
-    return status;
-  }
-
-  seconds = _TOD_To_seconds( time_buffer );
-
-  if ( seconds <= _TOD_Seconds_since_epoch() )
-    return RTEMS_INVALID_CLOCK;
-
-  cpu_self = _Thread_Dispatch_disable();
-    executing = _Per_CPU_Get_executing( cpu_self );
-    _Thread_Set_state( executing, STATES_WAITING_FOR_TIME );
-    _Thread_Wait_flags_set( executing, THREAD_WAIT_STATE_BLOCKED );
-    _Thread_Timer_insert_realtime(
-      executing,
-      cpu_self,
-      _Thread_Timeout,
-      _Watchdog_Ticks_from_seconds( seconds )
-    );
-  _Thread_Dispatch_direct( cpu_self );
-  return RTEMS_SUCCESSFUL;
-}
Index: cpukit/rtems/src/timercancel.c
===================================================================
--- cpukit/rtems/src/timercancel.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the implementation of
- *   rtems_timer_cancel().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/timerimpl.h>
-
-rtems_status_code rtems_timer_cancel(
-  rtems_id id
-)
-{
-  Timer_Control    *the_timer;
-  ISR_lock_Context  lock_context;
-
-  the_timer = _Timer_Get( id, &lock_context );
-  if ( the_timer != NULL ) {
-    Per_CPU_Control *cpu;
-
-    cpu = _Timer_Acquire_critical( the_timer, &lock_context );
-    _Timer_Cancel( cpu, the_timer );
-    _Timer_Release( cpu, &lock_context );
-    return RTEMS_SUCCESSFUL;
-  }
-
-  return RTEMS_INVALID_ID;
-}
Index: cpukit/rtems/src/timercreate.c
===================================================================
--- cpukit/rtems/src/timercreate.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,253 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the definition of ::_Timer_server and the
- *   implementation of _Timer_Routine_adaptor(), _Timer_Fire(),
- *   _Timer_Fire_after(), _Timer_Fire_when(), _Timer_Cancel(), and the Timer
- *   Manager system initialization.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2002.
- *  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.
- *
- * 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/timerimpl.h>
-#include <rtems/rtems/clockimpl.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/assert.h>
-#include <rtems/score/chainimpl.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/todimpl.h>
-#include <rtems/score/watchdogimpl.h>
-#include <rtems/sysinit.h>
-
-RTEMS_STATIC_ASSERT(
-  PER_CPU_WATCHDOG_REALTIME == TIMER_CLASS_BIT_TIME_OF_DAY,
-  TIMER_CLASS_BIT_TIME_OF_DAY
-);
-
-Timer_server_Control *volatile _Timer_server;
-
-void _Timer_Routine_adaptor( Watchdog_Control *the_watchdog )
-{
-  Timer_Control   *the_timer;
-  Per_CPU_Control *cpu;
-
-  the_timer = RTEMS_CONTAINER_OF( the_watchdog, Timer_Control, Ticker );
-  cpu = _Watchdog_Get_CPU( &the_timer->Ticker );
-  the_timer->stop_time = _Timer_Get_CPU_ticks( cpu );
-
-  ( *the_timer->routine )( the_timer->Object.id, the_timer->user_data );
-}
-
-rtems_status_code _Timer_Fire(
-  rtems_id                           id,
-  rtems_interval                     interval,
-  rtems_timer_service_routine_entry  routine,
-  void                              *user_data,
-  Timer_Classes                      the_class,
-  Watchdog_Service_routine_entry     adaptor
-)
-{
-  Timer_Control    *the_timer;
-  ISR_lock_Context  lock_context;
-
-  the_timer = _Timer_Get( id, &lock_context );
-  if ( the_timer != NULL ) {
-    Per_CPU_Control *cpu;
-
-    cpu = _Timer_Acquire_critical( the_timer, &lock_context );
-    _Timer_Cancel( cpu, the_timer );
-    _Watchdog_Initialize( &the_timer->Ticker, adaptor );
-    the_timer->the_class = the_class;
-    the_timer->routine = routine;
-    the_timer->user_data = user_data;
-    the_timer->initial = interval;
-    the_timer->start_time = _Timer_Get_CPU_ticks( cpu );
-
-    if ( _Timer_Is_interval_class( the_class ) ) {
-      _Watchdog_Insert(
-        &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
-        &the_timer->Ticker,
-        cpu->Watchdog.ticks + interval
-      );
-    } else {
-      _Watchdog_Insert(
-        &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ],
-        &the_timer->Ticker,
-        _Watchdog_Ticks_from_seconds( interval )
-      );
-    }
-
-    _Timer_Release( cpu, &lock_context );
-    return RTEMS_SUCCESSFUL;
-  }
-
-  return RTEMS_INVALID_ID;
-}
-
-rtems_status_code _Timer_Fire_after(
-  rtems_id                           id,
-  rtems_interval                     ticks,
-  rtems_timer_service_routine_entry  routine,
-  void                              *user_data,
-  Timer_Classes                      the_class,
-  Watchdog_Service_routine_entry     adaptor
-)
-{
-  if ( ticks == 0 )
-    return RTEMS_INVALID_NUMBER;
-
-  if ( !routine )
-    return RTEMS_INVALID_ADDRESS;
-
-  return _Timer_Fire(
-    id,
-    ticks,
-    routine,
-    user_data,
-    the_class,
-    adaptor
-  );
-}
-
-rtems_status_code _Timer_Fire_when(
-  rtems_id                           id,
-  const rtems_time_of_day           *wall_time,
-  rtems_timer_service_routine_entry  routine,
-  void                              *user_data,
-  Timer_Classes                      the_class,
-  Watchdog_Service_routine_entry     adaptor
-)
-{
-  rtems_status_code status;
-  rtems_interval    seconds;
-
-  if ( !_TOD_Is_set() )
-    return RTEMS_NOT_DEFINED;
-
-  if ( !routine )
-    return RTEMS_INVALID_ADDRESS;
-
-  status = _TOD_Validate( wall_time, TOD_ENABLE_TICKS_VALIDATION );
-
-  if ( status != RTEMS_SUCCESSFUL ) {
-    return status;
-  }
-
-  seconds = _TOD_To_seconds( wall_time );
-  if ( seconds <= _TOD_Seconds_since_epoch() )
-    return RTEMS_INVALID_CLOCK;
-
-  return _Timer_Fire(
-    id,
-    seconds,
-    routine,
-    user_data,
-    the_class,
-    adaptor
-  );
-}
-
-void _Timer_Cancel( Per_CPU_Control *cpu, Timer_Control *the_timer )
-{
-  Timer_Classes the_class;
-
-  the_class = the_timer->the_class;
-
-  if ( _Watchdog_Is_scheduled( &the_timer->Ticker ) ) {
-    the_timer->stop_time = _Timer_Get_CPU_ticks( cpu );
-    _Watchdog_Remove(
-      &cpu->Watchdog.Header[ _Timer_Watchdog_header_index( the_class ) ],
-      &the_timer->Ticker
-    );
-  } else if ( _Timer_Is_on_task_class( the_class ) ) {
-    Timer_server_Control *timer_server;
-    ISR_lock_Context      lock_context;
-
-    timer_server = _Timer_server;
-    _Assert( timer_server != NULL );
-    _Timer_server_Acquire_critical( timer_server, &lock_context );
-
-    if ( _Watchdog_Get_state( &the_timer->Ticker ) == WATCHDOG_PENDING ) {
-      _Watchdog_Set_state( &the_timer->Ticker, WATCHDOG_INACTIVE );
-      _Chain_Extract_unprotected( &the_timer->Ticker.Node.Chain );
-    }
-
-    _Timer_server_Release_critical( timer_server, &lock_context );
-  }
-}
-
-rtems_status_code rtems_timer_create(
-  rtems_name  name,
-  rtems_id   *id
-)
-{
-  Timer_Control *the_timer;
-
-  if ( !rtems_is_name_valid( name ) )
-    return RTEMS_INVALID_NAME;
-
-  if ( !id )
-    return RTEMS_INVALID_ADDRESS;
-
-  the_timer = _Timer_Allocate();
-
-  if ( !the_timer ) {
-    _Objects_Allocator_unlock();
-    return RTEMS_TOO_MANY;
-  }
-
-  the_timer->the_class = TIMER_DORMANT;
-  _Watchdog_Preinitialize( &the_timer->Ticker, _Per_CPU_Get_snapshot() );
-
-  *id = _Objects_Open_u32(
-    &_Timer_Information,
-    &the_timer->Object,
-    name
-  );
-  _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
-}
-
-static void _Timer_Manager_initialization( void )
-{
-  _Objects_Initialize_information( &_Timer_Information );
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Timer_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_TIMER,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/rtems/src/timerdelete.c
===================================================================
--- cpukit/rtems/src/timerdelete.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the implementation of
- *   rtems_timer_delete().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/timerimpl.h>
-
-rtems_status_code rtems_timer_delete(
-  rtems_id id
-)
-{
-  Timer_Control    *the_timer;
-  ISR_lock_Context  lock_context;
-
-  _Objects_Allocator_lock();
-
-  the_timer = _Timer_Get( id, &lock_context );
-  if ( the_timer != NULL ) {
-    Per_CPU_Control *cpu;
-
-    _Objects_Close( &_Timer_Information, &the_timer->Object );
-    cpu = _Timer_Acquire_critical( the_timer, &lock_context );
-    _Timer_Cancel( cpu, the_timer );
-    _Timer_Release( cpu, &lock_context );
-    _Timer_Free( the_timer );
-    _Objects_Allocator_unlock();
-    return RTEMS_SUCCESSFUL;
-  }
-
-  _Objects_Allocator_unlock();
-  return RTEMS_INVALID_ID;
-}
Index: cpukit/rtems/src/timerfireafter.c
===================================================================
--- cpukit/rtems/src/timerfireafter.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the implementation of
- *   rtems_timer_fire_after().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/timerimpl.h>
-
-rtems_status_code rtems_timer_fire_after(
-  rtems_id                           id,
-  rtems_interval                     ticks,
-  rtems_timer_service_routine_entry  routine,
-  void                              *user_data
-)
-{
-  return _Timer_Fire_after(
-    id,
-    ticks,
-    routine,
-    user_data,
-    TIMER_INTERVAL,
-    _Timer_Routine_adaptor
-  );
-}
Index: cpukit/rtems/src/timerfirewhen.c
===================================================================
--- cpukit/rtems/src/timerfirewhen.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the implementation of
- *   rtems_timer_fire_when().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/timerimpl.h>
-
-rtems_status_code rtems_timer_fire_when(
-  rtems_id                            id,
-  const rtems_time_of_day            *wall_time,
-  rtems_timer_service_routine_entry   routine,
-  void                               *user_data
-)
-{
-  return _Timer_Fire_when(
-    id,
-    wall_time,
-    routine,
-    user_data,
-    TIMER_TIME_OF_DAY,
-    _Timer_Routine_adaptor
-  );
-}
Index: cpukit/rtems/src/timergetinfo.c
===================================================================
--- cpukit/rtems/src/timergetinfo.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the implementation of
- *   rtems_timer_get_information().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/timerimpl.h>
-
-rtems_status_code rtems_timer_get_information(
-  rtems_id                 id,
-  rtems_timer_information *the_info
-)
-{
-  Timer_Control    *the_timer;
-  ISR_lock_Context  lock_context;
-
-  if ( !the_info )
-    return RTEMS_INVALID_ADDRESS;
-
-  the_timer = _Timer_Get( id, &lock_context );
-  if ( the_timer != NULL ) {
-    Per_CPU_Control *cpu;
-
-    cpu = _Timer_Acquire_critical( the_timer, &lock_context );
-    the_info->the_class  = the_timer->the_class;
-    the_info->initial    = the_timer->initial;
-    the_info->start_time = the_timer->start_time;
-    the_info->stop_time  = the_timer->stop_time;
-    _Timer_Release( cpu, &lock_context );
-    return RTEMS_SUCCESSFUL;
-  }
-
-  return RTEMS_INVALID_ID;
-}
Index: cpukit/rtems/src/timerident.c
===================================================================
--- cpukit/rtems/src/timerident.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the implementation of
- *   rtems_timer_ident().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- * 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.
- *
- * 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/timerimpl.h>
-#include <rtems/rtems/objectimpl.h>
-
-rtems_status_code rtems_timer_ident( rtems_name name, rtems_id *id )
-{
-  return _RTEMS_Name_to_id(
-    name,
-    OBJECTS_SEARCH_LOCAL_NODE,
-    id,
-    &_Timer_Information
-  );
-}
Index: cpukit/rtems/src/timerreset.c
===================================================================
--- cpukit/rtems/src/timerreset.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the implementation of
- *   rtems_timer_reset().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/timerimpl.h>
-
-rtems_status_code rtems_timer_reset(
-  rtems_id id
-)
-{
-  Timer_Control    *the_timer;
-  ISR_lock_Context  lock_context;
-
-  the_timer = _Timer_Get( id, &lock_context );
-  if ( the_timer != NULL ) {
-    Per_CPU_Control   *cpu;
-    rtems_status_code  status;
-
-    cpu = _Timer_Acquire_critical( the_timer, &lock_context );
-
-    if ( _Timer_Is_interval_class( the_timer->the_class ) ) {
-      _Timer_Cancel( cpu, the_timer );
-      _Watchdog_Insert(
-        &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
-        &the_timer->Ticker,
-        cpu->Watchdog.ticks + the_timer->initial
-      );
-      status = RTEMS_SUCCESSFUL;
-    } else {
-      status = RTEMS_NOT_DEFINED;
-    }
-
-    _Timer_Release( cpu, &lock_context );
-    return status;
-  }
-
-  return RTEMS_INVALID_ID;
-}
Index: cpukit/rtems/src/timerserver.c
===================================================================
--- cpukit/rtems/src/timerserver.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,252 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the implementation of
- *   rtems_timer_initiate_server().
- */
-
-/*  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  Copyright (C) 2009, 2017 embedded brains GmbH & Co. KG
- *
- * 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.h>
-#include <rtems/rtems/timerimpl.h>
-#include <rtems/rtems/tasksimpl.h>
-#include <rtems/score/todimpl.h>
-
-static Timer_server_Control _Timer_server_Default;
-
-static void _Timer_server_Acquire(
-  Timer_server_Control *ts,
-  ISR_lock_Context     *lock_context
-)
-{
-  _ISR_lock_ISR_disable_and_acquire( &ts->Lock, lock_context );
-}
-
-static void _Timer_server_Release(
-  Timer_server_Control *ts,
-  ISR_lock_Context     *lock_context
-)
-{
-  _ISR_lock_Release_and_ISR_enable( &ts->Lock, lock_context );
-}
-
-void _Timer_server_Routine_adaptor( Watchdog_Control *the_watchdog )
-{
-  Timer_Control        *the_timer;
-  ISR_lock_Context      lock_context;
-  Per_CPU_Control      *cpu;
-  Timer_server_Control *ts;
-  bool                  wakeup;
-
-  ts = _Timer_server;
-  _Assert( ts != NULL );
-  the_timer = RTEMS_CONTAINER_OF( the_watchdog, Timer_Control, Ticker );
-
-  _Timer_server_Acquire( ts, &lock_context );
-
-  _Assert( _Watchdog_Get_state( &the_timer->Ticker ) == WATCHDOG_INACTIVE );
-  _Watchdog_Set_state( &the_timer->Ticker, WATCHDOG_PENDING );
-  cpu = _Watchdog_Get_CPU( &the_timer->Ticker );
-  the_timer->stop_time = _Timer_Get_CPU_ticks( cpu );
-  wakeup = _Chain_Is_empty( &ts->Pending );
-  _Chain_Append_unprotected( &ts->Pending, &the_timer->Ticker.Node.Chain );
-
-  _Timer_server_Release( ts, &lock_context );
-
-  if ( wakeup ) {
-    (void) rtems_event_system_send( ts->server_id, RTEMS_EVENT_SYSTEM_SERVER );
-  }
-}
-
-/**
- *  @brief Timer server body.
- *
- *  This is the server for task based timers.  This task executes whenever a
- *  task-based timer should fire.  It services both "after" and "when" timers.
- *  It is not created automatically but must be created explicitly by the
- *  application before task-based timers may be initiated.  The parameter
- *  @a arg points to the corresponding timer server control block.
- */
-static rtems_task _Timer_server_Body(
-  rtems_task_argument arg
-)
-{
-  Timer_server_Control *ts = (Timer_server_Control *) arg;
-#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
-  Thread_Control *executing = _Thread_Get_executing();
-#endif
-
-  while ( true ) {
-    ISR_lock_Context  lock_context;
-    rtems_event_set   events;
-
-    _Timer_server_Acquire( ts, &lock_context );
-
-    while ( true ) {
-      Watchdog_Control                  *the_watchdog;
-      Timer_Control                     *the_timer;
-      rtems_timer_service_routine_entry  routine;
-      Objects_Id                         id;
-      void                              *user_data;
-
-      the_watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &ts->Pending );
-      if ( the_watchdog == NULL ) {
-        break;
-      }
-
-      _Assert( _Watchdog_Get_state( the_watchdog ) == WATCHDOG_PENDING );
-      _Watchdog_Set_state( the_watchdog, WATCHDOG_INACTIVE );
-      the_timer = RTEMS_CONTAINER_OF( the_watchdog, Timer_Control, Ticker );
-      routine = the_timer->routine;
-      id = the_timer->Object.id;
-      user_data = the_timer->user_data;
-
-      _Timer_server_Release( ts, &lock_context );
-
-      ( *routine )( id, user_data );
-#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
-      _Assert( !_Thread_Owns_resources( executing ) );
-#endif
-
-      _Timer_server_Acquire( ts, &lock_context );
-    }
-
-    _Timer_server_Release( ts, &lock_context );
-
-    (void) rtems_event_system_receive(
-      RTEMS_EVENT_SYSTEM_SERVER,
-      RTEMS_EVENT_ALL | RTEMS_WAIT,
-      RTEMS_NO_TIMEOUT,
-      &events
-    );
-  }
-}
-
-static rtems_status_code _Timer_server_Initiate(
-  rtems_task_priority priority,
-  size_t              stack_size,
-  rtems_attribute     attribute_set
-)
-{
-  rtems_status_code     status;
-  rtems_id              id;
-  Timer_server_Control *ts;
-
-  /*
-   *  Just to make sure this is only called once.
-   */
-  if ( _Timer_server != NULL ) {
-    return RTEMS_INCORRECT_STATE;
-  }
-
-  if ( priority == RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) {
-    priority = PRIORITY_MINIMUM;
-  }
-
-  /*
-   *  Create the Timer Server with the name the name of "TIME".  The attribute
-   *  RTEMS_SYSTEM_TASK allows us to set a priority to 0 which will makes it
-   *  higher than any other task in the system.  It can be viewed as a low
-   *  priority interrupt.  It is also always NO_PREEMPT so it looks like
-   *  an interrupt to other tasks.
-   *
-   *  We allow the user to override the default priority because the Timer
-   *  Server can invoke TSRs which must adhere to language run-time or
-   *  other library rules.  For example, if using a TSR written in Ada the
-   *  Server should run at the same priority as the priority Ada task.
-   *  Otherwise, the priority ceiling for the mutex used to protect the
-   *  GNAT run-time is violated.
-   */
-  status = rtems_task_create(
-    rtems_build_name('T','I','M','E'),
-    priority,
-    stack_size,
-#ifdef RTEMS_SMP
-    RTEMS_DEFAULT_MODES, /* no preempt is not recommended for SMP */
-#else
-    RTEMS_NO_PREEMPT,    /* no preempt is like an interrupt */
-#endif
-    /* user may want floating point but we need */
-    /*   system task specified for 0 priority */
-    attribute_set | RTEMS_SYSTEM_TASK,
-    &id
-  );
-  if (status != RTEMS_SUCCESSFUL) {
-    return status;
-  }
-
-  /*
-   *  Do all the data structure initialization before starting the
-   *  Timer Server so we do not have to have a critical section.
-   */
-
-  ts = &_Timer_server_Default;
-  _ISR_lock_Initialize( &ts->Lock, "Timer Server" );
-  _Chain_Initialize_empty( &ts->Pending );
-  ts->server_id = id;
-
-  /*
-   * The default timer server is now available.
-   */
-  _Timer_server = ts;
-
-  /*
-   *  Start the timer server
-   */
-  status = rtems_task_start(
-    id,
-    _Timer_server_Body,
-    (rtems_task_argument) ts
-  );
-  _Assert( status == RTEMS_SUCCESSFUL );
-
-  return status;
-}
-
-rtems_status_code rtems_timer_initiate_server(
-  rtems_task_priority priority,
-  size_t              stack_size,
-  rtems_attribute     attribute_set
-)
-{
-  rtems_status_code status;
-
-  _Objects_Allocator_lock();
-  status = _Timer_server_Initiate( priority, stack_size, attribute_set );
-  _Objects_Allocator_unlock();
-
-  return status;
-}
Index: cpukit/rtems/src/timerserverfireafter.c
===================================================================
--- cpukit/rtems/src/timerserverfireafter.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the implementation of
- *   rtems_timer_server_fire_after().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/timerimpl.h>
-
-rtems_status_code rtems_timer_server_fire_after(
-  rtems_id                           id,
-  rtems_interval                     ticks,
-  rtems_timer_service_routine_entry  routine,
-  void                              *user_data
-)
-{
-  Timer_server_Control *timer_server;
-
-  timer_server = _Timer_server;
-
-  if ( !timer_server )
-    return RTEMS_INCORRECT_STATE;
-
-  return _Timer_Fire_after(
-    id,
-    ticks,
-    routine,
-    user_data,
-    TIMER_INTERVAL_ON_TASK,
-    _Timer_server_Routine_adaptor
-  );
-}
Index: cpukit/rtems/src/timerserverfirewhen.c
===================================================================
--- cpukit/rtems/src/timerserverfirewhen.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassicTimer
- *
- * @brief This source file contains the implementation of
- *   rtems_timer_server_fire_when().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  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.
- *
- * 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/timerimpl.h>
-
-rtems_status_code rtems_timer_server_fire_when(
-  rtems_id                           id,
-  const rtems_time_of_day            *wall_time,
-  rtems_timer_service_routine_entry  routine,
-  void                              *user_data
-)
-{
-  Timer_server_Control *timer_server;
-
-  timer_server = _Timer_server;
-
-  if ( !timer_server )
-    return RTEMS_INCORRECT_STATE;
-
-  return _Timer_Fire_when(
-    id,
-    wall_time,
-    routine,
-    user_data,
-    TIMER_TIME_OF_DAY_ON_TASK,
-    _Timer_server_Routine_adaptor
-  );
-}
Index: cpukit/rtems/src/workspace.c
===================================================================
--- cpukit/rtems/src/workspace.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassic
- *
- * @brief This source file contains the implementation of
- *   rtems_workspace_get_information(), rtems_workspace_allocate(), and
- *   rtems_workspace_free().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2009.
- *  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.
- *
- * 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/wkspace.h>
-#include <rtems/score/protectedheap.h>
-#include <rtems/score/interr.h>
-#include <rtems/config.h>
-#include <rtems/rtems/support.h>
-
-#include <string.h>  /* for memset */
-
-bool rtems_workspace_get_information(
-  Heap_Information_block  *the_info
-)
-{
-  if ( !the_info )
-    return false;
-
-  return _Protected_heap_Get_information( &_Workspace_Area, the_info );
-}
-
-bool rtems_workspace_allocate(
-  size_t      bytes,
-  void      **pointer
-)
-{
-  void *ptr;
-
-  /*
-   * check the arguments
-   */
-  if ( !pointer )
-    return false;
-
-  if ( !bytes )
-    return false;
-
-  /*
-   * Allocate the memory
-   */
-  ptr =  _Protected_heap_Allocate( &_Workspace_Area, bytes );
-  if (!ptr)
-    return false;
-
-  *pointer = ptr;
-  return true;
-}
-
-bool rtems_workspace_free(
-  void *pointer
-)
-{
-   return _Protected_heap_Free( &_Workspace_Area, pointer );
-}
-
Index: cpukit/rtems/src/workspacegreedy.c
===================================================================
--- cpukit/rtems/src/workspacegreedy.c	(revision 17f744b8c81be98f68d53a82583c9a0b1c690579)
+++ 	(revision )
@@ -1,93 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSImplClassic
- *
- * @brief This source file contains the implementation of
- *   rtems_workspace_greedy_allocate(),
- *   rtems_workspace_greedy_allocate_all_except_largest(), and
- *   rtems_workspace_greedy_free().
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * 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/support.h>
-#include <rtems/score/apimutex.h>
-#include <rtems/score/heapimpl.h>
-#include <rtems/score/threaddispatch.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/malloc.h>
-
-#define SBRK_ALLOC_SIZE (128 * 1024UL * 1024UL)
-
-void *rtems_workspace_greedy_allocate(
-  const uintptr_t *block_sizes,
-  size_t block_count
-)
-{
-  Heap_Control *heap = &_Workspace_Area;
-  void *opaque;
-
-  rtems_heap_sbrk_greedy_allocate( heap, SBRK_ALLOC_SIZE );
-
-  _RTEMS_Lock_allocator();
-  opaque = _Heap_Greedy_allocate( heap, block_sizes, block_count );
-  _RTEMS_Unlock_allocator();
-
-  return opaque;
-}
-
-void *rtems_workspace_greedy_allocate_all_except_largest(
-  uintptr_t *allocatable_size
-)
-{
-  Heap_Control *heap = &_Workspace_Area;
-  void *opaque;
-
-  rtems_heap_sbrk_greedy_allocate( heap, SBRK_ALLOC_SIZE );
-
-  _RTEMS_Lock_allocator();
-  opaque = _Heap_Greedy_allocate_all_except_largest(
-    heap,
-    allocatable_size
-  );
-  _RTEMS_Unlock_allocator();
-
-  return opaque;
-}
-
-void rtems_workspace_greedy_free( void *opaque )
-{
-  _RTEMS_Lock_allocator();
-  _Heap_Greedy_free( &_Workspace_Area, opaque );
-  _RTEMS_Unlock_allocator();
-}
