Commit Graph

31116 Commits

Author SHA1 Message Date
Sebastian Huber
a8bf9a3f7a bsps: Add default getentropy() implementation
Update #3239.
Close #3249.
2017-11-22 09:40:22 +01:00
Martin Erik Werner
702e820830 Fix comments for object lookup error to RTEMS status map
Based on correlation with the enum for object lookup errors in
cpukit/score/include/rtems/score/objectimpl.h:

typedef enum {
 OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL,
 OBJECTS_INVALID_NAME,
 OBJECTS_INVALID_ADDRESS,
 OBJECTS_INVALID_ID,
 OBJECTS_INVALID_NODE
} Objects_Name_or_id_lookup_errors;

update the comments regarding the object lookup error to status map to
match.

Signed-off-by: Martin Erik Werner <martin.werner@aacmicrotec.com>
2017-11-21 12:40:16 -06:00
Daniel Hellstrom
4d7e4bb213 leon, gr1553rt: adding SMP protection
Add device spin-lock around internal data structures. Since the driver
provides a low-level C API accessing the descriptors the application
still needs to implement part of the SMP synchonization needed between
Interrupt handler and tasks.

Close #2355.
2017-11-21 10:28:02 +01:00
Sebastian Huber
c0d602ea69 posix: _POSIX_Threads_Get_sched_param_sporadic()
Remove api parameter to simplify the calling functions.

Update #2514.
2017-11-21 07:42:32 +01:00
Sebastian Huber
c597fb166e score: Optimize scheduler priority updates
Thread priority changes may append or prepend the thread to its priority
group on the scheduler ready queue.  Previously, a separate priority
value and a prepend-it flag in the scheduler node were used to propagate
a priority change to the scheduler.

Now, use an append-it bit in the priority control and reduce the plain
priority value to 63 bits.

This change leads to a significant code size reduction (about 25%) of
the SMP schedulers.  The negligible increase of the standard priority
scheduler is due to some additional shift operations
(SCHEDULER_PRIORITY_MAP() and SCHEDULER_PRIORITY_UNMAP()).

Before:

   text filename
    136 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleblock.o
    464 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimplechangepriority.o
     24 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimple.o
    108 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleschedule.o
    292 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleunblock.o
    264 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleyield.o

   text filename
    280 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityblock.o
    488 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerprioritychangepriority.o
    200 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriority.o
    164 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityschedule.o
    328 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityunblock.o
    200 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityyield.o

   text filename
  24112 arm-rtems5/c/imx7/cpukit/score/src/libscore_a-scheduleredfsmp.o

   text filename
  37204 sparc-rtems5/c/gr740/cpukit/score/src/libscore_a-scheduleredfsmp.o

   text filename
  42236 powerpc-rtems5/c/qoriq_e6500_32/cpukit/score/src/libscore_a-scheduleredfsmp.o

After:

   text filename
    136 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleblock.o
    272 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimplechangepriority.o
     24 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimple.o
    108 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleschedule.o
    292 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleunblock.o
    264 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleyield.o

   text filename
    280 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityblock.o
    488 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerprioritychangepriority.o
    208 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriority.o
    164 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityschedule.o
    332 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityunblock.o
    200 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityyield.o

   text filename
  18860 arm-rtems5/c/imx7/cpukit/score/src/libscore_a-scheduleredfsmp.o

   text filename
  28520 sparc-rtems5/c/gr740/cpukit/score/src/libscore_a-scheduleredfsmp.o

   text filename
  32664 powerpc-rtems5/c/qoriq_e6500_32/cpukit/score/src/libscore_a-scheduleredfsmp.o
2017-11-20 08:36:49 +01:00
Sebastian Huber
5018894ee1 bsps/powerpc: Fix PPC_EXC_CONFIG_USE_FIXED_HANDLER
For the SPE support we must store the upper half of r3 as well.

Update #3085.
2017-11-20 07:53:09 +01:00
Sebastian Huber
3d374d90f8 bsps: Use a state in default getentropy()
Use the boot time to initialize the state.  Use the state, the current
CPU counter and a very simple pseudo random number generator for
getentropy(). At least, this enables to pass the test "GETENTROPY 1" on
ERC32.

