summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/objectimpl.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove make preinstallChris Johns2018-01-251-1002/+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.
* score: Use self-contained API mutexSebastian Huber2017-12-041-3/+2
| | | | | | | | | | Use a self-contained recursive mutex for API_Mutex_Control. The API mutexes are protected against asynchronous thread cancellation. Add dedicated mutexes for libatomic and TOD. Close #2629. Close #2630.
* posix: Implement self-contained POSIX mutexSebastian Huber2017-10-051-1/+0
| | | | | | | | POSIX mutexes are now available in all configurations and no longer depend on --enable-posix. Update #2514. Update #3112.
* posix: Implement self-contained POSIX condvarSebastian Huber2017-10-051-1/+0
| | | | | | | | POSIX condition variables are now available in all configurations and no longer depend on --enable-posix. Update #2514. Update #3113.
* posix: Implement self-contained POSIX rwlocksSebastian Huber2017-10-051-1/+0
| | | | | | | | POSIX rwlocks are now available in all configurations and no longer depend on --enable-posix. Update #2514. Update #3115.
* posix: Implement self-contained POSIX barriersSebastian Huber2017-10-051-1/+0
| | | | | | | | POSIX barriers are now available in all configurations and no longer depend on --enable-posix. Update #2514. Update #3114.
* posix: shared memory supportGedare Bloom2017-01-131-2/+3
| | | | | | | | | Add POSIX shared memory manager (Shm). Includes a hook-based approach for the backing memory storage that defaults to the Workspace, and a test is provided using the heap. A test is also provided for the basic use of mmap'ing a shared memory object. This test currently fails at the mmap stage due to no support for mmap.
* score: Add and use _Objects_Name_to_string()Sebastian Huber2017-01-131-0/+21
| | | | Update #2858.
* posix: Add self-contained pthread spinlockSebastian Huber2016-11-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Turn pthread_spinlock_t into a self-contained object. On uni-processor configurations, interrupts are disabled in the lock/trylock operations and the previous interrupt status is restored in the corresponding unlock operations. On SMP configurations, a ticket lock is a acquired and released in addition. The self-contained pthread_spinlock_t object is defined by Newlib in <sys/_pthreadtypes.h>. typedef struct { struct _Ticket_lock_Control _lock; __uint32_t _interrupt_state; } pthread_spinlock_t; This implementation is simple and efficient. However, this test case of the Linux Test Project would fail due to call of printf() and sleep() during spin lock ownership: https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c There is only limited support for profiling on SMP configurations. Delete CORE spinlock implementation. Update #2674.
* score: Rename _Objects_Get_local()Sebastian Huber2016-05-201-1/+1
| | | | | | Rename _Objects_Get_local() into _Objects_Get(). Confusions with the previous _Objects_Get() function are avoided since the Objects_Locations parameter is gone.
* score: Delete unused _Objects_Get_isr_disable()Sebastian Huber2016-05-201-42/+0
| | | | Delete now unused Objects_Locations.
* score: Delete unused _Objects_Get_local_object()Sebastian Huber2016-05-201-27/+0
|
* score: Delete unused _Objects_Get()Sebastian Huber2016-05-201-100/+16
| | | | Update #2555.
* score: Make _Objects_Information_table constSebastian Huber2016-05-041-2/+2
| | | | | The _Objects_Information_table is statically initialized. So, we can make it read-only.
* score: Optimize _Objects_Get_local()Sebastian Huber2016-05-021-3/+5
| | | | | Make the interrupt lock context the second parameter to avoid register moves.
* posix: Simplify message queuesSebastian Huber2016-05-021-1/+0
| | | | | | | | | | | | The mq_open() function returns a descriptor to a POSIX message queue object identified by a name. This is similar to sem_open(). In contrast to the POSIX semaphore the POSIX message queues use a separate object for the descriptor. This extra object is superfluous, since the object identifier can be used directly for this purpose, just like for the semaphores. Update #2702. Update #2555.
* score: Optimize _Objects_Get_local()Sebastian Huber2016-04-211-3/+4
| | | | | Make the id the first parameter since usual callers get the object identifier as the first parameter themself.
* score: Optimize _Objects_Get_no_protection()Sebastian Huber2016-04-211-3/+5
| | | | | Make the id the first parameter since usual callers get the object identifier as the first parameter themself.
* score: Simplify _Objects_Get_next()Sebastian Huber2016-04-211-6/+6
| | | | Remove unused location parameter.
* score: Simplify _Objects_Initialize_information()Sebastian Huber2016-04-211-12/+56
| | | | | | Remove unused supports_global parameter. Convert _Objects_Initialize_information() to a macro to avoid use of RTEMS_MULTIPROCESSING define for each caller.
* score: Simplify _Objects_Get_no_protection()Sebastian Huber2016-04-121-4/+2
| | | | | | | This functions supports only local objects. Thus, drop the location parameter which was unused by all callers. Remove superfluous includes from Classic Region implementation.
* score: Use red-black tree for active global objectsSebastian Huber2016-04-061-2/+14
| | | | | | | Use a red-black tree to lookup active global objects by identifier or name. Update #2555.
* score: Objects_Thread_queue_Extract_calloutSebastian Huber2016-03-301-1/+4
| | | | | Change parameters of the objects thread queue extract callout to avoid a cast and explicit use of the thread wait information.
* score: Always declare _Objects_Get_by_name()Sebastian Huber2016-03-221-2/+0
| | | | | | | Still define it only if RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES is defined. Close #2672.
* score: Add _Objects_Get_by_name()Sebastian Huber2016-03-181-14/+25
| | | | | | | | | | Replace _Objects_Name_to_id_string() with _Objects_Get_by_name() since all users of this function are interested in the object itself and not the identifier. Use the object allocator lock to protect the search. Update #2555.
* score: Use allocator lock in _Objects_Get_next()Sebastian Huber2016-03-161-1/+4
| | | | | | | | Use the object allocator lock in _Objects_Get_next() instead of disabled thread dispatching since object creation and deletion is covered by this lock. Update #2555.
* score: Add and use _Objects_Get_local()Sebastian Huber2016-03-141-0/+23
| | | | | | This simplifies the handling with local-only objects. Update #2555.
* score: Avoid SCORE_EXTERNSebastian Huber2016-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Delete SCORE_INIT. This finally removes the some.h: #ifndef SOME_XYZ_EXTERN #define SOME_XYZ_EXTERN extern #endif SOME_XYZ_EXTERN type xyz; some_xyz.c: #define SOME_XYZ_EXTERN #include <some.h> pattern in favour of some.h: extern type xyz; some_xyz.c #include <some.h> type xyz; Update #2559.
* Statically initialize _Objects_Information_tableSebastian Huber2016-02-031-1/+1
|
* basdefs.h: Add and use RTEMS_UNUSEDSebastian Huber2015-10-261-1/+1
|
* score: Introduce Thread_queue_HeadsSebastian Huber2015-07-231-0/+7
| | | | | | | | | | | | | Move the storage for the thread queue heads to the threads. Each thread provides a set of thread queue heads allocated from a dedicated memory pool. In case a thread blocks on a queue, then it lends its heads to the queue. In case the thread unblocks, then it takes a free set of threads from the queue. Since a thread can block on at most one queue this works. This mechanism is used in FreeBSD. The motivation for this change is to reduce the memory demands of the synchronization objects. On a 32-bit uni-processor configuration the Thread_queue_Control size is now 8 bytes, compared to 64 bytes in RTEMS 4.10 (other changes reduced the size as well).
* score: Delete _Objects_Put_for_get_isr_disable()Sebastian Huber2015-05-191-10/+0
| | | | | This function is superfluous due to the introduction of fine grained locking.
* score: Delete object control block ISR lockSebastian Huber2015-04-211-95/+0
| | | | | | | The Objects_Control::Lock was a software layer violation. It worked only for the threads since they are somewhat special. Update #2273.
* score: Modify _Thread_Dispatch_disable_critical()Sebastian Huber2015-04-211-2/+2
| | | | | Return the current processor to be in line with _Thread_Disable_dispatch().
* score: _Objects_Get_isr_disable()Sebastian Huber2015-04-211-3/+0
| | | | | | | | Do not disable thread dispatching and do not acquire the Giant lock. This makes it possible to use this object get variant for fine grained locking. Update #2273.
* score: _Objects_Get_isr_disable()Sebastian Huber2015-04-211-3/+3
| | | | | | | Use ISR_lock_Context instead of ISR_Level to allow use of ISR locks for low-level locking. Update #2273.
* score: Add _Objects_ISR_disable_and_acquire()Sebastian Huber2015-03-151-7/+22
|
* score: Add ISR lock to Objects_ControlSebastian Huber2015-03-051-0/+80
| | | | | | | | | This enables per-object SMP locks on SMP configurations and is the first step to support fine-grained locking. On uni-processor configuration there will be no overhead. The _Objects_Acquire() is intended to replace _Objects_Get_isr_disable(). Update #2273.
* objectimpl.h: Add _Assert() to _Objects_Invalidate_Id()Josh Oguin2014-11-261-0/+6
| | | | | CodeSonar flagged this as a possible NULL deference. This should never occur but adding the _Assert() ensures we are guarding against that.
* rtems: Add scheduler identificationSebastian Huber2014-04-151-0/+9
|
* score: PR2152: Use allocator mutex for objectsSebastian Huber2014-03-311-10/+137
| | | | | Use allocator mutex for objects allocate/free. This prevents that the thread dispatch latency depends on the workspace/heap fragmentation.
* score: Use thread action for thread restartSebastian Huber2014-03-311-17/+0
| | | | | The thread restart is now supported on SMP. New test smptests/smpthreadlife01.
* score: Set name before object is made publicSebastian Huber2014-03-241-10/+10
|
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* score: Objects_Information::extract visibilitySebastian Huber2013-11-181-2/+2
| | | | This filed is only used if RTEMS_MULTIPROCESSING is defined.
* score: Per-CPU thread dispatch disable levelSebastian Huber2013-08-091-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a per-CPU thread dispatch disable level. So instead of one global thread dispatch disable level we have now one instance per processor. This is a major performance improvement for SMP. On non-SMP configurations this may simplifiy the interrupt entry/exit code. The giant lock is still present, but it is now decoupled from the thread dispatching in _Thread_Dispatch(), _Thread_Handler(), _Thread_Restart_self() and the interrupt entry/exit. Access to the giant lock is now available via _Giant_Acquire() and _Giant_Release(). The giant lock is still implicitly acquired via _Thread_Dispatch_decrement_disable_level(). The giant lock is only acquired for high-level operations in interrupt handlers (e.g. release of a semaphore, sending of an event). As a side-effect this change fixes the lost thread dispatch necessary indication bug in _Thread_Dispatch(). A per-CPU thread dispatch disable level greatly simplifies the SMP support for the interrupt entry/exit code since no spin locks have to be acquired in this area. It is only necessary to get the current processor index and use this to calculate the address of the own per-CPU control. This reduces the interrupt latency considerably. All elements for the interrupt entry/exit code are now part of the Per_CPU_Control structure: thread dispatch disable level, ISR nest level and thread dispatch necessary. Nothing else is required (except CPU port specific stuff like on SPARC).
* score: Move object content to public APISebastian Huber2013-07-281-23/+0
|
* score: Create object implementation headerSebastian Huber2013-07-261-0/+930
Move implementation specific parts of object.h and object.inl into new header file objectimpl.h. The object.h contains now only the application visible API.