Commit Graph

468 Commits

Author SHA1 Message Date
Sebastian Huber
eae4541d7b Clarify simple timecounter documentation 2016-12-21 09:27:19 +01:00
Sebastian Huber
b6606e8d99 score: Remove fatal is internal indicator
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-12-09 08:47:51 +01:00
Sebastian Huber
c42be504c9 posix: Add self-contained pthread spinlock
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.
2016-11-23 12:52:06 +01:00
Sebastian Huber
e6107854b2 score: Rename _Scheduler_Assignments
Rename _Scheduler_Assignments into _Scheduler_Initial_assignments to
make it clear that they may not reflect the run-time scheduler
assignment.

Update #2797.
2016-11-09 15:27:29 +01:00
Sebastian Huber
5d6b211981 score: Add scheduler node table for each thread
Update #2556.
2016-09-21 08:59:32 +02:00
Sebastian Huber
796f12a85a score: Add missing const qualifiers 2016-09-06 10:52:19 +02:00
Sebastian Huber
059529e685 score: Add debug support to chains
This helps to detect

 * double insert, append, prepend errors, and
 * get from empty chain errors.
2016-07-22 09:13:07 +02:00
Sebastian Huber
69a6802bfa score: Move _RBTree_Find()
The _RBTree_Find() is no longer used in the score.  Move it to sapi and
make it rtems_rbtree_find().  Move corresponding types and support
functions to sapi.
2016-06-22 14:37:11 +02:00
Sebastian Huber
768c483b70 score: Move _RBTree_Insert()
The _RBTree_Insert() is no longer used in the score.  Move it to sapi
and make it rtems_rbtree_insert().
2016-06-22 14:37:11 +02:00
Sebastian Huber
251c94d3d3 confdefs.h: Do not hide network file systems
Do not hide network file systems if RTEMS_NETWORKING is not defined,
since they may be provided by the LibBSD.
2016-06-09 11:17:13 +02:00
Sebastian Huber
25e28d84d7 confdefs.h: Fix heap alloc size estimate
Account for the heap minimum block size.
2016-05-25 12:43:53 +02:00
Chris Johns
24d0ee57a4 cpukit, testsuite: Add rtems_printf and rtems_printer support.
This change adds rtems_printf and related functions and wraps the
RTEMS print plugin support into a user API. All references to the
plugin are removed and replaced with the rtems_printer interface.

Printk and related functions are made to return a valid number of
characters formatted and output.

The function attribute to check printf functions has been added
to rtems_printf and printk. No changes to remove warrnings are part
of this patch set.

The testsuite has been moved over to the rtems_printer. The testsuite
has a mix of rtems_printer access and direct print control via the
tmacros.h header file. The support for begink/endk has been removed
as it served no purpose and only confused the code base. The testsuite
has not been refactored to use rtems_printf. This is future work.
2016-05-25 15:47:34 +10:00
Sebastian Huber
7dfb4b970c score: Add per scheduler instance maximum priority
The priority values are only valid within a scheduler instance.  Thus,
the maximum priority value must be defined per scheduler instance.  The
first scheduler instance defines PRIORITY_MAXIMUM.  This implies that
RTEMS_MAXIMUM_PRIORITY and POSIX_SCHEDULER_MAXIMUM_PRIORITY are only
valid for threads of the first scheduler instance.  Further
API/implementation changes are necessary to fix this.

Update #2556.
2016-05-20 16:11:02 +02:00
Sebastian Huber
1d40d81b4b rtems: Remove task variables
Update #2494.
Update #2555.
2016-05-04 07:24:30 +02:00
Sebastian Huber
b1b6f3b0e0 confdefs.h: Fix message queue size estimate
Account for maximum message size alignment.  Simplify
_CORE_message_queue_Initialize().
2016-05-04 07:24:29 +02:00
Sebastian Huber
e4fd35ddcb confdefs.h: Fix named object size estimate
Account for the terminating null character.  Use _POSIX_PATH_MAX instead
of NAME_MAX according to _POSIX_Semaphore_Manager_initialization() and
_POSIX_Message_queue_Manager_initialization().
2016-05-04 07:24:29 +02:00
Sebastian Huber
981eed2176 score: Add dummy Strong APA scheduler
Start with a copy of the Priority SMP scheduler implementation.

Update #2510.
2016-05-02 07:46:17 +02:00
Sebastian Huber
c8982e5f6a posix: Simplify message queues
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.
2016-05-02 07:46:15 +02:00
Sebastian Huber
d7a12be9c3 score: Optimize _Objects_Get_no_protection()
Make the id the first parameter since usual callers get the object
identifier as the first parameter themself.
2016-04-21 07:29:40 +02:00
Sebastian Huber
362722795a sapi: Avoid Giant lock for extensions
Extension create and delete is protected by the object allocator lock.

Update #2555.
2016-04-18 08:20:12 +02:00
Sebastian Huber
d995a263b5 score: Delete _Chain_Append()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:24 +02:00
Sebastian Huber
3bf2bcc8c6 score: Delete _Chain_Get()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:24 +02:00
Sebastian Huber
223fff46b8 score: Delete _Chain_Extract()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:23 +02:00
Sebastian Huber
b0354b0eee score: Delete _Chain_Insert()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:23 +02:00
Sebastian Huber
cd90052365 score: Delete _Chain_Get_with_empty_check()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:23 +02:00
Sebastian Huber
c130387985 score: Delete _Chain_Prepend_with_empty_check()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:23 +02:00
Sebastian Huber
88f4157c93 score: Delete _Chain_Append_with_empty_check()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:23 +02:00
Sebastian Huber
6406b693b6 score: Delete _Chain_Prepend()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:22 +02:00
Sebastian Huber
84f5c0a91b score: Use red-black tree for active global objects
Use a red-black tree to lookup active global objects by identifier or
name.