Update #3239.
2017-11-20 07:53:08 +01:00
Christian Mauderer
2e2a41ecd9 bsp/atsam: Add timing for RAM mt48lc16m16a2p-6a. 2017-11-17 14:14:18 +01:00
Christian Mauderer
a5d49ebd37 bsp/atsam: Improve SDRAM initialization.
According to the manual, MR has to be read back and a memory barrier has
to be added after MR is written during SDRAM initialization.
2017-11-17 14:14:18 +01:00
Christian Mauderer
d00a7d1c22 bsp/atsam: Move clock and SDRAM init to SRAM.
If necessary, the BSP can now have it's clock and SDRAM initialization
in the SRAM instead of the SDRAM. This allows to change the clock
frequency during the startup of an SDRAM application.
2017-11-17 14:13:40 +01:00
Christian Mauderer
3fbaaa8b74 bsp/atsam: Make clock application configurable. 2017-11-17 14:07:46 +01:00
Christian Mauderer
a9de9a7b95 bsp/atsam: Add getentropy().
Update #3239.
2017-11-17 07:26:57 +01:00
Christian Mauderer
1358d4c824 getentropy: Add test.
Update #3239.
2017-11-17 07:26:55 +01:00
Christian Mauderer
ca4895cb9c getentropy: Add cpu counter based implementation.
Update #3239.
2017-11-17 07:26:52 +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
Sebastian Huber
91a2d5e68b score: Adjust _Scheduler_EDF_SMP_Insert_ready()
Use only one parameter to compute the next generation.  Use index 0 for
LIFO ordering, and index 1 for FIFO ordering.
2017-11-17 06:55:10 +01:00
Sebastian Huber
727cf48289 sptests/spversion01: Simplify configuration
Update #3199.
2017-11-17 06:55:09 +01:00
Sebastian Huber
e24d64b77d psx05: Remove CONFIGURE_DISABLE_SMP_CONFIGURATION
Update #3020.
2017-11-16 15:26:24 +01:00
Sebastian Huber
ec771f2531 score: Fix priority ceiling updates
We must not clear the priority updates in _Thread_queue_Extract_locked()
since this function is used by the priority ceiling surrender operations
after the ceiling priority handover from the previous owner to the new
owner. This is especially important in SMP configurations.

Move the _Thread_queue_Context_clear_priority_updates() invocation to
the callers.

Close #3237.
2017-11-16 15:25:45 +01:00
Sebastian Huber
9c30c31e24 score: Fix _Thread_queue_Flush_critical()
The thread queue extract operations performed by the
_Thread_queue_Flush_critical() may result in a priority change of the
thread queue owner. Carry out the scheduler priority update operation.
This is especially important in SMP configurations.

Close #3236.
2017-11-16 14:38:07 +01:00
Sebastian Huber
79a998d862 rtems: rtems_semaphore_flush() with prio inherit
The _Semaphore_Get_operations() must return the proper operations for
priority inheritance semaphores.

Add a test case for rtems_semaphore_flush() with priority inheritance.

Close #3235.
2017-11-16 14:08:20 +01:00
Sebastian Huber
888da71502 score: Check thread resource count in timer server
The watchdog routines invoked by the timer server may use mutexes for
synchronization.  Ensure that the resource count of the timer server is
zero after each watchdog routine invocation.  This helps to detect
broken watchdog routines.
2017-11-16 07:45:17 +01:00
Sebastian Huber
d4b99ae3f8 libio: Add assert to rtems_libio_iop_drop()
This assert helps to detect an invalid reference counting in RTEMS_DEBUG
configurations.

Update #3132.
2017-11-15 13:22:40 +01:00
Sebastian Huber
62119d21da dl01, dl02, dl05: Fix unresolved printf symbol
The link time wrap of printf leads to unresolved symbols in the loadable
modules.  This resulted in infinite loops and test timeouts.  Use
rtems_printf() for output.

Update #3199.
2017-11-15 08:10:20 +01:00
Javier Jalle
2727bc7f80 leon, grspw_router: Clear only error bits defined by clear mask 2017-11-14 10:27:20 +01:00
Javier Jalle
56cf340f10 leon, grspw_router: Allow thread safe per-bit managing of pctrl regs 2017-11-14 10:27:20 +01:00
Javier Jalle
cc40f0bfca leon, grspw_router: Move register bit defs to header 2017-11-14 10:27:20 +01:00
Javier Jalle
59af2cc58e leon, grspw_router: Changed driver C API
SMP safe by spin-lock protection and semaphore. On spin-lock per SpW/AMBA
port to allow multiple parallel register operations per port. A common
semaphore for general SpW router configuration such as routing table.

