summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/smpimpl.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-01-25Remove make preinstallChris Johns1-354/+0
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
2017-07-12score: Fix typoSebastian Huber1-1/+1
Update #3059.
2017-07-07score: Introduce _SMP_Get_online_processors()Sebastian Huber1-0/+9
Update #3059.
2017-07-06score: Use <sys/bitset.h> for Processor_maskSebastian Huber1-2/+2
Implement the Processor_mask via <sys/bitset.h>. Provide _Processor_mask_To_uint32_t() to enable its use in device specific routines, e.g. interrupt affinity register in an interrupt controller. Update #3059.
2017-04-05SMP: Simplify SMP multicast actionsSebastian Huber1-5/+3
2016-12-09score: Remove fatal is internal indicatorSebastian Huber1-1/+1
The fatal is internal indicator is redundant since the fatal source and error code uniquely identify a fatal error. Keep the fatal user extension is internal parameter for backward compatibility and set it to false always. Update #2825.
2016-06-29score: Fix SMP message handlingSebastian Huber1-8/+10
According to the C11 standard only atomic read-modify-write operations guarantee that the last value written in modification order is read, see "7.17.3 Order and consistency". Thus we must use a read-modify-write in _SMP_Inter_processor_interrupt_handler() to make sure we read an up-to-date message.
2016-03-04score: Distribute clock tick to all online CPUsSebastian Huber1-12/+22
Update #2554.
2016-03-04score: Add _SMP_Before_multitasking_action()Sebastian Huber1-2/+46
The use case for this is the Cortex-A9 MPCore which has per-processor registers (only accessible by a particular processor) for the global timer used by the clock driver. This might be useful for other drivers as well. Update #2554.
2016-03-04score: Add _SMP_Online_processorsSebastian Huber1-0/+11
2015-10-26basedefs.h: Add and use RTEMS_NO_RETURNSebastian Huber1-1/+1
2015-09-28SMP: Fix and optimize thread dispatchingSebastian Huber1-0/+6
According to the C11 and C++11 memory models only a read-modify-write operation guarantees that we read the last value written in modification order. Avoid the sequential consistent thread fence and instead use the inter-processor interrupt to set the thread dispatch necessary indicator.
2015-04-20score: Refactor SMP cache manager supportSebastian Huber1-8/+25
2015-01-09smp: Add and use _SMP_Should_start_processor()Sebastian Huber1-0/+11
2014-08-22score: Add SMP support to the cache managerDaniel Cederman1-0/+19
Adds functions that allows the user to specify which cores that should perform the cache operation. SMP messages are sent to all the specified cores and the caller waits until all cores have acknowledged that they have flushed their cache. If CPU_CACHE_NO_INSTRUCTION_CACHE_SNOOPING is defined the instruction cache invalidation function will perform the operation on all cores using the previous method.
2014-08-22score: Rename SMP broadcast message functionDaniel Cederman1-2/+2
Change message type to unsigned long to match other SMP message functions.
2014-08-22score: Add function to send a SMP message to a set of CPUsDaniel Cederman1-0/+15
2014-06-05score: Delete SMP_FATAL_SHUTDOWN_EARLYSebastian Huber1-4/+3
Sort enum lexicographically.
2014-05-26score: Fix race condition in SMP startupSebastian Huber1-1/+2
Do not use the Per_CPU_Control::started in _SMP_Start_multitasking_on_secondary_processor() since this field may be not up to date when a secondary processor reads it. Use the read-only scheduler assignment instead. Add a new fatal error SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR. This prevents out-of-bounds access. It is currently not possible to test these fatal errors. One option would be to fake values of the _CPU_SMP_Get_current_processor(), but unfortunately this function is inline on some architectures.
2014-05-23score: Use _SMP_Fatal()Sebastian Huber1-1/+1
2014-05-23SMP: make IPI fatal code uniqueDaniel Hellstrom1-2/+3
The same smp fatal code is used in percpu _Per_CPU_State_change(). In order to determine which CPU requested a fatal shutdown and which CPU responds to it a unique code should be used. A unique code makes it also possible to handle the CPUs differently in the fatal exception handler.
2014-05-05score: Use atomic operations for SMP messagesSebastian Huber1-11/+9
2014-05-05score: Add SMP test message handlerSebastian Huber1-0/+28
This handler can be used to test the inter-processor interrupt implementation.
2014-05-05score: SMP_FATAL_SCHEDULER_WITHOUT_PROCESSORSSebastian Huber1-1/+0
Avoid the SMP_FATAL_SCHEDULER_WITHOUT_PROCESSORS fatal error and make it a run-time error in rtems_scheduler_ident() and _Scheduler_Get_by_id().
2014-04-22score: Use common names for per-CPU variablesSebastian Huber1-8/+8
Use "cpu" for an arbitrary Per_CPU_Control variable. Use "cpu_self" for the Per_CPU_Control of the current processor. Use "cpu_index" for an arbitrary processor index. Use "cpu_index_self" for the processor index of the current processor. Use "cpu_count" for the processor count obtained via _SMP_Get_processor_count(). Use "cpu_max" for the processor maximum obtained by rtems_configuration_get_maximum_processors().
2014-04-15score: Add clustered/partitioned schedulingSebastian Huber1-0/+9
Clustered/partitioned scheduling helps to control the worst-case latencies in the system. The goal is to reduce the amount of shared state in the system and thus prevention of lock contention. Modern multi-processor systems tend to have several layers of data and instruction caches. With clustered/partitioned scheduling it is possible to honour the cache topology of a system and thus avoid expensive cache synchronization traffic. We have clustered scheduling in case the set of processors of a system is partitioned into non-empty pairwise-disjoint subsets. These subsets are called clusters. Clusters with a cardinality of one are partitions. Each cluster is owned by exactly one scheduler instance.
2014-04-14score: SMP initialization changesSebastian Huber1-1/+2
Add and use _CPU_SMP_Start_processor(). Add and use _CPU_SMP_Finalize_initialization(). This makes most _CPU_SMP_Initialize() functions a bit simpler since we can calculate the minimum value of the count of processors requested by the application configuration and the count of physically or virtually available processors in the high-level code. The CPU port has now the ability to signal a processor start failure. With the support for clustered/partitioned scheduling the presence of particular processors can be configured to be optional or mandatory. There will be a fatal error only in case mandatory processors are not present. The CPU port may use a timeout to monitor the start of a processor.
2014-03-31score: Add per-CPU state functionSebastian Huber1-1/+2
Add _Per_CPU_State_wait_for_ready_to_start_multitasking(). Add new fatal SMP error SMP_FATAL_SHUTDOWN_EARLY.
2014-03-21Change all references of rtems.com to rtems.org.Chris Johns1-1/+1
2014-03-06score: SMP initialization and shutdown changesSebastian Huber1-12/+10
Rename _SMP_Request_other_cores_to_perform_first_context_switch() into _SMP_Request_start_multitasking() since this requests now a multitasking start on all configured and available processors. The name corresponds _Thread_Start_multitasking() and _SMP_Start_multitasking_on_secondary_processor() actions issued in response to this request. Move in source file to right place. Rename PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING into PER_CPU_STATE_READY_TO_START_MULTITASKING. Rename PER_CPU_STATE_BEGIN_MULTITASKING into PER_CPU_STATE_REQUEST_START_MULTITASKING. Rename _SMP_Request_other_cores_to_shutdown() into _SMP_Request_shutdown(). Add a per-CPU state lock to protect all changes. This was necessary to offer a controlled shutdown of the system (atomic read/writes alone are not sufficient for this kind of synchronization). Add documentation for Per_CPU_State. Delete debug output. New tests smptests/smpfatal01 and smptests/smpfatal02.
2014-02-19score: _SMP_Inter_processor_interrupt_handler()Sebastian Huber1-1/+23
Inline _SMP_Inter_processor_interrupt_handler() to avoid function call overhead. Remove debug output.
2014-02-19score: Rename rtems_smp_process_interrupt()Sebastian Huber1-0/+5
Rename rtems_smp_process_interrupt() into _SMP_Inter_processor_interrupt_handler(). Delete unused header file <rtems/bspsmp.h>.
2014-02-19score: Rename rtems_smp_secondary_cpu_initialize()Sebastian Huber1-0/+27
Rename rtems_smp_secondary_cpu_initialize() into _SMP_Start_multitasking_on_secondary_processor(). Move declaration to <rtems/score/smpimpl.h>.
2014-02-19score: Add and use <rtems/score/smpimpl.h>Sebastian Huber1-25/+21
Collect SMP implementation specific parts in the <rtems/score/smpimpl.h> header file.
2014-02-19score: Remove ASM guardSebastian Huber1-4/+0
2014-02-19score: Rename RTEMS_BSP_SMP_SHUTDOWNSebastian Huber1-6/+6
Rename RTEMS_BSP_SMP_SHUTDOWN in SMP_MESSAGE_SHUTDOWN since SMP messages have nothing to do with the BSP. Use UINT32_C() instead of casts.
2014-02-19score: Add RTEMS_FATAL_SOURCE_SMPSebastian Huber1-0/+7
Use rtems_fatal() instead of _CPU_Fatal_halt() to shutdown processors in SMP configurations since this allows intervention of BSP or application specific fatal extensions.
2014-02-19score: Move _SMP_Request_other_cores_to_shutdown()Sebastian Huber1-3/+8
Move _SMP_Request_other_cores_to_shutdown() invocation from rtems_shutdown_executive() to _Internal_error_Occurred() to allow a proper shutdown on SMP configurations even in the error case.
2013-08-21smp: Delete RTEMS_BSP_SMP_SIGNAL_TO_SELFSebastian Huber1-7/+0
2013-07-30smp: Delete _SMP_Request_other_cores_to_dispatch()Sebastian Huber1-8/+0
Use an event triggered unicast to inform remote processors about a necessary thread dispatch instead.
2013-07-17smp: Add and use _CPU_SMP_Get_current_processor()Sebastian Huber1-1/+11
Add and use _SMP_Get_current_processor() and rtems_smp_get_current_processor(). Delete bsp_smp_interrupt_cpu(). Change type of current processor index from int to uint32_t to match _SMP_Processor_count type.
2013-07-17smp: Delete RTEMS_BSP_SMP_CONTEXT_SWITCH_NECESSARYSebastian Huber1-7/+0
The thread dispatch is a side-effect of interrupt processing, thus there is no need to send an explicit message.
2013-06-14score: Rename rtems_smp_get_number_of_processors()Sebastian Huber1-28/+32
Rename in rtems_smp_get_processor_count(). Always provide <rtems/score/smp.h> and <rtems/rtems/smp.h>. Add _SMP_Get_processor_count(). This function will be a compile time constant defined to be one on uni-processor configurations. This allows iterations over all processors without overhead on uni-processor configurations.
2013-05-29smp: Simplify SMP initialization sequenceSebastian Huber1-7/+10
Delete bsp_smp_wait_for(). Other parts of the system work without timeout, e.g. the spinlocks. Using a timeout here does not make the system more robust. Delete bsp_smp_cpu_state and replace it with Per_CPU_State. The Per_CPU_State follows the Score naming conventions. Add _Per_CPU_Change_state() and _Per_CPU_Wait_for_state() functions to change and observe states. Use Per_CPU_State in Per_CPU_Control instead of the anonymous integer. Add _CPU_Processor_event_broadcast() and _CPU_Processor_event_receive() functions provided by the CPU port. Use these functions in _Per_CPU_Change_state() and _Per_CPU_Wait_for_state(). Add prototype for _SMP_Send_message(). Delete RTEMS_BSP_SMP_FIRST_TASK message. The first context switch is now performed in rtems_smp_secondary_cpu_initialize(). Issuing the first context switch in the context of the inter-processor interrupt is not possible on systems with a modern interrupt controller. Such an interrupt controler usually requires a handshake protocol with interrupt acknowledge and end of interrupt signals. A direct context switch in an interrupt handler circumvents the interrupt processing epilogue and may leave the system in an inconsistent state. Release lock in rtems_smp_process_interrupt() even if no message was delivered. This prevents deadlock of the system. Simplify and format _SMP_Send_message(), _SMP_Request_other_cores_to_perform_first_context_switch(), _SMP_Request_other_cores_to_dispatch() and _SMP_Request_other_cores_to_shutdown().
2013-01-10cpukit: Doxygen group fixes and many warnings addressedJoel Sherrill1-3/+3
The output of the modules.html is much improved. Most filesystem and POSIX API related groups are properly nested. Some formatting issues were addressed as were multiple inconsistencies.
2012-12-28score: Doxygen Clean Up Task #2Mathew Kallada1-6/+10
2012-05-11Remove All CVS Id Strings Possible Using a ScriptJoel Sherrill1-2/+0
Script does what is expected and tries to do it as smartly as possible. + remove occurrences of two blank comment lines next to each other after Id string line removed. + remove entire comment blocks which only exited to contain CVS Ids + If the processing left a blank line at the top of a file, it was removed.
2011-06-172011-06-17 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-0/+2
* rtems/include/rtems/rtems/types.h, score/include/rtems/score/address.h, score/include/rtems/score/apiext.h, score/include/rtems/score/bitfield.h, score/include/rtems/score/context.h, score/include/rtems/score/corebarrier.h, score/include/rtems/score/coremsg.h, score/include/rtems/score/coremutex.h, score/include/rtems/score/corerwlock.h, score/include/rtems/score/coresem.h, score/include/rtems/score/corespinlock.h, score/include/rtems/score/interr.h, score/include/rtems/score/isr.h, score/include/rtems/score/mpci.h, score/include/rtems/score/mppkt.h, score/include/rtems/score/objectmp.h, score/include/rtems/score/percpu.h, score/include/rtems/score/priority.h, score/include/rtems/score/rbtree.h, score/include/rtems/score/scheduler.h, score/include/rtems/score/smp.h, score/include/rtems/score/smplock.h, score/include/rtems/score/stack.h, score/include/rtems/score/states.h, score/include/rtems/score/thread.h, score/include/rtems/score/threadq.h, score/include/rtems/score/threadsync.h, score/include/rtems/score/timespec.h, score/include/rtems/score/timestamp.h, score/include/rtems/score/timestamp64.h, score/include/rtems/score/tod.h, score/include/rtems/score/tqdata.h, score/include/rtems/score/watchdog.h, score/include/rtems/score/wkspace.h: Mark Score files as in Score Group to improve Doxygen output.
2011-05-262011-05-26 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett1-0/+8
PR 1796/cpukit * sapi/src/exshutdown.c, score/include/rtems/score/percpu.h, score/include/rtems/score/smp.h, score/src/smp.c, score/src/threaddispatch.c, score/src/threadhandler.c: Added SMP interprocess communications.
2011-05-24Remove white-spaces.Ralf Corsepius1-1/+1