Commit Graph

799 Commits

Author SHA1 Message Date
Sebastian Huber
f9219db2a9 rtems: Add rtems_scheduler_get_processor_maximum()
Add rtems_scheduler_get_processor_maximum() as a replacement for
rtems_get_processor_count(). The rtems_get_processor_count() is a bit
orphaned. Adopt it by the Scheduler Manager. The count is also
misleading, since the processor set may have gaps and the actual count
of online processors may be less than the value returned by
rtems_get_processor_count().

Update #3732.
2019-04-09 08:06:46 +02:00
Sebastian Huber
4c20da4be4 doxygen: Rename Score* groups in RTEMSScore*
Update #3706
2019-04-04 09:18:55 +02:00
Andreas Dachsberger
e78e7fe0de doxygen: Added Version to API->Classic
Update #3706.
2019-04-04 08:12:36 +02:00
Sebastian Huber
3fe215502a Remove superfluous <rtems/system.h> includes 2019-03-14 13:13:27 +01:00
Sebastian Huber
7c19e50bdd score: Fix per-CPU data allocation
Allocate the per-CPU data for secondary processors directly from the
heap areas before heap initialization and not via
_Workspace_Allocate_aligned().  This avoids dependency on the workspace
allocator.  It fixes also a problem on some platforms (e.g. QorIQ) where
at this early point in the system initialization the top of the RAM is
used by low-level startup code on secondary processors (boot pages).

Update #3507.
2018-12-18 08:50:08 +01:00
Sebastian Huber
21275b58a5 score: Static Objects_Information initialization
Statically allocate the objects information together with the initial
set of objects either via <rtems/confdefs.h>.  Provide default object
informations with zero objects via librtemscpu.a.  This greatly
simplifies the workspace size estimate.  RTEMS applications which do not
use the unlimited objects option are easier to debug since all objects
reside now in statically allocated objects of the right types.

Close #3621.
2018-12-14 07:03:29 +01:00
Sebastian Huber
0f5b2c0906 rtems: Use object information to get config max
Use functions instead of macros.  Add missing
rtems_configuration_get_maximum_*() functions.

Update #3621.
2018-12-14 06:57:55 +01:00
Sebastian Huber
9c9c6a93b1 score: Remove Objects_Information::is_string
Use Objects_Information::name_length to store this information.

Update #3621.
2018-12-07 14:22:01 +01:00
Sebastian Huber
b9ffb62467 Convert CPU counter ticks to/from sbintime_t
The sbintime_t is an efficient time format.  Add the ability to convert
CPU counter ticks to/from sbintime_t.
2018-12-03 09:45:37 +01:00
Sebastian Huber
54c0b577a8 build: Move sapi/Makefile.am 2018-10-09 13:26:47 +02:00
Sebastian Huber
242887bc56 Rename files to make them unique within cpukit
This allows to build librtemscpu.a in one rush in the future.
2018-10-04 08:02:28 +02:00
Sebastian Huber
65f868cac6 Add _CPU_Counter_frequency()
Add rtems_counter_frequency() API function.  Use it to initialize the
counter value converter via the new system initialization step
(RTEMS_SYSINIT_CPU_COUNTER).  This decouples the counter implementation
and the counter converter.  It avoids an unnecessary pull in of the
64-bit integer division from libgcc.

Update #3456.
2018-06-15 13:02:44 +02:00
Sebastian Huber
de9b7d712b Add RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE
An invalid heap usage such as a double free is usually a fatal error
since this indicates a use after free.  Replace the use of printk() in
free() with a fatal error.

Update #3437.
2018-06-05 08:49:56 +02:00
Sebastian Huber
c934365f23 Update rtems_fatal_source_text()
Add RTEMS_FATAL_SOURCE_PANIC to rtems_fatal_source_text().