Update #2555.
2016-04-06 09:08:22 +02:00
Sebastian Huber
349dd6b9cb score: Fix MPCI workspace size estimate
Account for the global objects table.
2016-03-29 13:21:31 +02:00
Sebastian Huber
4182b6f2a3 score: Fix MPCI workspace size estimate
Global objects are no real objects with an objects information
structure.
2016-03-29 13:21:31 +02:00
Sebastian Huber
9a97288911 score: Fix MPCI receive server workspace size 2016-03-29 13:21:12 +02:00
Sebastian Huber
16832b0d9e score: Fix multiprocessing thread proxies
We must provide thread queue heads for the thread wait information for
each thread proxy (thread queue heads were introduced by
d7665823b2).  The thread proxy must be
allocated before the enqueue operation.
2016-03-29 12:06:55 +02:00
Sebastian Huber
18ff889624 score: Use ISR lock for IO driver registration
Create implementation header file.

Update #2555.
2016-03-14 10:56:22 +01:00
Sebastian Huber
62d2540dae score: Delete unused SAPI_IO_EXTERN
Update #2559.
2016-03-14 09:41:37 +01:00
Sebastian Huber
4210114032 Use linker set for POSIX User Threads init
Update #2408.
2016-02-03 10:00:58 +01:00
Sebastian Huber
1ff8eca17a Use linker set for Classic User Tasks init
Update #2408.
2016-02-03 10:00:58 +01:00
Sebastian Huber
8ca372e9b4 Use linker set for MPCI initialization
Update #2408.
2016-02-03 10:00:57 +01:00
Sebastian Huber
ca4602e914 Use linker set for libio initialization
Update #2408.
2016-02-03 10:00:57 +01:00
Sebastian Huber
f64c6b4c49 Use atexit() handler to close std file descriptors 2016-02-03 10:00:57 +01:00
Sebastian Huber
3d36164fe5 Use linker set for root file system initialization
Update #2408.
2016-02-03 10:00:57 +01:00
Sebastian Huber
92bb345374 Optional Extensions initialization
Update #2408.
2016-02-03 10:00:51 +01:00
Sebastian Huber
a853c8518d Optional Initial Extensions initialization
Update #2408.
2016-02-03 10:00:51 +01:00
Sebastian Huber
76ac1ee3bb score: Fix simple timecounter support
Update #2502.
2016-01-19 08:36:14 +01:00
Sebastian Huber
ccd54344d9 score: Introduce Thread_Entry_information
This avoids potential dead code in _Thread_Handler().  It gets rid of
the dangerous function pointer casts.

Update #2514.
2016-01-11 08:47:01 +01:00
Aun-Ali Zaidi
d5154d0f6a api: Remove deprecated Notepads
Notepads where a feature of RTEMS' tasks that simply functioned in
the same way as POSIX keys or threaded local storage (TLS). They were
introduced well before per task variables, which are also deprecated,
and were barely used in favor of their POSIX alternatives.

In addition to their scarce usage, Notepads took up unnecessary memory.
For each task:

 - 16 32-bit integers were allocated.
 - A total of 64 bytes per task per thread.

This is especially critical in low memory and safety-critical applications.

They are also defined as uint32_t, and therefore are not guaranteed to
hold a pointer.

Lastly, they are not portable solutions for SMP and uniprocessor systems,
like POSIX keys and TLS.

updates #2493.
2015-12-24 16:52:34 -06:00
Sebastian Huber
d0c3983814 Use linker set for system initialization
Make rtems_initialize_data_structures(),
rtems_initialize_before_drivers() and rtems_initialize_device_drivers()
static.  Rename rtems_initialize_start_multitasking() to
rtems_initialize_executive() and call the registered system
initialization handlers in this function.  Add system initialization API
available via #include <rtems/sysinit.h>.  Update the documentation
accordingly.

This is no functional change, only the method to call the existing
initialization routines changes.  Instead of direct function calls a
table of function pointers contained in the new RTEMS system
initialization linker set is used.  This table looks like this (the
actual addresses depend on the target).

nm *.exe | grep _Linker | sort
0201a2d0 D _Linker_set__Sysinit_begin
0201a2d0 D _Linker_set__Sysinit_bsp_work_area_initialize
0201a2d4 D _Linker_set__Sysinit_bsp_start
0201a2d8 D _Linker_set__Sysinit_rtems_initialize_data_structures
0201a2dc D _Linker_set__Sysinit_bsp_libc_init
0201a2e0 D _Linker_set__Sysinit_rtems_initialize_before_drivers
0201a2e4 D _Linker_set__Sysinit_bsp_predriver_hook
0201a2e8 D _Linker_set__Sysinit_rtems_initialize_device_drivers
0201a2ec D _Linker_set__Sysinit_bsp_postdriver_hook
0201a2f0 D _Linker_set__Sysinit_end

Add test sptests/spsysinit01.

Update #2408.
2015-12-11 08:17:16 +01:00
Sebastian Huber
8054b1c718 Remove <rtems/debug.h>
Close #2477.
2015-12-07 13:11:07 +01:00
Sebastian Huber
ac5f2442e3 Require __getreent()
This function is used by Newlib since 2013-07-09 (Git commit
9b51cd8c6b9cdd067d9648a7ab952884019c56a5).
2015-11-25 08:33:31 +01:00
Sebastian Huber
aa473025f7 sapi: Add rtems_chain_get_first_unprotected()
Close #2459.
2015-11-05 11:30:09 +01:00