Changeset f2f211c5 in rtems


Ignore:
Timestamp:
May 31, 2013, 11:59:34 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
db42c079
Parents:
bd39add
git-author:
Sebastian Huber <sebastian.huber@…> (05/31/13 11:59:34)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/31/13 13:20:32)
Message:

smp: Add ARM support

Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • aclocal/enable-smp.m4

    rbd39add rf2f211c5  
    77[case "${enableval}" in
    88  yes) case "${RTEMS_CPU}" in
    9          powerpc|sparc|i386) RTEMS_HAS_SMP=yes ;;
     9         arm|powerpc|sparc|i386) RTEMS_HAS_SMP=yes ;;
    1010         *)          RTEMS_HAS_SMP=no ;;
    1111       esac
  • c/src/aclocal/enable-smp.m4

    rbd39add rf2f211c5  
    77[case "${enableval}" in
    88  yes) case "${RTEMS_CPU}" in
    9          powerpc|sparc|i386) RTEMS_HAS_SMP=yes ;;
     9         arm|powerpc|sparc|i386) RTEMS_HAS_SMP=yes ;;
    1010         *)          RTEMS_HAS_SMP=no ;;
    1111       esac
  • cpukit/aclocal/enable-smp.m4

    rbd39add rf2f211c5  
    77[case "${enableval}" in
    88  yes) case "${RTEMS_CPU}" in
    9          powerpc|sparc|i386) RTEMS_HAS_SMP=yes ;;
     9         arm|powerpc|sparc|i386) RTEMS_HAS_SMP=yes ;;
    1010         *)          RTEMS_HAS_SMP=no ;;
    1111       esac
  • cpukit/score/cpu/arm/Makefile.am

    rbd39add rf2f211c5  
    1111include_rtems_score_HEADERS += rtems/score/types.h
    1212include_rtems_score_HEADERS += rtems/score/cpuatomic.h
     13include_rtems_score_HEADERS += rtems/score/cpusmplock.h
    1314
    1415noinst_LIBRARIES = libscorecpu.a
  • cpukit/score/cpu/arm/arm_exc_interrupt.S

    rbd39add rf2f211c5  
    9191#endif
    9292
     93#ifdef RTEMS_SMP
     94        /* ISR enter */
     95        blx     _ISR_SMP_Enter
     96
     97        /* Remember INT stack pointer */
     98        mov     r1, EXCHANGE_INT_SP
     99
     100        /* Restore exchange registers from exchange area */
     101        ldmia   r1, EXCHANGE_LIST
     102
     103        /* Switch stack if necessary and save original stack pointer */
     104        mov     r2, sp
     105        cmp     r0, #0
     106        moveq   sp, r1
     107        stmdb   sp!, {r2}
     108
     109        /* Call BSP dependent interrupt dispatcher */
     110        blx     bsp_interrupt_dispatch
     111
     112        /* Restore stack pointer */
     113        ldr     sp, [sp]
     114
     115        /* ISR exit */
     116        blx     _ISR_SMP_Exit
     117        cmp     r0, #0
     118        beq     thread_dispatch_done
     119
     120        /* Thread dispatch */
     121        blx     _Thread_Dispatch
     122
     123thread_dispatch_done:
     124#else /* RTEMS_SMP */
    93125        /* Remember INT stack pointer */
    94126        mov     r1, EXCHANGE_INT_SP
     
    151183#endif /* __thumb__ */
    152184
    153 do_thread_dispatch:
    154 
    155185        /* Thread dispatch */
    156186        bl      _Thread_Dispatch
     
    160190        /* Switch to ARM instructions if necessary */
    161191        SWITCH_FROM_THUMB_TO_ARM
     192#endif /* RTEMS_SMP */
    162193
    163194#ifdef ARM_MULTILIB_VFP_D32
  • cpukit/score/cpu/arm/cpu_asm.S

    rbd39add rf2f211c5  
    6565/* Start restoring context */
    6666_restore:
     67#ifdef RTEMS_SMP
     68        clrex
     69#endif
    6770
    6871#ifdef ARM_MULTILIB_VFP_D32
  • cpukit/score/cpu/arm/preinstall.am

    rbd39add rf2f211c5  
    5656PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpuatomic.h
    5757
     58$(PROJECT_INCLUDE)/rtems/score/cpusmplock.h: rtems/score/cpusmplock.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
     59        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpusmplock.h
     60PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpusmplock.h
     61
  • cpukit/score/cpu/arm/rtems/score/cpu.h

    rbd39add rf2f211c5  
    439439
    440440void _CPU_Context_validate( uintptr_t pattern );
     441
     442#ifdef RTEMS_SMP
     443  #define _CPU_Context_switch_to_first_task_smp( _context ) \
     444    _CPU_Context_restore( _context )
     445
     446  static inline void _ARM_Data_memory_barrier( void )
     447  {
     448    __asm__ volatile ( "dmb" : : : "memory" );
     449  }
     450
     451  static inline void _ARM_Data_synchronization_barrier( void )
     452  {
     453    __asm__ volatile ( "dsb" : : : "memory" );
     454  }
     455
     456  static inline void _ARM_Send_event( void )
     457  {
     458    __asm__ volatile ( "sev" : : : "memory" );
     459  }
     460
     461  static inline void _ARM_Wait_for_event( void )
     462  {
     463    __asm__ volatile ( "wfe" : : : "memory" );
     464  }
     465
     466  static inline void _CPU_Processor_event_broadcast( void )
     467  {
     468    _ARM_Data_synchronization_barrier();
     469    _ARM_Send_event();
     470  }
     471
     472  static inline void _CPU_Processor_event_receive( void )
     473  {
     474    _ARM_Wait_for_event();
     475    _ARM_Data_memory_barrier();
     476  }
     477#endif
     478
    441479
    442480static inline uint32_t CPU_swap_u32( uint32_t value )
Note: See TracChangeset for help on using the changeset viewer.