Update #3244.
2018-06-05 08:22:49 +02:00
Sebastian Huber
2d0bc839ed build: Remove EXTRA_DIST
A "make dist" is not supported. So, it makes no sense to have pure "make
dist" related stuff in the Makefile.am.
2018-04-04 10:09:04 +02:00
Chris Johns
2afb22b7e1 Remove make preinstall
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.
2018-01-25 08:45:26 +01:00
Sebastian Huber
9526b0349c confdefs: Replace RTEMS 4.12 with 5.1
Update #3220.
2017-12-06 19:20:06 +01:00
Sebastian Huber
bc5b56ad41 libio: Use API mutex 2017-12-06 07:13:04 +01:00
Sebastian Huber
98b52e3517 drvmgr: Use API mutex 2017-12-06 07:13:04 +01:00
Sebastian Huber
6c2b8a4b35 score: Use self-contained API mutex
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.
2017-12-04 10:53:39 +01:00
Joel Sherrill
7b8c5b0def sapi/src/panic.c: Add include of <rtems/bspIo.h> 2017-11-29 13:03:40 -06:00
Sebastian Huber
15e19273b2 sapi: New implementation of rtems_panic()
The previous rtems_panic() implementation was quite heavy weight.  It
depended on _exit() which calls the global destructors.  It used
fprintf(stderr, ...) for output which depends on an initialized console
device and the complex fprintf().

Introduce a new fatal source RTEMS_FATAL_SOURCE_PANIC for rtems_panic()
and output via vprintk().

Update #3244.
2017-11-22 09:40:23 +01:00
Christian Mauderer
ddc339c51f cpukit: Add _arc4random_getentropy_fail.
Add a default implementation of _arc4random_getentropy_fail with an
internal error.

Update #3239.
2017-11-17 07:26:41 +01:00
Chris Johns
631f711598 build: Fix the dependence for the generating the key file.
Update #3217.
2017-11-14 07:03:50 +01:00
Martin Erik Werner
f5b3c0244c Fix bashism in vc-key.sh
Change "==" to "=", since "==" for comparison is not available in POSIX
sh.

Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
2017-11-13 08:13:16 +11:00
Chris Johns
6f3fb8a547 cpukit: Add a Version API.
Provide functions to get the version string, major, minor and revision
numbers and the version control identifer that is a unique tag for
the version control system.

Update #3199.
2017-11-10 13:34:06 +11:00
Sebastian Huber
ac28f1588d Add simple console driver
Update #3170.
Update #3199.
2017-11-06 07:25:51 +01:00
Sebastian Huber
0ddffb766c confdefs: CONFIGURE_MICROSECONDS_PER_TICK
Reject non-positive CONFIGURE_MICROSECONDS_PER_TICK values.
2017-10-25 07:26:41 +02:00
Sebastian Huber
cea5ff7001 score: Add _Watchdog_Nanoseconds_per_tick
Move it from the configuration to a separate variable.

Update #3117.
Update #3182.
2017-10-24 09:37:28 +02:00
Sebastian Huber
7ed377bc69 score: _Watchdog_Is_far_future_monotonic_timespec
Update #3117.
Update #3182.
2017-10-24 09:37:28 +02:00
Sebastian Huber
381ef5c833 confdefs: Warn about problematic ticks per second
A non-integer clock ticks per second value may lead to inaccurate time
format conversions.

Update #3117.
Update #3182.
2017-10-24 09:37:27 +02:00
Sebastian Huber
27cfe7c86b score: Add _Watchdog_Ticks_per_second
This value is frequently used.  Avoid the function call overhead and the
integer division at run-time.

Update #3117.
Update #3182.
2017-10-24 09:37:22 +02:00
Sebastian Huber
9c0cefbfa5 confdefs: Add warnings for obsolete options
Update #2674.
Close #3112.
Close #3113.
Close #3114.
Close #3115.
Close #3116.
2017-10-12 07:13:38 +02:00
Sebastian Huber
587afc3400 confdefs: Fix typo 2017-10-06 14:20:00 +02:00
Sebastian Huber
de59c065c5 posix: Implement self-contained POSIX mutex
POSIX mutexes are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3112.
2017-10-05 14:29:02 +02:00
Sebastian Huber
5222488573 posix: Implement self-contained POSIX condvar
POSIX condition variables are now available in all configurations and no
longer depend on --enable-posix.

