From 242887bc5698ac84261625013cc39112d2ce38eb Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 13 Sep 2018 06:19:05 +0200 Subject: Rename files to make them unique within cpukit This allows to build librtemscpu.a in one rush in the future. --- cpukit/posix/Makefile.am | 4 +- cpukit/posix/src/psxsemaphore.c | 59 ++++++++++++++++++ cpukit/posix/src/psxtimercreate.c | 101 +++++++++++++++++++++++++++++++ cpukit/posix/src/psxtimerdelete.c | 71 ++++++++++++++++++++++ cpukit/posix/src/semaphore.c | 59 ------------------ cpukit/posix/src/timercreate.c | 101 ------------------------------- cpukit/posix/src/timerdelete.c | 71 ---------------------- cpukit/sapi/Makefile.am | 2 +- cpukit/sapi/src/rbtreeinsert.c | 58 ------------------ cpukit/sapi/src/sapirbtreeinsert.c | 58 ++++++++++++++++++ cpukit/score/cpu/sparc/Makefile.am | 2 +- cpukit/score/cpu/sparc/access.S | 109 ---------------------------------- cpukit/score/cpu/sparc/sparc-access.S | 109 ++++++++++++++++++++++++++++++++++ 13 files changed, 402 insertions(+), 402 deletions(-) create mode 100644 cpukit/posix/src/psxsemaphore.c create mode 100644 cpukit/posix/src/psxtimercreate.c create mode 100644 cpukit/posix/src/psxtimerdelete.c delete mode 100644 cpukit/posix/src/semaphore.c delete mode 100644 cpukit/posix/src/timercreate.c delete mode 100644 cpukit/posix/src/timerdelete.c delete mode 100644 cpukit/sapi/src/rbtreeinsert.c create mode 100644 cpukit/sapi/src/sapirbtreeinsert.c delete mode 100644 cpukit/score/cpu/sparc/access.S create mode 100644 cpukit/score/cpu/sparc/sparc-access.S (limited to 'cpukit') diff --git a/cpukit/posix/Makefile.am b/cpukit/posix/Makefile.am index 5935efa568..12d7c0def4 100644 --- a/cpukit/posix/Makefile.am +++ b/cpukit/posix/Makefile.am @@ -168,7 +168,7 @@ libposix_a_SOURCES += src/sigpending.c \ src/sigwait.c src/sigwaitinfo.c src/signal_2.c src/ualarm.c ## SEMAPHORE_C_FILES -libposix_a_SOURCES += src/semaphore.c +libposix_a_SOURCES += src/psxsemaphore.c libposix_a_SOURCES += src/semaphoredeletesupp.c libposix_a_SOURCES += src/semclose.c libposix_a_SOURCES += src/semopen.c @@ -178,7 +178,7 @@ libposix_a_SOURCES += src/semunlink.c libposix_a_SOURCES += src/adjtime.c src/clockgetcpuclockid.c ## TIMER_C_FILES -libposix_a_SOURCES += src/ptimer.c src/timercreate.c src/timerdelete.c \ +libposix_a_SOURCES += src/ptimer.c src/psxtimercreate.c src/psxtimerdelete.c \ src/timergetoverrun.c src/timergettime.c src/timersettime.c ## ITIMER_C_FILES diff --git a/cpukit/posix/src/psxsemaphore.c b/cpukit/posix/src/psxsemaphore.c new file mode 100644 index 0000000000..a82ad17966 --- /dev/null +++ b/cpukit/posix/src/psxsemaphore.c @@ -0,0 +1,59 @@ +/** + * @file + * + * @brief POSIX Function Initializes Semaphore Manager + * @ingroup POSIXAPI + */ + +/* + * COPYRIGHT (c) 1989-2008. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include + +Objects_Information _POSIX_Semaphore_Information; + +/* + * _POSIX_Semaphore_Manager_initialization + * + * This routine initializes all semaphore manager related data structures. + * + * Input parameters: NONE + * + * Output parameters: NONE + */ + +static void _POSIX_Semaphore_Manager_initialization(void) +{ + _Objects_Initialize_information( + &_POSIX_Semaphore_Information, /* object information table */ + OBJECTS_POSIX_API, /* object API */ + OBJECTS_POSIX_SEMAPHORES, /* object class */ + Configuration_POSIX_API.maximum_semaphores, + /* maximum objects of this class */ + sizeof( POSIX_Semaphore_Control ), + /* size of this object's control block */ + true, /* true if names for this object are strings */ + _POSIX_PATH_MAX, /* maximum length of each object's name */ + NULL /* Proxy extraction support callout */ + ); +} + +RTEMS_SYSINIT_ITEM( + _POSIX_Semaphore_Manager_initialization, + RTEMS_SYSINIT_POSIX_SEMAPHORE, + RTEMS_SYSINIT_ORDER_MIDDLE +); diff --git a/cpukit/posix/src/psxtimercreate.c b/cpukit/posix/src/psxtimercreate.c new file mode 100644 index 0000000000..5123071d99 --- /dev/null +++ b/cpukit/posix/src/psxtimercreate.c @@ -0,0 +1,101 @@ +/** + * @file + * + * @brief Create a Per-Process Timer + * @ingroup POSIX_PRIV_TIMERS Timers + */ + +/* + * 14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264 + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +int timer_create( + clockid_t clock_id, + struct sigevent *__restrict evp, + timer_t *__restrict timerid +) +{ + POSIX_Timer_Control *ptimer; + + if ( clock_id != CLOCK_REALTIME ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + if ( !timerid ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + /* + * The data of the structure evp are checked in order to verify if they + * are coherent. + */ + + if (evp != NULL) { + /* The structure has data */ + if ( ( evp->sigev_notify != SIGEV_NONE ) && + ( evp->sigev_notify != SIGEV_SIGNAL ) ) { + /* The value of the field sigev_notify is not valid */ + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + if ( !evp->sigev_signo ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + if ( !is_valid_signo(evp->sigev_signo) ) + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + /* + * Allocate a timer + */ + ptimer = _POSIX_Timer_Allocate(); + if ( !ptimer ) { + _Objects_Allocator_unlock(); + rtems_set_errno_and_return_minus_one( EAGAIN ); + } + + /* The data of the created timer are stored to use them later */ + + ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; + ptimer->thread_id = _Thread_Get_executing()->Object.id; + + if ( evp != NULL ) { + ptimer->inf.sigev_notify = evp->sigev_notify; + ptimer->inf.sigev_signo = evp->sigev_signo; + ptimer->inf.sigev_value = evp->sigev_value; + } + + ptimer->overrun = 0; + ptimer->timer_data.it_value.tv_sec = 0; + ptimer->timer_data.it_value.tv_nsec = 0; + ptimer->timer_data.it_interval.tv_sec = 0; + ptimer->timer_data.it_interval.tv_nsec = 0; + + _Watchdog_Preinitialize( &ptimer->Timer, _Per_CPU_Get_snapshot() ); + _Watchdog_Initialize( &ptimer->Timer, _POSIX_Timer_TSR ); + _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); + + *timerid = ptimer->Object.id; + _Objects_Allocator_unlock(); + return 0; +} diff --git a/cpukit/posix/src/psxtimerdelete.c b/cpukit/posix/src/psxtimerdelete.c new file mode 100644 index 0000000000..7670838ac2 --- /dev/null +++ b/cpukit/posix/src/psxtimerdelete.c @@ -0,0 +1,71 @@ +/** + * @file + * + * @brief Deletes a POSIX Interval Timer + * @ingroup POSIXAPI + */ + +/* + * 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266 + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include + + +int timer_delete( + timer_t timerid +) +{ + /* + * IDEA: This function must probably stop the timer first and then delete it + * + * It will have to do a call to rtems_timer_cancel and then another + * call to rtems_timer_delete. + * The call to rtems_timer_delete will be probably unnecessary, + * because rtems_timer_delete stops the timer before deleting it. + */ + POSIX_Timer_Control *ptimer; + ISR_lock_Context lock_context; + + _Objects_Allocator_lock(); + + ptimer = _POSIX_Timer_Get( timerid, &lock_context ); + if ( ptimer != NULL ) { + Per_CPU_Control *cpu; + + _Objects_Close( &_POSIX_Timer_Information, &ptimer->Object ); + cpu = _POSIX_Timer_Acquire_critical( ptimer, &lock_context ); + ptimer->state = POSIX_TIMER_STATE_FREE; + _Watchdog_Remove( + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ], + &ptimer->Timer + ); + _POSIX_Timer_Release( cpu, &lock_context ); + _POSIX_Timer_Free( ptimer ); + _Objects_Allocator_unlock(); + return 0; + } + + _Objects_Allocator_unlock(); + + rtems_set_errno_and_return_minus_one( EINVAL ); +} diff --git a/cpukit/posix/src/semaphore.c b/cpukit/posix/src/semaphore.c deleted file mode 100644 index a82ad17966..0000000000 --- a/cpukit/posix/src/semaphore.c +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * - * @brief POSIX Function Initializes Semaphore Manager - * @ingroup POSIXAPI - */ - -/* - * COPYRIGHT (c) 1989-2008. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include - -Objects_Information _POSIX_Semaphore_Information; - -/* - * _POSIX_Semaphore_Manager_initialization - * - * This routine initializes all semaphore manager related data structures. - * - * Input parameters: NONE - * - * Output parameters: NONE - */ - -static void _POSIX_Semaphore_Manager_initialization(void) -{ - _Objects_Initialize_information( - &_POSIX_Semaphore_Information, /* object information table */ - OBJECTS_POSIX_API, /* object API */ - OBJECTS_POSIX_SEMAPHORES, /* object class */ - Configuration_POSIX_API.maximum_semaphores, - /* maximum objects of this class */ - sizeof( POSIX_Semaphore_Control ), - /* size of this object's control block */ - true, /* true if names for this object are strings */ - _POSIX_PATH_MAX, /* maximum length of each object's name */ - NULL /* Proxy extraction support callout */ - ); -} - -RTEMS_SYSINIT_ITEM( - _POSIX_Semaphore_Manager_initialization, - RTEMS_SYSINIT_POSIX_SEMAPHORE, - RTEMS_SYSINIT_ORDER_MIDDLE -); diff --git a/cpukit/posix/src/timercreate.c b/cpukit/posix/src/timercreate.c deleted file mode 100644 index 5123071d99..0000000000 --- a/cpukit/posix/src/timercreate.c +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @file - * - * @brief Create a Per-Process Timer - * @ingroup POSIX_PRIV_TIMERS Timers - */ - -/* - * 14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264 - * - * COPYRIGHT (c) 1989-2007. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -int timer_create( - clockid_t clock_id, - struct sigevent *__restrict evp, - timer_t *__restrict timerid -) -{ - POSIX_Timer_Control *ptimer; - - if ( clock_id != CLOCK_REALTIME ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - if ( !timerid ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - /* - * The data of the structure evp are checked in order to verify if they - * are coherent. - */ - - if (evp != NULL) { - /* The structure has data */ - if ( ( evp->sigev_notify != SIGEV_NONE ) && - ( evp->sigev_notify != SIGEV_SIGNAL ) ) { - /* The value of the field sigev_notify is not valid */ - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - if ( !evp->sigev_signo ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - if ( !is_valid_signo(evp->sigev_signo) ) - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - /* - * Allocate a timer - */ - ptimer = _POSIX_Timer_Allocate(); - if ( !ptimer ) { - _Objects_Allocator_unlock(); - rtems_set_errno_and_return_minus_one( EAGAIN ); - } - - /* The data of the created timer are stored to use them later */ - - ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; - ptimer->thread_id = _Thread_Get_executing()->Object.id; - - if ( evp != NULL ) { - ptimer->inf.sigev_notify = evp->sigev_notify; - ptimer->inf.sigev_signo = evp->sigev_signo; - ptimer->inf.sigev_value = evp->sigev_value; - } - - ptimer->overrun = 0; - ptimer->timer_data.it_value.tv_sec = 0; - ptimer->timer_data.it_value.tv_nsec = 0; - ptimer->timer_data.it_interval.tv_sec = 0; - ptimer->timer_data.it_interval.tv_nsec = 0; - - _Watchdog_Preinitialize( &ptimer->Timer, _Per_CPU_Get_snapshot() ); - _Watchdog_Initialize( &ptimer->Timer, _POSIX_Timer_TSR ); - _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); - - *timerid = ptimer->Object.id; - _Objects_Allocator_unlock(); - return 0; -} diff --git a/cpukit/posix/src/timerdelete.c b/cpukit/posix/src/timerdelete.c deleted file mode 100644 index 7670838ac2..0000000000 --- a/cpukit/posix/src/timerdelete.c +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file - * - * @brief Deletes a POSIX Interval Timer - * @ingroup POSIXAPI - */ - -/* - * 14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266 - * - * COPYRIGHT (c) 1989-2007. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include -#include - - -int timer_delete( - timer_t timerid -) -{ - /* - * IDEA: This function must probably stop the timer first and then delete it - * - * It will have to do a call to rtems_timer_cancel and then another - * call to rtems_timer_delete. - * The call to rtems_timer_delete will be probably unnecessary, - * because rtems_timer_delete stops the timer before deleting it. - */ - POSIX_Timer_Control *ptimer; - ISR_lock_Context lock_context; - - _Objects_Allocator_lock(); - - ptimer = _POSIX_Timer_Get( timerid, &lock_context ); - if ( ptimer != NULL ) { - Per_CPU_Control *cpu; - - _Objects_Close( &_POSIX_Timer_Information, &ptimer->Object ); - cpu = _POSIX_Timer_Acquire_critical( ptimer, &lock_context ); - ptimer->state = POSIX_TIMER_STATE_FREE; - _Watchdog_Remove( - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ], - &ptimer->Timer - ); - _POSIX_Timer_Release( cpu, &lock_context ); - _POSIX_Timer_Free( ptimer ); - _Objects_Allocator_unlock(); - return 0; - } - - _Objects_Allocator_unlock(); - - rtems_set_errno_and_return_minus_one( EINVAL ); -} diff --git a/cpukit/sapi/Makefile.am b/cpukit/sapi/Makefile.am index 4848e64f3b..0fef05de7d 100644 --- a/cpukit/sapi/Makefile.am +++ b/cpukit/sapi/Makefile.am @@ -18,7 +18,7 @@ libsapi_a_SOURCES += src/delayticks.c libsapi_a_SOURCES += src/delaynano.c libsapi_a_SOURCES += src/rbtree.c libsapi_a_SOURCES += src/rbtreefind.c -libsapi_a_SOURCES += src/rbtreeinsert.c +libsapi_a_SOURCES += src/sapirbtreeinsert.c libsapi_a_SOURCES += src/panic.c libsapi_a_SOURCES += src/profilingiterate.c libsapi_a_SOURCES += src/profilingreportxml.c diff --git a/cpukit/sapi/src/rbtreeinsert.c b/cpukit/sapi/src/rbtreeinsert.c deleted file mode 100644 index db55e4358b..0000000000 --- a/cpukit/sapi/src/rbtreeinsert.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2010-2012 Gedare Bloom. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -RTEMS_STATIC_ASSERT( - sizeof( rtems_rbtree_compare_result ) >= sizeof( intptr_t ), - rtems_rbtree_compare_result_intptr_t -); - -RTEMS_STATIC_ASSERT( - sizeof( rtems_rbtree_compare_result ) >= sizeof( int32_t ), - rtems_rbtree_compare_result_int32_t -); - -rtems_rbtree_node *rtems_rbtree_insert( - rtems_rbtree_control *the_rbtree, - rtems_rbtree_node *the_node, - rtems_rbtree_compare compare, - bool is_unique -) -{ - rtems_rbtree_node **which = _RBTree_Root_reference( the_rbtree ); - rtems_rbtree_node *parent = NULL; - - while ( *which != NULL ) { - rtems_rbtree_compare_result compare_result; - - parent = *which; - compare_result = ( *compare )( the_node, parent ); - - if ( is_unique && rtems_rbtree_is_equal( compare_result ) ) { - return parent; - } - - if ( rtems_rbtree_is_lesser( compare_result ) ) { - which = _RBTree_Left_reference( parent ); - } else { - which = _RBTree_Right_reference( parent ); - } - } - - _RBTree_Initialize_node( the_node ); - _RBTree_Add_child( the_node, parent, which ); - _RBTree_Insert_color( the_rbtree, the_node ); - - return NULL; -} diff --git a/cpukit/sapi/src/sapirbtreeinsert.c b/cpukit/sapi/src/sapirbtreeinsert.c new file mode 100644 index 0000000000..db55e4358b --- /dev/null +++ b/cpukit/sapi/src/sapirbtreeinsert.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2010-2012 Gedare Bloom. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +RTEMS_STATIC_ASSERT( + sizeof( rtems_rbtree_compare_result ) >= sizeof( intptr_t ), + rtems_rbtree_compare_result_intptr_t +); + +RTEMS_STATIC_ASSERT( + sizeof( rtems_rbtree_compare_result ) >= sizeof( int32_t ), + rtems_rbtree_compare_result_int32_t +); + +rtems_rbtree_node *rtems_rbtree_insert( + rtems_rbtree_control *the_rbtree, + rtems_rbtree_node *the_node, + rtems_rbtree_compare compare, + bool is_unique +) +{ + rtems_rbtree_node **which = _RBTree_Root_reference( the_rbtree ); + rtems_rbtree_node *parent = NULL; + + while ( *which != NULL ) { + rtems_rbtree_compare_result compare_result; + + parent = *which; + compare_result = ( *compare )( the_node, parent ); + + if ( is_unique && rtems_rbtree_is_equal( compare_result ) ) { + return parent; + } + + if ( rtems_rbtree_is_lesser( compare_result ) ) { + which = _RBTree_Left_reference( parent ); + } else { + which = _RBTree_Right_reference( parent ); + } + } + + _RBTree_Initialize_node( the_node ); + _RBTree_Add_child( the_node, parent, which ); + _RBTree_Insert_color( the_rbtree, the_node ); + + return NULL; +} diff --git a/cpukit/score/cpu/sparc/Makefile.am b/cpukit/score/cpu/sparc/Makefile.am index 0f77880cd9..2e0ab5999d 100644 --- a/cpukit/score/cpu/sparc/Makefile.am +++ b/cpukit/score/cpu/sparc/Makefile.am @@ -3,9 +3,9 @@ include $(top_srcdir)/automake/compile.am noinst_LIBRARIES = libscorecpu.a libscorecpu_a_SOURCES = libscorecpu_a_SOURCES += access_le.c -libscorecpu_a_SOURCES += access.S libscorecpu_a_SOURCES += cpu.c libscorecpu_a_SOURCES += cpu_asm.S +libscorecpu_a_SOURCES += sparc-access.S libscorecpu_a_SOURCES += sparc-context-validate.S libscorecpu_a_SOURCES += sparc-context-volatile-clobber.S libscorecpu_a_SOURCES += sparc-counter-asm.S diff --git a/cpukit/score/cpu/sparc/access.S b/cpukit/score/cpu/sparc/access.S deleted file mode 100644 index 9397cb815b..0000000000 --- a/cpukit/score/cpu/sparc/access.S +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Optimized access routines for SPARC. - * - * Note the difference between byteorder.h (inlined functions) and access.S - * where the functions will be declared in the library archive librtemscpu.a. - * Function names starting with _ are in library and can be referenced by - * function pointers. - * - * _ldN, _stN standard machine endianess access (SPARC: big-endian) - * _ld_beN, _st_beN forced big-endian - * _ld_leN, _st_leN forced little-endian (defined in access_le.C) - * - * This file is written in assembly because the big-endian functions maps to - * machine dependant access methods, i.e. same function has two names. - * - * COPYRIGHT (c) 2011 - * Aeroflex Gaisler. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include - - .align 4 - .section ".text" - PUBLIC(_ld8) - PUBLIC(_ld16) - PUBLIC(_ld32) - PUBLIC(_ld64) - PUBLIC(_st8) - PUBLIC(_st16) - PUBLIC(_st32) - PUBLIC(_st64) - PUBLIC(_ld_be16) - PUBLIC(_ld_be32) - PUBLIC(_ld_be64) - PUBLIC(_st_be16) - PUBLIC(_st_be32) - PUBLIC(_st_be64) - -SYM(_ld8): - retl - ldub [%o0], %o0 - -SYM(_ld_be16): -SYM(_ld16): - retl - lduh [%o0], %o0 - -SYM(_ld_be32): -SYM(_ld32): - retl - ld [%o0], %o0 - -SYM(_ld_be64): -SYM(_ld64): - retl - ldd [%o0], %o0 - -#if defined(__FIX_LEON3FT_B2BST) - -SYM(_st8): - stub %o1, [%o0] - retl - nop - -SYM(_st_be16): -SYM(_st16): - stuh %o1, [%o0] - retl - nop - -SYM(_st_be32): -SYM(_st32): - st %o1, [%o0] - retl - nop - -SYM(_st_be64): -SYM(_st64): - std %o1, [%o0] - retl - nop - -#else - -SYM(_st8): - retl - stb %o1, [%o0] - -SYM(_st_be16): -SYM(_st16): - retl - sth %o1, [%o0] - -SYM(_st_be32): -SYM(_st32): - retl - st %o1, [%o0] - -SYM(_st_be64): -SYM(_st64): - mov %o2, %o3 - mov %o1, %o2 - retl - std %o2, [%o0] -#endif diff --git a/cpukit/score/cpu/sparc/sparc-access.S b/cpukit/score/cpu/sparc/sparc-access.S new file mode 100644 index 0000000000..9397cb815b --- /dev/null +++ b/cpukit/score/cpu/sparc/sparc-access.S @@ -0,0 +1,109 @@ +/* + * Optimized access routines for SPARC. + * + * Note the difference between byteorder.h (inlined functions) and access.S + * where the functions will be declared in the library archive librtemscpu.a. + * Function names starting with _ are in library and can be referenced by + * function pointers. + * + * _ldN, _stN standard machine endianess access (SPARC: big-endian) + * _ld_beN, _st_beN forced big-endian + * _ld_leN, _st_leN forced little-endian (defined in access_le.C) + * + * This file is written in assembly because the big-endian functions maps to + * machine dependant access methods, i.e. same function has two names. + * + * COPYRIGHT (c) 2011 + * Aeroflex Gaisler. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include + + .align 4 + .section ".text" + PUBLIC(_ld8) + PUBLIC(_ld16) + PUBLIC(_ld32) + PUBLIC(_ld64) + PUBLIC(_st8) + PUBLIC(_st16) + PUBLIC(_st32) + PUBLIC(_st64) + PUBLIC(_ld_be16) + PUBLIC(_ld_be32) + PUBLIC(_ld_be64) + PUBLIC(_st_be16) + PUBLIC(_st_be32) + PUBLIC(_st_be64) + +SYM(_ld8): + retl + ldub [%o0], %o0 + +SYM(_ld_be16): +SYM(_ld16): + retl + lduh [%o0], %o0 + +SYM(_ld_be32): +SYM(_ld32): + retl + ld [%o0], %o0 + +SYM(_ld_be64): +SYM(_ld64): + retl + ldd [%o0], %o0 + +#if defined(__FIX_LEON3FT_B2BST) + +SYM(_st8): + stub %o1, [%o0] + retl + nop + +SYM(_st_be16): +SYM(_st16): + stuh %o1, [%o0] + retl + nop + +SYM(_st_be32): +SYM(_st32): + st %o1, [%o0] + retl + nop + +SYM(_st_be64): +SYM(_st64): + std %o1, [%o0] + retl + nop + +#else + +SYM(_st8): + retl + stb %o1, [%o0] + +SYM(_st_be16): +SYM(_st16): + retl + sth %o1, [%o0] + +SYM(_st_be32): +SYM(_st32): + retl + st %o1, [%o0] + +SYM(_st_be64): +SYM(_st64): + mov %o2, %o3 + mov %o1, %o2 + retl + std %o2, [%o0] +#endif -- cgit v1.2.3