Move to a C API instead of using the I/O Manager. The SpW router driver
does not perform any I/O only management of the router.

Update #2355.
2017-11-14 10:27:20 +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
Sebastian Huber
cb406870aa Change RTEMS_API from 5.0 to 5
This fixes the legacy Makefile based build system which expects
RTEMS_API to be identical to the tool chain version.

Update #3220.
2017-11-13 08:39:54 +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
e6df806a3f tests: Use ld to map (wrap) printf, puts and putchar to tester functions.
- Remove the macro defines and the need for tmacro.h by remapping the
  symbols using ld's wrap option.
- Remove FLUSH_OUTPUT, it was empty.
- Move rtems_test_exit to libmisc/testsupport as a function.

Update #3199.
2017-11-11 16:14:59 +11:00
Chris Johns
bcd0c06c9b tests: Use rtems_test_begin and rtems_test_end.
Add a tests enum and move all test banner test to the library in libmisc.

Update #3199.
2017-11-11 16:14:59 +11:00
Joel Sherrill
a6bf052a3b mvme162: Fix errors tripped by transition to using polled IO for tests 2017-11-10 14:40:46 -06:00
Joel Sherrill
cba8970e80 mcf5206elite/include/bsp.h: Rename delay() to rtems_bsp_delay() to avoid conflicts 2017-11-10 14:40:46 -06:00
Joel Sherrill
52841b5800 csb360/include/bsp.h: Rename delay() to rtems_bsp_delay() to avoid conflicts 2017-11-10 14:40:46 -06: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
Joel Sherrill
748a12629a pppd/Makefile.am: Add support/include 2017-11-09 15:06:19 -06:00
Sebastian Huber
b225aa1fc1 Reject incompatible tool chains
Update #3185.
2017-11-09 13:39:03 +01:00
Sebastian Huber
5f02a57478 score: Change _Timecounter_Time_uptime to int32_t
Move basic timecounter API shared with BSD network stack to
<machine/_timecounter.h>.

Update #3185.
2017-11-09 08:12:12 +01:00
Sebastian Huber
4a14751879 Upgrade to 5.0.0
Tool name will be "rtems5", e.g. arm-rtems5-gcc.

Next release will 5.1.0.  Branch version after release will be 5.1.1.
Next master will be 6.0.0.
2017-11-09 08:12:11 +01:00
Sebastian Huber
64ba1a9606 posix: Change created_with_explicit_scheduler
Remove POSIX_API_Control::created_with_explicit_scheduler.  Add
Thread_Control::was_created_with_inherited_scheduler.  This fixes also
pthread_getattr_np() for Classic tasks.

Update #2514.
2017-11-09 08:12:11 +01:00
Sebastian Huber
7147dc43b8 posix: Remove POSIX_API_Control::schedpolicy
Use the thread CPU budget algorithm to determine the scheduler policy.
This fixes also pthread_getschedparam() for Classic tasks.

Update #2514.
2017-11-09 08:12:11 +01:00
Sebastian Huber
8d0a0aa448 sptests/spconsole01: New test 2017-11-08 13:14:31 +01:00
Sebastian Huber
7078a00b13 bsp/t32mppc: Use fixed exception handlers 2017-11-08 13:14:30 +01:00
Sebastian Huber
fdf0e55cf9 bsp/imx: Add UART baud change
Update #3090.
2017-11-08 08:43:27 +01:00
Sebastian Huber
336fe3b9fd bsp/imx: Better utilize UART transmit FIFO
Update #3090.
2017-11-08 08:43:27 +01:00
Sebastian Huber
791469bd4f termios: Fix canonical mode
In canonical mode, input is made available line by line.  We must stop
the canonical buffer filling upon reception of an end-of-line character.

Close #3218.
2017-11-07 08:31:40 +01:00
Sebastian Huber
1055ff2020 tests: Use normal console for user input tests 2017-11-07 08:31:40 +01:00
Sebastian Huber
32ceb38513 tests: Use <tmacros.h>
Update #3170.
Update #3199.
2017-11-07 08:31:40 +01:00