Changeset 17508d02 in rtems


Ignore:
Timestamp:
Jul 26, 2000, 7:26:28 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
ca7858bb
Parents:
6b4a11bf
Message:

Port of RTEMS to the Texas Instruments C3x/C4x DSP families including
a BSP (c4xsim) supporting the simulator included with gdb. This port
was done by Joel Sherrill and Jennifer Averett of OAR Corporation.
Also included with this port is a space/time optimization to eliminate
FP context switch management on CPUs without hardware or software FP.

An issue with this port was that sizeof(unsigned32) = sizeof(unsigned8)
on this CPU. This required addressing alignment checks and assumptions
as well as fixing code that assumed sizeof(unsigned32) == 4.

Files:
15 added
44 edited

Legend:

Unmodified
Added
Removed
  • c/ACKNOWLEDGEMENTS

    r6b4a11bf r17508d02  
    187187  Comnet Technologies Ltd.
    188188
     189+ Joel Sherrill <joel@OARcorp.com> and Jennifer Averett <jennifer@OARcorp.com>
     190  for the Texas Instruments C3x/C4x port and c4xsim BSP that works
     191  with the C3x/C4X instruction set simulator in gdb.
     192
    189193Finally, the RTEMS project would like to thank those who have contributed
    190194to the other free software efforts which RTEMS utilizes.  The primary RTEMS
  • c/src/exec/itron/src/cre_tsk.c

    r6b4a11bf r17508d02  
    8484    NULL,
    8585    pk_ctsk->stksz,
    86     TRUE,          /* XXX - All tasks FP for now */
     86#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
     87    TRUE,          /* XXX - All tasks FP (if the HW supports it) for now */
     88#else
     89    FALSE,
     90#endif
    8791    core_priority,
    88     TRUE,
     92    TRUE,        /* preemptible */
    8993    THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE,
    9094    NULL,        /* no budget algorithm callout */
  • c/src/exec/libcsupport/src/malloc.c

    r6b4a11bf r17508d02  
    8383    }
    8484
    85     if (u32_address & (CPU_ALIGNMENT-1)) {
     85    if (u32_address & (CPU_HEAP_ALIGNMENT-1)) {
    8686      old_address = u32_address;
    87       u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     87      u32_address = (u32_address + CPU_HEAP_ALIGNMENT) & ~(CPU_HEAP_ALIGNMENT-1);
    8888
    8989       /*
  • c/src/exec/librpc/Makefile.am

    r6b4a11bf r17508d02  
    66ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
    77
     8if rpc_not_supported
     9SUBDIRS =
     10else
    811SUBDIRS = include src
     12endif
    913
    1014EXTRA_DIST = README_RTEMS
  • c/src/exec/posix/src/pthreadcreate.c

    r6b4a11bf r17508d02  
    141141   */
    142142
    143   is_fp = CPU_HARDWARE_FP;
     143
     144#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
     145  is_fp = TRUE;
     146#else
     147  is_fp = FALSE;
     148#endif
    144149
    145150  /*
  • c/src/exec/score/cpu/a29k/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    188188#define CPU_HARDWARE_FP     FALSE
    189189#endif
     190#define CPU_SOFTWARE_FP     FALSE
    190191
    191192/*
  • c/src/exec/score/cpu/hppa1.1/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    5757
    5858#define CPU_HARDWARE_FP                  TRUE
     59#define CPU_SOFTWARE_FP                  FALSE
    5960#define CPU_ALL_TASKS_ARE_FP             TRUE
    6061#define CPU_IDLE_TASK_IS_FP              FALSE
  • c/src/exec/score/cpu/i386/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    5959#define CPU_HARDWARE_FP     FALSE
    6060#endif
     61#define CPU_SOFTWARE_FP     FALSE
    6162
    6263#define CPU_ALL_TASKS_ARE_FP             FALSE
  • c/src/exec/score/cpu/i960/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    5858#define CPU_HARDWARE_FP     FALSE
    5959#endif
     60
     61#define CPU_SOFTWARE_FP     FALSE
    6062
    6163#define CPU_ALL_TASKS_ARE_FP             FALSE
  • c/src/exec/score/cpu/mips/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    175175#define CPU_HARDWARE_FP     FALSE
    176176#endif
     177#define CPU_SOFTWARE_FP     FALSE
    177178
    178179/*
  • c/src/exec/score/cpu/mips64orion/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    175175#define CPU_HARDWARE_FP     FALSE
    176176#endif
     177#define CPU_SOFTWARE_FP     FALSE
    177178
    178179/*
  • c/src/exec/score/cpu/sh/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    133133
    134134#define CPU_HARDWARE_FP     FALSE
     135#define CPU_SOFTWARE_FP     FALSE
    135136
    136137/*
  • c/src/exec/score/cpu/sparc/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    106106#define CPU_HARDWARE_FP     FALSE
    107107#endif
     108#define CPU_SOFTWARE_FP     FALSE
    108109
    109110/*
  • c/src/exec/score/cpu/unix/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    159159
    160160#define CPU_HARDWARE_FP     TRUE
     161#define CPU_SOFTWARE_FP     FALSE
    161162
    162163/*
  • c/src/exec/score/include/rtems/score/thread.h

    r6b4a11bf r17508d02  
    120120  boolean              core_allocated_stack;
    121121  Stack_Control        Initial_stack;    /* stack information               */
     122#if ( CPU_HARDWARE_FP == TRUE )
    122123  void                *fp_context;       /* initial FP context area address */
     124#endif
    123125  void                *stack;            /* initial stack area address      */
    124126}   Thread_Start_information;
     
    216218  Thread_Start_information              Start;
    217219  Context_Control                       Registers;
     220#if ( CPU_HARDWARE_FP == TRUE )
    218221  void                                 *fp_context;
     222#endif
    219223  void                                 *API_Extensions[ THREAD_API_LAST + 1 ];
    220224  void                                **extensions;
     
    309313 */
    310314
     315#if ( CPU_HARDWARE_FP == TRUE )
    311316SCORE_EXTERN Thread_Control *_Thread_Allocated_fp;
     317#endif
    312318
    313319/*
  • c/src/exec/score/inline/rtems/score/address.inl

    r6b4a11bf r17508d02  
    9191)
    9292{
    93 #if defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES)
     93#if (CPU_ALIGNMENT == 0)
     94    return TRUE;
     95#elif defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES)
    9496    return ( ( (unsigned short)address % CPU_ALIGNMENT ) == 0 );
    9597#else
  • c/src/exec/score/inline/rtems/score/thread.inl

    r6b4a11bf r17508d02  
    112112RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void )
    113113{
     114#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    114115  if ( _Thread_Executing->fp_context != NULL )
    115116    _Context_Restore_fp( &_Thread_Executing->fp_context );
     117#endif
    116118
    117119  _CPU_Context_Restart_self( &_Thread_Executing->Registers );
     
    145147 */
    146148
     149#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    147150RTEMS_INLINE_ROUTINE boolean _Thread_Is_allocated_fp (
    148151  Thread_Control *the_thread
     
    151154  return ( the_thread == _Thread_Allocated_fp );
    152155}
     156#endif
    153157
    154158/*PAGE
     
    162166 */
    163167
     168#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    164169RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void )
    165170{
    166171  _Thread_Allocated_fp = NULL;
    167172}
     173#endif
    168174
    169175/*PAGE
  • c/src/exec/score/macros/rtems/score/address.inl

    r6b4a11bf r17508d02  
    5252 */
    5353
     54#if (CPU_ALIGNMENT == 0)
     55    (TRUE)
     56#elif defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES)
     57    ( ( (unsigned short)(_address) % CPU_ALIGNMENT ) == 0 )
    5458#define _Addresses_Is_aligned( _address ) \
    5559    ( ( (unsigned32)(_address) % CPU_ALIGNMENT ) == 0 )
     60#else
     61#endif
    5662
    5763/*PAGE
  • c/src/exec/score/macros/rtems/score/thread.inl

    r6b4a11bf r17508d02  
    6868 */
    6969
     70#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    7071#define _Thread_Restart_self()  \
    7172  {  \
     
    7576    _CPU_Context_Restart_self( &_Thread_Executing->Registers ); \
    7677  }
     78#else
     79#define _Thread_Restart_self()  \
     80  {  \
     81    _CPU_Context_Restart_self( &_Thread_Executing->Registers ); \
     82  }
     83#endif
    7784
    7885/*PAGE
     
    97104 */
    98105
     106#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    99107#define _Thread_Is_allocated_fp( _the_thread ) \
    100108        ( (_the_thread) == _Thread_Allocated_fp )
     109#endif
    101110
    102111/*PAGE
     
    106115 */
    107116
     117#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    108118#define _Thread_Deallocate_fp() \
    109119        _Thread_Allocated_fp = NULL
     120#endif
    110121
    111122/*PAGE
  • c/src/exec/score/src/thread.c

    r6b4a11bf r17508d02  
    6464  _Thread_Executing         = NULL;
    6565  _Thread_Heir              = NULL;
     66#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    6667  _Thread_Allocated_fp      = NULL;
     68#endif
    6769
    6870  _Thread_Do_post_task_switch_extension = 0;
  • c/src/exec/score/src/threadclose.c

    r6b4a11bf r17508d02  
    5454  _User_extensions_Thread_delete( the_thread );
    5555 
     56#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    5657#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
    5758  if ( _Thread_Is_allocated_fp( the_thread ) )
     
    6162
    6263  if ( the_thread->Start.fp_context )
    63   (void) _Workspace_Free( the_thread->Start.fp_context );
     64    (void) _Workspace_Free( the_thread->Start.fp_context );
     65#endif
    6466
    6567  _Thread_Stack_Free( the_thread );
  • c/src/exec/score/src/threaddispatch.c

    r6b4a11bf r17508d02  
    9393     */
    9494
    95 #if ( CPU_HARDWARE_FP == TRUE )
     95#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    9696#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
    9797    if ( (heir->fp_context != NULL) && !_Thread_Is_allocated_fp( heir ) ) {
  • c/src/exec/score/src/threadinitialize.c

    r6b4a11bf r17508d02  
    9696   */
    9797 
     98#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    9899  if ( is_fp ) {
    99100
     
    110111  the_thread->fp_context       = fp_area;
    111112  the_thread->Start.fp_context = fp_area;
     113#endif
    112114
    113115  /*
  • c/src/exec/score/src/threadloadenv.c

    r6b4a11bf r17508d02  
    4646  boolean is_fp = FALSE;
    4747
     48#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    4849  if ( the_thread->Start.fp_context ) {
    4950    the_thread->fp_context = the_thread->Start.fp_context;
     
    5152    is_fp = TRUE;
    5253  }
     54#endif
    5355
    5456  the_thread->do_post_task_switch_extension = FALSE;
  • c/src/lib/libbsp/c4x/c4xsim/console/Makefile.am

    r6b4a11bf r17508d02  
    99VPATH = @srcdir@:@srcdir@/../../../shared
    1010
    11 C_FILES = console.c consolereserveresources.c debugio.c simio.c printk.c
     11C_FILES = console.c consolereserveresources.c debugio.c simio.c
    1212C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
    1313
  • c/src/lib/libbsp/c4x/c4xsim/include/Makefile.am

    r6b4a11bf r17508d02  
    1313        $(INSTALL_DATA) $< $@
    1414
    15 $(PROJECT_INCLUDE)/bspIo.h: $(top_srcdir)/../../shared/include/bspIo.h
    16         $(INSTALL_DATA) $< $@
    17 
    1815$(PROJECT_INCLUDE)/coverhd.h: $(top_srcdir)/../../shared/include/coverhd.h
    1916        $(INSTALL_DATA) $< $@
    2017
    2118PREINSTALL_FILES += $(PROJECT_INCLUDE) $(H_FILES:%.h=$(PROJECT_INCLUDE)/%.h) \
    22     $(PROJECT_INCLUDE)/bspIo.h $(PROJECT_INCLUDE)/coverhd.h
     19    $(PROJECT_INCLUDE)/coverhd.h
    2320
    2421all-local: $(PREINSTALL_FILES)
  • c/src/lib/libbsp/c4x/c4xsim/startup/bspstart.c

    r6b4a11bf r17508d02  
    105105    rtems_fatal_error_occurred( 0x43218765 );
    106106 
    107 
    108   /*
    109    *  Account for the console's resources
    110    */
    111 
    112   console_reserve_resources( &BSP_Configuration );
    113 
    114   /*
    115    * Add 1 extension for MPCI_fatal
    116    */
    117 
    118   if (BSP_Configuration.User_multiprocessing_table)
    119     BSP_Configuration.maximum_extensions++;
    120 
    121  
    122107  BSP_output_char = C4X_BSP_output_char;
    123108  BSP_poll_char = (BSP_polling_getchar_function_type) NULL;
  • config.sub

    r6b4a11bf r17508d02  
    167167                | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
    168168                | mipstx39 | mipstx39el \
    169                 | sparc | sparclet | sparclite | sparc64 | v850)
     169                | sparc | sparclet | sparclite | sparc64 | v850 | c4x)
    170170                basic_machine=$basic_machine-unknown
    171171                ;;
  • cpukit/itron/src/cre_tsk.c

    r6b4a11bf r17508d02  
    8484    NULL,
    8585    pk_ctsk->stksz,
    86     TRUE,          /* XXX - All tasks FP for now */
     86#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
     87    TRUE,          /* XXX - All tasks FP (if the HW supports it) for now */
     88#else
     89    FALSE,
     90#endif
    8791    core_priority,
    88     TRUE,
     92    TRUE,        /* preemptible */
    8993    THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE,
    9094    NULL,        /* no budget algorithm callout */
  • cpukit/posix/src/pthreadcreate.c

    r6b4a11bf r17508d02  
    141141   */
    142142
    143   is_fp = CPU_HARDWARE_FP;
     143
     144#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
     145  is_fp = TRUE;
     146#else
     147  is_fp = FALSE;
     148#endif
    144149
    145150  /*
  • cpukit/score/cpu/a29k/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    188188#define CPU_HARDWARE_FP     FALSE
    189189#endif
     190#define CPU_SOFTWARE_FP     FALSE
    190191
    191192/*
  • cpukit/score/cpu/hppa1.1/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    5757
    5858#define CPU_HARDWARE_FP                  TRUE
     59#define CPU_SOFTWARE_FP                  FALSE
    5960#define CPU_ALL_TASKS_ARE_FP             TRUE
    6061#define CPU_IDLE_TASK_IS_FP              FALSE
  • cpukit/score/cpu/i386/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    5959#define CPU_HARDWARE_FP     FALSE
    6060#endif
     61#define CPU_SOFTWARE_FP     FALSE
    6162
    6263#define CPU_ALL_TASKS_ARE_FP             FALSE
  • cpukit/score/cpu/i960/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    5858#define CPU_HARDWARE_FP     FALSE
    5959#endif
     60
     61#define CPU_SOFTWARE_FP     FALSE
    6062
    6163#define CPU_ALL_TASKS_ARE_FP             FALSE
  • cpukit/score/cpu/mips/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    175175#define CPU_HARDWARE_FP     FALSE
    176176#endif
     177#define CPU_SOFTWARE_FP     FALSE
    177178
    178179/*
  • cpukit/score/cpu/mips64orion/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    175175#define CPU_HARDWARE_FP     FALSE
    176176#endif
     177#define CPU_SOFTWARE_FP     FALSE
    177178
    178179/*
  • cpukit/score/cpu/sh/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    133133
    134134#define CPU_HARDWARE_FP     FALSE
     135#define CPU_SOFTWARE_FP     FALSE
    135136
    136137/*
  • cpukit/score/cpu/sparc/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    106106#define CPU_HARDWARE_FP     FALSE
    107107#endif
     108#define CPU_SOFTWARE_FP     FALSE
    108109
    109110/*
  • cpukit/score/cpu/unix/rtems/score/cpu.h

    r6b4a11bf r17508d02  
    159159
    160160#define CPU_HARDWARE_FP     TRUE
     161#define CPU_SOFTWARE_FP     FALSE
    161162
    162163/*
  • cpukit/score/include/rtems/score/thread.h

    r6b4a11bf r17508d02  
    120120  boolean              core_allocated_stack;
    121121  Stack_Control        Initial_stack;    /* stack information               */
     122#if ( CPU_HARDWARE_FP == TRUE )
    122123  void                *fp_context;       /* initial FP context area address */
     124#endif
    123125  void                *stack;            /* initial stack area address      */
    124126}   Thread_Start_information;
     
    216218  Thread_Start_information              Start;
    217219  Context_Control                       Registers;
     220#if ( CPU_HARDWARE_FP == TRUE )
    218221  void                                 *fp_context;
     222#endif
    219223  void                                 *API_Extensions[ THREAD_API_LAST + 1 ];
    220224  void                                **extensions;
     
    309313 */
    310314
     315#if ( CPU_HARDWARE_FP == TRUE )
    311316SCORE_EXTERN Thread_Control *_Thread_Allocated_fp;
     317#endif
    312318
    313319/*
  • cpukit/score/inline/rtems/score/address.inl

    r6b4a11bf r17508d02  
    9191)
    9292{
    93 #if defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES)
     93#if (CPU_ALIGNMENT == 0)
     94    return TRUE;
     95#elif defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES)
    9496    return ( ( (unsigned short)address % CPU_ALIGNMENT ) == 0 );
    9597#else
  • cpukit/score/inline/rtems/score/thread.inl

    r6b4a11bf r17508d02  
    112112RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void )
    113113{
     114#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    114115  if ( _Thread_Executing->fp_context != NULL )
    115116    _Context_Restore_fp( &_Thread_Executing->fp_context );
     117#endif
    116118
    117119  _CPU_Context_Restart_self( &_Thread_Executing->Registers );
     
    145147 */
    146148
     149#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    147150RTEMS_INLINE_ROUTINE boolean _Thread_Is_allocated_fp (
    148151  Thread_Control *the_thread
     
    151154  return ( the_thread == _Thread_Allocated_fp );
    152155}
     156#endif
    153157
    154158/*PAGE
     
    162166 */
    163167
     168#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    164169RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void )
    165170{
    166171  _Thread_Allocated_fp = NULL;
    167172}
     173#endif
    168174
    169175/*PAGE
  • cpukit/score/macros/rtems/score/address.inl

    r6b4a11bf r17508d02  
    5252 */
    5353
     54#if (CPU_ALIGNMENT == 0)
     55    (TRUE)
     56#elif defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES)
     57    ( ( (unsigned short)(_address) % CPU_ALIGNMENT ) == 0 )
    5458#define _Addresses_Is_aligned( _address ) \
    5559    ( ( (unsigned32)(_address) % CPU_ALIGNMENT ) == 0 )
     60#else
     61#endif
    5662
    5763/*PAGE
  • cpukit/score/macros/rtems/score/thread.inl

    r6b4a11bf r17508d02  
    6868 */
    6969
     70#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    7071#define _Thread_Restart_self()  \
    7172  {  \
     
    7576    _CPU_Context_Restart_self( &_Thread_Executing->Registers ); \
    7677  }
     78#else
     79#define _Thread_Restart_self()  \
     80  {  \
     81    _CPU_Context_Restart_self( &_Thread_Executing->Registers ); \
     82  }
     83#endif
    7784
    7885/*PAGE
     
    97104 */
    98105
     106#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    99107#define _Thread_Is_allocated_fp( _the_thread ) \
    100108        ( (_the_thread) == _Thread_Allocated_fp )
     109#endif
    101110
    102111/*PAGE
     
    106115 */
    107116
     117#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    108118#define _Thread_Deallocate_fp() \
    109119        _Thread_Allocated_fp = NULL
     120#endif
    110121
    111122/*PAGE
Note: See TracChangeset for help on using the changeset viewer.