Update #2514.
Update #3113.
2017-10-05 14:29:02 +02:00
Sebastian Huber
89fc9345de posix: Implement self-contained POSIX rwlocks
POSIX rwlocks are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3115.
2017-10-05 14:29:02 +02:00
Sebastian Huber
e67929c4c0 posix: Implement self-contained POSIX barriers
POSIX barriers are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3114.
2017-10-05 14:29:01 +02:00
Sebastian Huber
c090db7405 posix: Implement self-contained POSIX semaphores
For semaphore object pointer and object validation see
POSIX_SEMAPHORE_VALIDATE_OBJECT().

Destruction or close of a busy semaphore returns an error status.  The
object is not flushed.

POSIX semaphores are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3116.
2017-10-05 14:29:01 +02:00
Sebastian Huber
e0660391fa confdefs: Fix POSIX keys configuration
Remove the OBJECTS_UNLIMITED_OBJECTS flag for the memory size
configuration.

Update #3105.
2017-08-22 08:02:15 +02:00
Sebastian Huber
600d88dfd7 INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT
Add new fatal error INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT.

Update #3077.
2017-07-25 11:41:11 +02:00
Sebastian Huber
21389c0613 score: Make EDF the default SMP scheduler
The EDF SMP scheduler supports simple thread processor affinities
(see #3059) with a small run-time overhead. The current default SMP
scheduler lacks support for thread processor affinities at all. The EDF
SMP scheduler offers a good feature set for most applications. So, use
it by default. Run-time libraries like libgomp, MTAPI, work stealing
schedulers, language interpreters (e.g. Erlang virtual machine),
maintainence of per-processor data (e.g. Universal Memory Allocator
(UMA)), etc. use a one-to-one thread processor affinity for example.

Update #3063.
2017-07-10 07:49:40 +02:00
Sebastian Huber
34487537ce score: Add simple affinity support to EDF SMP
Update #3059.
2017-07-10 07:49:36 +02:00
Sebastian Huber
f3d9f2288e score: Add SMP EDF scheduler
Update #3056.
2017-06-29 11:28:32 +02:00
Sebastian Huber
6bc63df199 confdefs.h: Add SMP enabled field to configuration
Do not use the processor count to determine if SMP is enabled.  Instead
use a dedicated configuration option.  Enable SMP by default in SMP
configurations.

Add CONFIGURE_DISABLE_SMP_CONFIGURATION to all test which would fail
otherwise.

Update #3001.
2017-05-16 09:48:32 +02:00
Sebastian Huber
0b8084c298 confdefs.h: Fix compile error in non-SMP cfg
Bug introduced by f778b7f3f1.

Update #3001.
2017-05-16 09:48:32 +02:00
Sebastian Huber
f778b7f3f1 confdefs.h: Use SMP scheduler only if necessary
Update #3001.
2017-05-12 08:35:36 +02:00
Sebastian Huber
1309718114 confdefs.h: CONFIGURE_DISABLE_SMP_CONFIGURATION
Enable the SMP configuration by default in case SMP is enabled.  Add
configuration option CONFIGURE_DISABLE_SMP_CONFIGURATION to disable it
explicitly.

Add CONFIGURE_DISABLE_SMP_CONFIGURATION to all test which would fail
otherwise.

Update #3001.
2017-05-11 11:40:44 +02:00
Gedare Bloom
87de70a298 posix/mman: add mmap support for shm objects
Update #2859.
2017-05-05 10:34:08 -04:00
Sebastian Huber
c847451b56 sapi: Fix warnings 2017-02-15 13:22:56 +01:00