Changeset 726b27c in rtems-schedsim
- Timestamp:
- 12/13/13 17:01:48 (10 years ago)
- Branches:
- master
- Children:
- 8703c13
- Parents:
- 9a34e3a
- git-author:
- Joel Sherrill <joel.sherrill@…> (12/13/13 17:01:48)
- git-committer:
- Joel Sherrill <joel.sherrill@…> (04/28/14 16:33:52)
- Location:
- schedsim
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
schedsim/rtems/Makefile.am
r9a34e3a r726b27c 9 9 librtems_a_CPPFLAGS += -I$(cpukitdir)/include 10 10 librtems_a_CPPFLAGS += -I$(cpukitdir)/score/include 11 librtems_a_CPPFLAGS += -I$(cpukitdir)/score/inline12 11 librtems_a_CPPFLAGS += -I$(cpukitdir)/rtems/include 13 librtems_a_CPPFLAGS += -I$(cpukitdir)/rtems/inline14 12 librtems_a_CPPFLAGS += -I$(cpukitdir)/sapi/include 15 librtems_a_CPPFLAGS += -I$(cpukitdir)/sapi/inline16 13 librtems_a_CPPFLAGS += -I$(cpukitdir)/libcsupport/include 17 14 librtems_a_CPPFLAGS += -I$(cpukitdir)/libmisc/stringto … … 32 29 librtems_a_SOURCES += $(cpukitdir)/score/src/percpu.c 33 30 librtems_a_SOURCES += $(cpukitdir)/score/src/apiext.c 34 librtems_a_SOURCES += $(cpukitdir)/score/src/apimutexallocate.c35 31 librtems_a_SOURCES += $(cpukitdir)/score/src/apimutex.c 36 32 librtems_a_SOURCES += $(cpukitdir)/score/src/apimutexlock.c … … 53 49 librtems_a_SOURCES += $(cpukitdir)/score/src/coretodget.c 54 50 librtems_a_SOURCES += $(cpukitdir)/score/src/coretodgetuptimetimespec.c 51 librtems_a_SOURCES += $(cpukitdir)/score/src/coretodsecondssinceepoch.c 55 52 librtems_a_SOURCES += $(cpukitdir)/score/src/coretodset.c 56 53 librtems_a_SOURCES += $(cpukitdir)/score/src/coretodtickle.c 57 54 librtems_a_SOURCES += $(cpukitdir)/score/src/coretodtickspersec.c 58 librtems_a_SOURCES += $(cpukitdir)/score/src/ coretodusectoticks.c55 librtems_a_SOURCES += $(cpukitdir)/score/src/freechain.c 59 56 librtems_a_SOURCES += $(cpukitdir)/score/src/isr.c 57 librtems_a_SOURCES += $(cpukitdir)/score/src/log2table.c 60 58 librtems_a_SOURCES += $(cpukitdir)/score/src/objectallocate.c 61 59 librtems_a_SOURCES += $(cpukitdir)/score/src/objectapimaximumclass.c … … 77 75 librtems_a_SOURCES += $(cpukitdir)/score/src/objectsetname.c 78 76 librtems_a_SOURCES += $(cpukitdir)/score/src/objectshrinkinformation.c 77 librtems_a_SOURCES += $(cpukitdir)/score/src/rbtree.c 78 librtems_a_SOURCES += $(cpukitdir)/score/src/rbtreeextract.c 79 librtems_a_SOURCES += $(cpukitdir)/score/src/rbtreefind.c 80 librtems_a_SOURCES += $(cpukitdir)/score/src/rbtreeinsert.c 81 librtems_a_SOURCES += $(cpukitdir)/score/src/rbtreeiterate.c 82 librtems_a_SOURCES += $(cpukitdir)/score/src/rbtreenext.c 79 83 librtems_a_SOURCES += $(cpukitdir)/score/src/scheduler.c 80 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityallocate.c 84 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerdefaultallocatefree.c 85 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerdefaultreleasejob.c 86 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerdefaultstartidle.c 87 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerdefaulttick.c 88 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerdefaultupdate.c 89 90 # Uniprocessor Deterministic Scheduler 81 91 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityblock.c 82 92 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriority.c 83 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerprioritytick.c84 93 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityenqueue.c 85 94 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityenqueuefirst.c 86 95 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityextract.c 87 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityfree.c88 96 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityprioritycompare.c 89 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityreleasejob.c90 97 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityschedule.c 91 98 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityunblock.c 92 99 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityupdate.c 93 100 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerpriorityyield.c 101 102 # Uniprocessor Scheduler Simple 94 103 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulersimpleblock.c 95 104 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulersimple.c … … 102 111 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulersimpleunblock.c 103 112 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulersimpleyield.c 113 104 114 librtems_a_SOURCES += $(cpukitdir)/score/src/thread.c 105 115 librtems_a_SOURCES += $(cpukitdir)/score/src/threadchangepriority.c 106 116 librtems_a_SOURCES += $(cpukitdir)/score/src/threadclearstate.c 107 librtems_a_SOURCES += $(cpukitdir)/score/src/threadclose.c108 117 librtems_a_SOURCES += $(cpukitdir)/score/src/threadcreateidle.c 109 118 librtems_a_SOURCES += $(cpukitdir)/score/src/threaddelayended.c … … 114 123 librtems_a_SOURCES += $(cpukitdir)/score/src/threadloadenv.c 115 124 librtems_a_SOURCES += $(cpukitdir)/score/src/threadready.c 116 librtems_a_SOURCES += $(cpukitdir)/score/src/threadreset.c117 125 librtems_a_SOURCES += $(cpukitdir)/score/src/threadrestart.c 118 126 librtems_a_SOURCES += $(cpukitdir)/score/src/threadsetpriority.c … … 159 167 librtems_a_SOURCES += $(cpukitdir)/score/src/watchdog.c 160 168 librtems_a_SOURCES += $(cpukitdir)/score/src/watchdoginsert.c 161 librtems_a_SOURCES += $(cpukitdir)/score/src/watchdognanoseconds.c162 169 librtems_a_SOURCES += $(cpukitdir)/score/src/watchdogremove.c 163 librtems_a_SOURCES += $(cpukitdir)/score/src/watchdogreport.c164 librtems_a_SOURCES += $(cpukitdir)/score/src/watchdogreportchain.c165 170 librtems_a_SOURCES += $(cpukitdir)/score/src/watchdogtickle.c 166 171 librtems_a_SOURCES += $(cpukitdir)/sapi/src/debug.c … … 185 190 librtems_a_SOURCES += $(cpukitdir)/rtems/src/semrelease.c 186 191 librtems_a_SOURCES += $(cpukitdir)/rtems/src/semtranslatereturncode.c 192 librtems_a_SOURCES += $(cpukitdir)/rtems/src/signalcatch.c 187 193 librtems_a_SOURCES += $(cpukitdir)/rtems/src/status.c 194 librtems_a_SOURCES += $(cpukitdir)/rtems/src/statustext.c 188 195 librtems_a_SOURCES += $(cpukitdir)/rtems/src/tasks.c 189 196 librtems_a_SOURCES += $(cpukitdir)/rtems/src/taskdata.c … … 199 206 librtems_a_SOURCES += $(cpukitdir)/rtems/src/taskmode.c 200 207 librtems_a_SOURCES += $(cpukitdir)/rtems/src/taskwakeafter.c 208 librtems_a_SOURCES += $(cpukitdir)/posix/src/key.c 209 librtems_a_SOURCES += $(cpukitdir)/posix/src/keyfreememory.c 210 librtems_a_SOURCES += $(cpukitdir)/posix/src/keyrundestructors.c 201 211 librtems_a_SOURCES += $(cpukitdir)/libcsupport/src/assoclocalbyname.c 202 212 librtems_a_SOURCES += $(cpukitdir)/libcsupport/src/assoclocalbyremotebitfield.c … … 229 239 if HAS_SMP 230 240 librtems_a_SOURCES += $(cpukitdir)/score/src/smp.c 231 librtems_a_SOURCES += $(cpukitdir)/score/src/smplock.c232 librtems_a_SOURCES += $(cpukitdir)/score/src/isrsmp.c233 241 librtems_a_SOURCES += $(cpukitdir)/score/src/threaddisabledispatch.c 234 242 librtems_a_SOURCES += $(cpukitdir)/score/src/threadenabledispatch.c 235 243 librtems_a_SOURCES += $(cpukitdir)/score/src/threaddispatchdisablelevel.c 236 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulersimplesmpblock.c 237 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulersimplesmpschedule.c 238 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulersimplesmptick.c 239 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulersimplesmpunblock.c 244 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulerprioritysmp.c 245 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulersimplesmp.c 246 librtems_a_SOURCES += $(cpukitdir)/score/src/schedulersmpstartidle.c 240 247 endif 241 248 … … 252 259 ${cpukitdir}/score/include/rtems/system.h \ 253 260 ${cpukitdir}/score/include/rtems/debug.h \ 254 ${cpukitdir}/score/include/rtems/bspsmp.h \255 261 ${cpukitdir}/include/rtems/bspIo.h \ 256 262 $(cpukitdir)/sapi/include/rtems/fatal.h \ … … 323 329 ${cpukitdir}/score/include/rtems/score/schedulersimple.h \ 324 330 ${cpukitdir}/score/include/rtems/score/timespec.h \ 325 ${cpukitdir}/score/include/rtems/score/tqdata.h \326 ${cpukitdir}/score/include/rtems/score/bitfield.h \327 331 ${cpukitdir}/score/include/rtems/score/interr.h \ 328 $(cpukitdir)/score/inline/rtems/score/address.inl \329 $(cpukitdir)/score/inline/rtems/score/corespinlock.inl \330 $(cpukitdir)/score/inline/rtems/score/priority.inl \331 $(cpukitdir)/score/inline/rtems/score/threadmp.inl \332 $(cpukitdir)/score/inline/rtems/score/chain.inl \333 $(cpukitdir)/score/inline/rtems/score/heap.inl \334 $(cpukitdir)/score/inline/rtems/score/scheduler.inl \335 $(cpukitdir)/score/inline/rtems/score/threadq.inl \336 $(cpukitdir)/score/inline/rtems/score/corebarrier.inl \337 $(cpukitdir)/score/inline/rtems/score/isr.inl \338 $(cpukitdir)/score/inline/rtems/score/schedulerpriority.inl \339 $(cpukitdir)/score/inline/rtems/score/tod.inl \340 $(cpukitdir)/score/inline/rtems/score/coremsg.inl \341 $(cpukitdir)/score/inline/rtems/score/mppkt.inl \342 $(cpukitdir)/score/inline/rtems/score/stack.inl \343 $(cpukitdir)/score/inline/rtems/score/tqdata.inl \344 $(cpukitdir)/score/inline/rtems/score/coremutex.inl \345 $(cpukitdir)/score/inline/rtems/score/object.inl \346 $(cpukitdir)/score/inline/rtems/score/states.inl \347 $(cpukitdir)/score/inline/rtems/score/watchdog.inl \348 $(cpukitdir)/score/inline/rtems/score/corerwlock.inl \349 $(cpukitdir)/score/inline/rtems/score/objectmp.inl \350 $(cpukitdir)/score/inline/rtems/score/sysstate.inl \351 $(cpukitdir)/score/inline/rtems/score/wkspace.inl \352 $(cpukitdir)/score/inline/rtems/score/coresem.inl \353 $(cpukitdir)/score/inline/rtems/score/prioritybitmap.inl \354 $(cpukitdir)/score/inline/rtems/score/thread.inl \355 332 sched_cpu/rtems/score/cpu_asm.h \ 356 333 $(top_builddir)/score/include/rtems/score/cpuopts.h \ … … 368 345 ${cpukitdir}/rtems/include/rtems/rtems/ratemon.h \ 369 346 ${cpukitdir}/rtems/include/rtems/rtems/rtemsapi.h \ 370 ${cpukitdir}/rtems/include/rtems/rtems/eventset.h \371 347 ${cpukitdir}/rtems/include/rtems/rtems/mp.h \ 372 348 ${cpukitdir}/rtems/include/rtems/rtems/dpmem.h \ … … 394 370 ${cpukitdir}/rtems/include/rtems/rtems/signal.h \ 395 371 ${cpukitdir}/rtems/include/rtems/rtems/barrier.h \ 396 ${cpukitdir}/rtems/include/rtems/rtems/tasks.h \ 397 $(cpukitdir)/rtems/inline/rtems/rtems/asr.inl \ 398 $(cpukitdir)/rtems/inline/rtems/rtems/eventset.inl \ 399 $(cpukitdir)/rtems/inline/rtems/rtems/ratemon.inl \ 400 $(cpukitdir)/rtems/inline/rtems/rtems/tasks.inl \ 401 $(cpukitdir)/rtems/inline/rtems/rtems/attr.inl \ 402 $(cpukitdir)/rtems/inline/rtems/rtems/message.inl \ 403 $(cpukitdir)/rtems/inline/rtems/rtems/region.inl \ 404 $(cpukitdir)/rtems/inline/rtems/rtems/timer.inl \ 405 $(cpukitdir)/rtems/inline/rtems/rtems/barrier.inl \ 406 $(cpukitdir)/rtems/inline/rtems/rtems/modes.inl \ 407 $(cpukitdir)/rtems/inline/rtems/rtems/sem.inl \ 408 $(cpukitdir)/rtems/inline/rtems/rtems/dpmem.inl \ 409 $(cpukitdir)/rtems/inline/rtems/rtems/options.inl \ 410 $(cpukitdir)/rtems/inline/rtems/rtems/status.inl \ 411 $(cpukitdir)/rtems/inline/rtems/rtems/event.inl \ 412 $(cpukitdir)/rtems/inline/rtems/rtems/part.inl \ 413 $(cpukitdir)/rtems/inline/rtems/rtems/support.inl 372 ${cpukitdir}/rtems/include/rtems/rtems/tasks.h 414 373 415 374 schedsim_include_HEADERS += rtems_sched.h -
schedsim/rtems/rtems_init.c
r9a34e3a r726b27c 1 1 /* 2 2 * BASED UPON SOURCE IN RTEMS, MODIFIED FOR SIMULATOR 3 * 4 * COPYRIGHT (c) 1989-2013. 3 */ 4 5 /* 6 * COPYRIGHT (c) 1989-2014. 5 7 * On-Line Applications Research Corporation (OAR). 6 8 * … … 13 15 #define SCORE_INIT 14 16 #define RTEMS_API_INIT 17 #define POSIX_API_INIT 15 18 16 #include <rtems.h> 19 #include <rtems/system.h> 20 #include <rtems/config.h> 21 #include <rtems/debug.h> 22 #include <rtems/extensionimpl.h> 23 #include <rtems/fatal.h> 24 #include <rtems/init.h> 25 #include <rtems/io.h> 26 #include <rtems/score/sysstate.h> 27 17 28 #include <rtems/score/apiext.h> 18 #include <rtems/score/bitfield.h>19 29 #include <rtems/score/apimutex.h> 30 #include <rtems/score/cpusetimpl.h> 20 31 #include <rtems/score/userextimpl.h> 32 #include <rtems/score/schedulerimpl.h> 33 #include <rtems/score/smpimpl.h> 34 #include <rtems/score/threadimpl.h> 35 #include <rtems/score/todimpl.h> 36 #include <rtems/score/watchdogimpl.h> 21 37 #include <rtems/score/wkspace.h> 22 38 39 #include <rtems/rtems/tasksimpl.h> 40 #include <rtems/rtems/semimpl.h> 41 42 #include <rtems/posix/keyimpl.h> 43 44 /* 45 * Declare Object Information tables directly here instead of API 46 * specific initialization files as in cpukit/sapi/src. 47 */ 23 48 Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; 24 49 25 50 Objects_Information *_RTEMS_Objects[ OBJECTS_RTEMS_CLASSES_LAST + 1 ]; 51 52 Objects_Information *_POSIX_Objects[ OBJECTS_POSIX_CLASSES_LAST + 1 ]; 26 53 27 54 extern void check_heir_and_executing(void); … … 41 68 _Thread_Dispatch_initialization(); 42 69 43 /*44 * Before this is called, we are not allowed to allocate memory45 * from the Workspace because it is not initialized.46 */47 _Workspace_Handler_initialization(NULL, 0, NULL);48 49 #if defined(RTEMS_SMP)50 _SMP_Handler_initialize();51 #endif52 53 70 _User_extensions_Handler_initialization(); 54 55 71 _ISR_Handler_initialization(); 56 72 … … 60 76 _Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects; 61 77 62 _API_Mutex_Initialization( 1);78 _API_Mutex_Initialization( 2 ); 63 79 _API_Mutex_Allocate( &_RTEMS_Allocator_Mutex ); 80 _API_Mutex_Allocate( &_Once_Mutex ); 64 81 65 _Priority_bit_map_Handler_initialization();66 82 _Watchdog_Handler_initialization(); 67 83 _TOD_Handler_initialization(); … … 71 87 _Scheduler_Handler_initialization(); 72 88 89 _SMP_Handler_initialize(); 90 91 _CPU_set_Handler_initialization(); 73 92 74 93 /* MANAGERS */ … … 83 102 84 103 /* 104 * Install our API Object Management Table and initialize the 105 * various managers. 106 */ 107 _Objects_Information_table[OBJECTS_POSIX_API] = _POSIX_Objects; 108 109 _POSIX_Key_Manager_initialization(); 110 111 /* 85 112 * Discover and initialize the secondary cores in an SMP system. 86 113 */ 87 #if defined(RTEMS_SMP) 88 _SMP_Processor_count = 89 bsp_smp_initialize( rtems_configuration_smp_maximum_processors ); 90 #endif 114 _SMP_Handler_initialize(); 91 115 92 116 _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING ); … … 105 129 */ 106 130 107 _System_state_Set( SYSTEM_STATE_BEGIN_MULTITASKING ); 131 _System_state_Set( SYSTEM_STATE_UP ); 132 133 _SMP_Request_start_multitasking(); 108 134 109 135 _Thread_Start_multitasking(); … … 112 138 * Now we are back in a non-dispatching critical section 113 139 */ 114 _Thread_Dispatch_set_disable_level(0); 140 #if defined(RTEMS_SMP) 141 #error "NOT IMPLEMENTED" 142 #else 143 _Thread_Enable_dispatch(); 144 #endif 115 145 116 146 /* -
schedsim/rtems/sched_cpu/cpu_asm.c
r9a34e3a r726b27c 1 /* cpu_asm.c ===> cpu_asm.S or cpu_asm.s 1 /** 2 * @file 3 * 2 4 * BASED UPON SOURCE IN RTEMS, MODIFIED FOR SIMULATOR 3 5 * 4 * 5 * This file contains the basic algorithms for all assembly code used 6 * in an specific CPU port of RTEMS. These algorithms must be implemented 7 * in assembly language 8 * 9 * NOTE: This is supposed to be a .S or .s file NOT a C file. 10 * 11 * COPYRIGHT (c) 1989-2013. 6 * Every method in this file is stubbed. There are no real 7 * context switches or interrupts. 8 */ 9 10 /* 11 * COPYRIGHT (c) 1989-2014. 12 12 * On-Line Applications Research Corporation (OAR). 13 13 * … … 15 15 * found in the file LICENSE in this distribution or at 16 16 * http://www.rtems.com/license/LICENSE. 17 */18 19 /*20 * This is supposed to be an assembly file. This means that system.h21 * and cpu.h should not be included in a "real" cpu_asm file. An22 * implementation in assembly should include "cpu_asm.h>23 17 */ 24 18 … … 29 23 #include <rtems/system.h> 30 24 #include <rtems/score/cpu.h> 31 /* #include "cpu_asm.h> */32 33 /*34 * _CPU_Context_save_fp_context35 *36 * This routine is responsible for saving the FP context37 * at *fp_context_ptr. If the point to load the FP context38 * from is changed then the pointer is modified by this routine.39 *40 * Sometimes a macro implementation of this is in cpu.h which dereferences41 * the ** and a similarly named routine in this file is passed something42 * like a (Context_Control_fp *). The general rule on making this decision43 * is to avoid writing assembly language.44 *45 * NO_CPU Specific Information:46 *47 * XXX document implementation including references if appropriate48 */49 25 50 26 void _CPU_Context_save_fp( … … 54 30 } 55 31 56 /*57 * _CPU_Context_restore_fp_context58 *59 * This routine is responsible for restoring the FP context60 * at *fp_context_ptr. If the point to load the FP context61 * from is changed then the pointer is modified by this routine.62 *63 * Sometimes a macro implementation of this is in cpu.h which dereferences64 * the ** and a similarly named routine in this file is passed something65 * like a (Context_Control_fp *). The general rule on making this decision66 * is to avoid writing assembly language.67 *68 * NO_CPU Specific Information:69 *70 * XXX document implementation including references if appropriate71 */72 73 32 void _CPU_Context_restore_fp( 74 33 Context_Control_fp **fp_context_ptr … … 76 35 { 77 36 } 78 79 /* _CPU_Context_switch80 *81 * This routine performs a normal non-FP context switch.82 *83 * NO_CPU Specific Information:84 *85 * XXX document implementation including references if appropriate86 */87 37 88 38 void _CPU_Context_switch( … … 93 43 } 94 44 95 /*96 * _CPU_Context_restore97 *98 * This routine is generally used only to restart self in an99 * efficient manner. It may simply be a label in _CPU_Context_switch.100 *101 * NOTE: May be unnecessary to reload some registers.102 *103 * NO_CPU Specific Information:104 *105 * XXX document implementation including references if appropriate106 */107 108 45 void _CPU_Context_restore( 109 46 Context_Control *new_context … … 112 49 } 113 50 114 /* void __ISR_Handler()115 *116 * This routine provides the RTEMS interrupt management.117 *118 * NO_CPU Specific Information:119 *120 * XXX document implementation including references if appropriate121 */122 123 51 void _ISR_Handler(void) 124 52 { 125 /*126 * This discussion ignores a lot of the ugly details in a real127 * implementation such as saving enough registers/state to be128 * able to do something real. Keep in mind that the goal is129 * to invoke a user's ISR handler which is written in C and130 * uses a certain set of registers.131 *132 * Also note that the exact order is to a large extent flexible.133 * Hardware will dictate a sequence for a certain subset of134 * _ISR_Handler while requirements for setting135 */136 137 /*138 * At entry to "common" _ISR_Handler, the vector number must be139 * available. On some CPUs the hardware puts either the vector140 * number or the offset into the vector table for this ISR in a141 * known place. If the hardware does not give us this information,142 * then the assembly portion of RTEMS for this port will contain143 * a set of distinct interrupt entry points which somehow place144 * the vector number in a known place (which is safe if another145 * interrupt nests this one) and branches to _ISR_Handler.146 *147 * save some or all context on stack148 * may need to save some special interrupt information for exit149 *150 * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )151 * if ( _ISR_Nest_level == 0 )152 * switch to software interrupt stack153 * #endif154 *155 * _ISR_Nest_level++;156 *157 * _Thread_Dispatch_disable_level++;158 *159 * (*_ISR_Vector_table[ vector ])( vector );160 *161 * _Thread_Dispatch_disable_level--;162 *163 * --_ISR_Nest_level;164 *165 * if ( _ISR_Nest_level )166 * goto the label "exit interrupt (simple case)"167 *168 * if ( _Thread_Dispatch_disable_level )169 * _ISR_Signals_to_thread_executing = FALSE;170 * goto the label "exit interrupt (simple case)"171 *172 * if ( _Context_Switch_necessary || _ISR_Signals_to_thread_executing ) {173 * _ISR_Signals_to_thread_executing = FALSE;174 * call _Thread_Dispatch() or prepare to return to _ISR_Dispatch175 * prepare to get out of interrupt176 * return from interrupt (maybe to _ISR_Dispatch)177 *178 * LABEL "exit interrupt (simple case):179 * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )180 * if outermost interrupt181 * restore stack182 * #endif183 * prepare to get out of interrupt184 * return from interrupt185 */186 53 } -
schedsim/rtems/sched_cpu/rtems/score/cpu.h
r9a34e3a r726b27c 292 292 * XXX document implementation including references if appropriate 293 293 */ 294 #define CPU_USE_DEFERRED_FP_SWITCH TRUE294 #define CPU_USE_DEFERRED_FP_SWITCH FALSE 295 295 296 296 /** … … 461 461 * XXX document implementation including references if appropriate 462 462 */ 463 464 typedef struct { 465 /* There is no CPU specific per-CPU state */ 466 } CPU_Per_CPU_control; 463 467 464 468 /** … … 835 839 */ 836 840 #define _CPU_Context_Initialize( _the_context, _stack_base, _size, \ 837 _isr, _entry_point, _is_fp ) \841 _isr, _entry_point, _is_fp, tls_area ) \ 838 842 { \ 839 843 } … … 1124 1128 void _CPU_Install_interrupt_stack( void ); 1125 1129 1130 typedef uint32_t CPU_Counter_ticks; 1131 1132 CPU_Counter_ticks _CPU_Counter_read( void ); 1133 1134 CPU_Counter_ticks _CPU_Counter_difference( 1135 CPU_Counter_ticks second, 1136 CPU_Counter_ticks first 1137 ); 1138 1126 1139 /** 1127 1140 * This routine is the CPU dependent IDLE thread body. … … 1205 1218 ); 1206 1219 1220 #ifdef RTEMS_SMP 1221 #define _CPU_Context_switch_to_first_task_smp(_context ) 1222 1223 RTEMS_COMPILER_PURE_ATTRIBUTE static inline uint32_t 1224 _CPU_SMP_Get_current_processor( void ) 1225 { 1226 return 0; 1227 } 1228 1229 #define _CPU_SMP_Send_interrupt( dest); 1230 1231 static inline void _CPU_SMP_Processor_event_broadcast( void ) 1232 { 1233 } 1234 1235 static inline void _CPU_SMP_Processor_event_receive( void ) 1236 { 1237 } 1238 #endif 1207 1239 typedef struct { 1208 1240 uint32_t trap; … … 1284 1316 } while (0) 1285 1317 1286 #define _CPU_Context_switch_to_first_task_smp(_ignored)1287 1288 1318 #ifdef __cplusplus 1289 1319 } -
schedsim/rtems/sched_cpu/rtems/score/types.h
r9a34e3a r726b27c 32 32 */ 33 33 34 /** This defines the type for a priority bit map entry. */ 35 typedef uint16_t Priority_bit_map_Control; 34 typedef uint16_t Priority_bit_map_Word; 36 35 37 36 /** This defines the return type for an ISR entry point. */ -
schedsim/rtems/wkspace.c
r9a34e3a r726b27c 21 21 22 22 #include <stdlib.h> 23 #include <malloc.h> 23 24 25 #define DEBUG_WORKSPACE 24 26 #if defined(DEBUG_WORKSPACE) 25 27 #include <stdio.h> … … 59 61 return memory; 60 62 } 63 64 void *_Workspace_Allocate_aligned( size_t size, size_t alignment ) 65 { 66 void *memory; 67 int sc; 68 69 memory = memalign( alignment, size ); 70 #if defined(DEBUG_WORKSPACE) 71 fprintf( 72 stderr, 73 "Workspace_Allocate_aligned(%d, %d) from %p/%p -> %p\n", 74 size, 75 alignment, 76 __builtin_return_address( 0 ), 77 __builtin_return_address( 1 ), 78 memory 79 ); 80 #endif 81 return memory; 82 } 83 61 84 62 85 /* -
schedsim/shell/schedsim_priority/Makefile.am
r9a34e3a r726b27c 27 27 endif 28 28 29 schedsim_priority_LDFLAGS =-Wl,--wrap=_Thread_Dispatch 29 ## Ensure all linker provided symbols are available 30 schedsim_priority_LDFLAGS = 31 schedsim_priority_LDFLAGS += -Wl,--defsym=_TLS_Data_begin=0 32 schedsim_priority_LDFLAGS += -Wl,--defsym=_TLS_BSS_end=0 33 schedsim_priority_LDFLAGS += -Wl,--defsym=_TLS_Alignment=4 34 35 ## Wrap _Thread_Dispatch so we can see context switches 36 schedsim_priority_LDFLAGS += -Wl,--wrap=_Thread_Dispatch 37 38 ## Link in all support libraries 30 39 ## schedsim_priorityLDADD +=-Wl,--start-group 31 40 schedsim_priority_LDADD = ../shared/libschedsim.a -
schedsim/shell/schedsim_priority/smp_stub.c
r9a34e3a r726b27c 25 25 } 26 26 27 int bsp_smp_initialize(28 int maximum27 uint32_t bsp_smp_initialize( 28 uint32_t configured_cpu_count 29 29 ) 30 30 { 31 31 /* return the number of CPUs */ 32 return maximum;32 return configured_cpu_count; 33 33 } 34 34 -
schedsim/shell/schedsim_smpsimple/main_dispatch.c
r9a34e3a r726b27c 32 32 current_cpu = Schedsim_Current_cpu; 33 33 for ( cpu=0 ; cpu < _SMP_Processor_count ; cpu++ ) { 34 if ( _Per_CPU_Information[cpu]. dispatch_necessary ) {34 if ( _Per_CPU_Information[cpu].per_cpu.dispatch_necessary ) { 35 35 printf( "=== Invoke Thread Dispatch on CPU %d\n", cpu ); 36 36 Schedsim_Current_cpu = cpu; -
schedsim/shell/schedsim_smpsimple/main_dump_all_cpus.c
r9a34e3a r726b27c 37 37 ); 38 38 for ( cpu=0 ; cpu < _SMP_Processor_count ; cpu++ ) { 39 e = _Per_CPU_Information[cpu].executing; 40 h = _Per_CPU_Information[cpu].heir; 41 i = _Per_CPU_Information[cpu].idle; 39 e = _Per_CPU_Information[cpu].per_cpu.executing; 40 h = _Per_CPU_Information[cpu].per_cpu.heir; 42 41 printf( 43 " CPU %d: 0x%08x @%3ld / 0x%08x @%3ld / 0x%08x @%3ld%s\n",42 " CPU %d: 0x%08x @%3ld / 0x%08x @%3ld %s\n", 44 43 cpu, 45 44 e->Object.id, (long) e->current_priority, 46 45 h->Object.id, (long) h->current_priority, 47 i->Object.id, (long) i->current_priority,48 ((_Per_CPU_Information[cpu].dispatch_necessary) ?"true" : "false")46 ((_Per_CPU_Information[cpu].per_cpu.dispatch_necessary) ? 47 "true" : "false") 49 48 ); 50 49 } -
schedsim/shell/schedsim_smpsimple/main_dump_ready_tasks.c
r9a34e3a r726b27c 16 16 #include "shell.h" 17 17 #include "rtems_sched.h" 18 #include <rtems/score/chainimpl.h> 19 #include <rtems/score/thread.h> 18 20 19 21 #include <rtems/score/schedulerpriority.h> -
schedsim/shell/schedsim_smpsimple/smp_stub.c
r9a34e3a r726b27c 16 16 17 17 uint32_t Schedsim_Current_cpu; 18 extern uint32_t Schedsim_Maximum_CPUs_From_Command_Line; 18 19 19 20 void bsp_smp_secondary_cpu_initialize(int cpu) … … 27 28 } 28 29 29 int bsp_smp_initialize(30 int maximum30 uint32_t bsp_smp_initialize( 31 uint32_t configured_cpu_count 31 32 ) 32 33 { 34 if ( configured_cpu_count < Schedsim_Maximum_CPUs_From_Command_Line ) { 35 printf( 36 "ERROR - Maximum cores per confdefs.h is %d\n", 37 configured_cpu_count 38 ); 39 exit( 1 ); 40 } 41 33 42 /* return the number of CPUs */ 34 return maximum;43 return Schedsim_Maximum_CPUs_From_Command_Line; 35 44 } 36 45 -
schedsim/shell/shared/main_rtemsinit.c
r9a34e3a r726b27c 23 23 #if defined(RTEMS_SMP) 24 24 #include <rtems/score/smp.h> 25 26 uint32_t Schedsim_Maximum_CPUs_From_Command_Line; 25 27 #endif 28 26 29 27 30 int rtems_shell_main_rtems_init( … … 38 41 return -1; 39 42 } 40 rtems_configuration_smp_maximum_processors= cpus;43 Schedsim_Maximum_CPUs_From_Command_Line = cpus; 41 44 } 42 45 #endif -
schedsim/shell/shared/schedsim_shell.h
r9a34e3a r726b27c 14 14 15 15 #include <rtems.h> 16 #include <rtems/score/sysstate.h> 16 17 17 18 #ifdef __cplusplus
Note: See TracChangeset
for help on using the changeset viewer.