Changeset 11b05f1 in rtems
- Timestamp:
- 05/08/14 08:11:13 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 89f0794
- Parents:
- 35a3af7a
- git-author:
- Sebastian Huber <sebastian.huber@…> (05/08/14 08:11:13)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (05/08/14 11:02:40)
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/sparc/shared/irq_asm.S
r35a3af7a r11b05f1 165 165 166 166 #if defined(RTEMS_SMP) 167 ! Indicate that this context is no longer executing167 ! The executing context no longer executes on this processor 168 168 stb %g0, [%o0 + SPARC_CONTEXT_CONTROL_IS_EXECUTING_OFFSET] 169 169 170 ! Wait for context to stop execution if necessary170 ! Wait for heir context to stop execution 171 171 1: 172 172 ldub [%o1 + SPARC_CONTEXT_CONTROL_IS_EXECUTING_OFFSET], %g1 … … 175 175 mov 1, %g1 176 176 177 ! Indicate that this context is executing177 ! The heir context executes now on this processor 178 178 stb %g1, [%o1 + SPARC_CONTEXT_CONTROL_IS_EXECUTING_OFFSET] 179 179 #endif -
c/src/lib/libcpu/powerpc/new-exceptions/cpu.c
r35a3af7a r11b05f1 124 124 msr_value &= ~PPC_MSR_FP; 125 125 126 memset( the_context, 0, sizeof( *the_context ) );127 128 126 the_ppc_context = ppc_get_context( the_context ); 129 127 the_ppc_context->gpr1 = sp; 130 128 the_ppc_context->msr = msr_value; 131 129 the_ppc_context->lr = (uint32_t) entry_point; 132 133 #ifdef RTEMS_SMP134 the_ppc_context->is_executing = false;135 #endif136 130 137 131 #ifdef __ALTIVEC__ -
c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S
r35a3af7a r11b05f1 328 328 329 329 #ifdef RTEMS_SMP 330 /* Indicate that this context is no longer executing*/330 /* The executing context no longer executes on this processor */ 331 331 msync 332 332 li r5, 0 333 333 stb r5, PPC_CONTEXT_OFFSET_IS_EXECUTING(r3) 334 #endif 335 336 /* Restore context from r4 */ 337 restore_context: 338 339 #ifdef RTEMS_SMP 340 /* Wait for context to stop execution if necessary */ 334 335 /* Wait for heir context to stop execution */ 341 336 1: 342 337 lbz r5, PPC_CONTEXT_OFFSET_IS_EXECUTING(r4) … … 344 339 bne 1b 345 340 346 /* Indicate that this context is executing*/341 /* The heir context executes now on this processor */ 347 342 li r5, 1 348 343 stb r5, PPC_CONTEXT_OFFSET_IS_EXECUTING(r4) 349 344 isync 350 345 #endif 346 347 /* Restore context from r4 */ 348 restore_context: 351 349 352 350 #ifdef __ALTIVEC__ -
cpukit/score/cpu/arm/cpu.c
r35a3af7a r11b05f1 102 102 #endif 103 103 104 #ifdef RTEMS_SMP105 the_context->is_executing = false;106 #endif107 108 104 if ( tls_area != NULL ) { 109 105 _TLS_TCB_at_area_begin_initialize( tls_area ); -
cpukit/score/cpu/arm/cpu_asm.S
r35a3af7a r11b05f1 69 69 70 70 #ifdef RTEMS_SMP 71 /* Indicate that this context is no longer executing*/71 /* The executing context no longer executes on this processor */ 72 72 dmb 73 73 mov r3, #0 74 74 strb r3, [r0, #ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET] 75 76 /* Wait for heir context to stop execution */ 77 1: 78 ldrb r3, [r1, #ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET] 79 cmp r3, #0 80 bne 1b 81 82 /* The heir context executes now on this processor */ 83 dmb 84 mov r3, #1 85 strb r3, [r1, #ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET] 75 86 #endif 76 87 … … 79 90 #ifdef ARM_MULTILIB_HAS_LOAD_STORE_EXCLUSIVE 80 91 clrex 81 #endif82 83 #ifdef RTEMS_SMP84 /* Wait for context to stop execution if necessary */85 1:86 ldrb r3, [r1, #ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET]87 cmp r3, #088 bne 1b89 90 /* Indicate that this context is executing */91 dmb92 mov r3, #193 strb r3, [r1, #ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET]94 92 #endif 95 93 -
cpukit/score/cpu/arm/rtems/score/cpu.h
r35a3af7a r11b05f1 423 423 424 424 #ifdef RTEMS_SMP 425 #define _CPU_Context_Get_is_executing( _context ) \ 426 (_context)->is_executing 425 static inline bool _CPU_Context_Get_is_executing( 426 const Context_Control *context 427 ) 428 { 429 return context->is_executing; 430 } 431 432 static inline void _CPU_Context_Set_is_executing( 433 Context_Control *context, 434 bool is_executing 435 ) 436 { 437 context->is_executing = is_executing; 438 } 427 439 #endif 428 440 -
cpukit/score/cpu/i386/cpu_asm.S
r35a3af7a r11b05f1 59 59 60 60 #ifdef RTEMS_SMP 61 /* Indicate that this context is no longer executing*/61 /* The executing context no longer executes on this processor */ 62 62 movb $0, I386_CONTEXT_CONTROL_IS_EXECUTING_OFFSET(eax) 63 63 #endif … … 65 65 movl HEIRCONTEXT_ARG(esp),eax /* eax = heir threads context */ 66 66 67 restore:68 67 #ifdef RTEMS_SMP 69 /* Wait for context to stop execution if necessary*/68 /* Wait for heir context to stop execution */ 70 69 1: 71 70 movb I386_CONTEXT_CONTROL_IS_EXECUTING_OFFSET(eax), bl … … 73 72 jne 1b 74 73 75 /* Indicate that this context is executing*/74 /* The heir context executes now on this processor */ 76 75 movb $1, I386_CONTEXT_CONTROL_IS_EXECUTING_OFFSET(eax) 77 76 #endif 78 77 78 restore: 79 79 pushl REG_EFLAGS(eax) /* push eflags */ 80 80 popf /* restore eflags */ -
cpukit/score/cpu/i386/rtems/score/cpu.h
r35a3af7a r11b05f1 168 168 169 169 #ifdef RTEMS_SMP 170 #define _CPU_Context_Get_is_executing( _context ) \ 171 (_context)->is_executing 170 static inline bool _CPU_Context_Get_is_executing( 171 const Context_Control *context 172 ) 173 { 174 return context->is_executing; 175 } 176 177 static inline void _CPU_Context_Set_is_executing( 178 Context_Control *context, 179 bool is_executing 180 ) 181 { 182 context->is_executing = is_executing; 183 } 172 184 #endif 173 185 … … 455 467 456 468 457 #ifdef RTEMS_SMP458 #define _I386_Context_Initialize_is_executing( _the_context ) \459 (_the_context)->is_executing = false460 #else461 #define _I386_Context_Initialize_is_executing( _the_context )462 #endif463 469 464 470 #define _CPU_Context_Initialize( _the_context, _stack_base, _size, \ … … 476 482 (_the_context)->ebp = (void *) 0; \ 477 483 (_the_context)->esp = (void *) _stack; \ 478 _I386_Context_Initialize_is_executing( _the_context ); \479 484 } while (0) 480 485 -
cpukit/score/cpu/no_cpu/rtems/score/cpu.h
r35a3af7a r11b05f1 1597 1597 1598 1598 /** 1599 * @brief Macro to return the is executing field of the thread context. 1599 * @brief Gets the is executing indicator of the thread context. 1600 * 1601 * @param[in] context The context. 1600 1602 */ 1601 #define _CPU_Context_Get_is_executing( _context ) \ 1602 ( ( _context )->is_executing ) 1603 static inline bool _CPU_Context_Get_is_executing( 1604 const Context_Control *context 1605 ) 1606 { 1607 return context->is_executing; 1608 } 1609 1610 /** 1611 * @brief Sets the is executing indicator of the thread context. 1612 * 1613 * @param[in] context The context. 1614 * @param[in] is_executing The new value for the is executing indicator. 1615 */ 1616 static inline void _CPU_Context_Set_is_executing( 1617 Context_Control *context, 1618 bool is_executing 1619 ) 1620 { 1621 context->is_executing = is_executing; 1622 } 1603 1623 #endif 1604 1624 -
cpukit/score/cpu/powerpc/rtems/score/cpu.h
r35a3af7a r11b05f1 344 344 345 345 #ifdef RTEMS_SMP 346 #define _CPU_Context_Get_is_executing( _context ) \ 347 ppc_get_context(_context)->is_executing 346 static inline bool _CPU_Context_Get_is_executing( 347 const Context_Control *context 348 ) 349 { 350 return ppc_get_context(context)->is_executing; 351 } 352 353 static inline void _CPU_Context_Set_is_executing( 354 Context_Control *context, 355 bool is_executing 356 ) 357 { 358 ppc_get_context(context)->is_executing = is_executing; 359 } 348 360 #endif 349 361 #endif /* ASM */ -
cpukit/score/cpu/sparc/cpu.c
r35a3af7a r11b05f1 331 331 the_context->isr_dispatch_disable = 0; 332 332 333 #if defined(RTEMS_SMP)334 the_context->is_executing = false;335 #endif336 337 333 if ( tls_area != NULL ) { 338 334 void *tcb = _TLS_TCB_after_TLS_block_initialize( tls_area ); -
cpukit/score/cpu/sparc/rtems/score/cpu.h
r35a3af7a r11b05f1 489 489 490 490 #ifdef RTEMS_SMP 491 #define _CPU_Context_Get_is_executing( _context ) \ 492 (_context)->is_executing 491 static inline bool _CPU_Context_Get_is_executing( 492 const Context_Control *context 493 ) 494 { 495 return context->is_executing; 496 } 497 498 static inline void _CPU_Context_Set_is_executing( 499 Context_Control *context, 500 bool is_executing 501 ) 502 { 503 context->is_executing = is_executing; 504 } 493 505 #endif 494 506 -
cpukit/score/src/threadinitialize.c
r35a3af7a r11b05f1 185 185 the_thread->is_in_the_air = false; 186 186 the_thread->scheduler = scheduler; 187 _CPU_Context_Set_is_executing( &the_thread->Registers, false ); 187 188 #endif 188 189 -
testsuites/sptests/spcontext01/init.c
r35a3af7a r11b05f1 161 161 } 162 162 163 static void test_context_is_executing(void) 164 { 165 #if defined(RTEMS_SMP) 166 Context_Control context; 167 bool is_executing; 168 169 memset(&context, 0, sizeof(context)); 170 171 is_executing = _CPU_Context_Get_is_executing(&context); 172 rtems_test_assert(!is_executing); 173 174 _CPU_Context_Set_is_executing(&context, true); 175 is_executing = _CPU_Context_Get_is_executing(&context); 176 rtems_test_assert(is_executing); 177 178 _CPU_Context_Set_is_executing(&context, false); 179 is_executing = _CPU_Context_Get_is_executing(&context); 180 rtems_test_assert(!is_executing); 181 182 _CPU_Context_Set_is_executing(&context, true); 183 _CPU_Context_Initialize(&context, NULL, 0, 0, NULL, false, NULL); 184 is_executing = _CPU_Context_Get_is_executing(&context); 185 rtems_test_assert(is_executing); 186 #endif 187 } 188 163 189 static void Init(rtems_task_argument arg) 164 190 { … … 167 193 TEST_BEGIN(); 168 194 195 test_context_is_executing(); 169 196 test(self); 170 197
Note: See TracChangeset
for help on using the changeset viewer.