Commit Graph

429 Commits

Author SHA1 Message Date
Sebastian Huber
cfcc2cbf7a Add RTEMS Test Framework
Update #3199.
2019-03-27 07:15:55 +01:00
Sebastian Huber
5526527e51 score: Rename ScoreCPU Doxygen group
Update #3706.
2019-03-26 11:27:53 +01:00
Sebastian Huber
40d15f5f2a score: Add implementation top-level group
Update #3706.
2019-03-26 11:27:53 +01:00
Sebastian Huber
311270ca92 score: Update Objects_Information documentation 2019-03-22 10:19:23 +01:00
Chris Johns
dad6fd4333 libdl: Add an archive command
- The archive command lists archives, symbols and any duplicate
  symbols.
- Change the RTL shell commands to the rtems_printer to allow
  the output to be captured.
2019-03-22 14:16:52 +11:00
Sebastian Huber
3fe215502a Remove superfluous <rtems/system.h> includes 2019-03-14 13:13:27 +01:00
Sebastian Huber
20d472d3d7 Add rtems_board_support_package() 2019-03-14 13:13:27 +01:00
Sebastian Huber
01a5ced5e6 record: Add more system events
Update #3665.
2019-03-12 13:59:15 +01:00
Sebastian Huber
ebb8c28ee9 record: Add system call entry/exit events
This corresponds to the Linux syscall_entry_* and syscall_exit_* events.

Update #3665.
2019-03-12 13:59:11 +01:00
Sebastian Huber
d91951fbc0 record: Rename internal per-CPU events
Update #3665.
2019-03-12 13:44:24 +01:00
Sebastian Huber
feea03b625 Remove explicit file names from @file
This makes the @file documentation independent of the actual file name.

Update #3707.
2019-02-28 11:47:33 +01:00
Chris Johns
62b01ab2d2 libdl/archive: Fix the config file string index while removing tailing white space.
Coverity issue 1442540

Updates #3686
2019-02-20 09:08:38 +11:00
Chris Johns
22afb03411 libdl/alloc: Add a locking interface to the allocator.
- Allow an allocator to lock the allocations. This is needed to
  lock the heap allocator so the text and trampoline table are
  as close together as possible to allow for the largest possible
  object file size.

- Update the default heap allocator to lock the heap allocator.

- Update ELF loading to lock the allocator.

Updates #3685
2019-02-20 09:08:14 +11:00
Sebastian Huber
e4ad14cc78 score: Avoid some deadlocks in _Once()
Recursive usage of the same pthread_once_t results now in a deadlock.
Previously, an error of EINVAL was returned.  This usage scenario is
invalid according to the POSIX pthread_once() specification.

Close #3334.
2019-02-18 07:25:58 +01:00
Chris Johns
e309f7769f libdl: Allocator does not unlock and lock memory on loading.
Close #3692
2019-02-15 09:55:16 +11:00
Sebastian Huber
e214ff4b63 posix: Remove unused _POSIX_Get_object_body() 2019-02-12 13:20:20 +01:00
Chris Johns
6c9f0176a9 libdl: Add powerpc large memory and small data support.
- Add support for architecure sections that can be handled by the
  architecture back end.

- Add trampoline/fixup support for PowerPC. This means the PowerPC
  now supports large memory loading of applications.

- Add a bit allocator to manage small block based regions of memory.

- Add small data (sdata/sbss) support for the PowerPC. The support
  makes the linker allocated small data region of memory a global
  resource available to libdl loaded object files.

Updates #3687
Updates #3685
2019-02-09 10:06:34 +11:00
Chris Johns
194eb403c3 libdl: Add support for large memory programs
- Add trampolines to support relocs that are out of range on
  support architectures.

- Support not loading separate text/data sections in an object
  file if the symbol provided in the section is a duplicate.
  A base image may have pulled in part of an object and another
  part needs to be dynamically loaded.

- Refactor the unresolved handling to scale to hundreds of
  unresolved symbols when loading large number of files.

Updates #3685
2019-02-09 10:06:34 +11:00
Chris Johns
d8c70ba65b libdl: Add support for trampolines
- Trampolines or fixups for veneers provide long jump support
  for instruciton sets that implement short relative address
  branches. The linker provides trampolines when creating a
  static image. This patch adds trampoline support to libdl
  and the ARM architecture.

- The dl09 test requires enough memory so modules are outside
  the relative branch instruction ranges for the architecture.

Updates #3685
2019-02-09 10:06:34 +11:00
Chris Johns
4408603e27 libdl: Fix the support for constructors and desctructors.
- Fix the handling of pending objects.
- Add a constructor flags in objects to track then being called.

Closes #2921
2019-02-09 10:06:34 +11:00
Chris Johns
89c59be38d libdl: Add symbol searching and loading from archives.
- Load archive symbol tables to support searching of archives
  for symbols.
- Search archive symbols and load the object file that contains
  the symbol.
- Search the global and archives until all remaining unresolved symbols
  are not found. Group the loaded object files in the pending queue.
- Run the object file and loaded dependents as a group before adding to the
  main object list.
- Remove orphaned object files after references are removed.

Updates #3686
2019-02-09 10:06:34 +11:00
Sebastian Huber
26333f2ad0 score: Fix _User_extensions_Thread_switch() (SMP)
We have to read the first node again once we obtained the lock since it
may have aready changed.
2019-02-08 10:17:26 +01:00
Sebastian Huber
03cdd5eab8 record: Add enum value for each event
Update #3665.
2019-01-30 09:46:35 +01:00
Sebastian Huber
dca618404e Add low level event recording support
Add low level event recording infrastructure for system and user
defined events.  The infrastructure is able to record high frequency
events such as

 * SMP lock acquire/release,
 * interrupt entry/exit,
 * thread switches,
 * UMA zone allocate/free, and
 * Ethernet packet input/output, etc.

It allows post-mortem analysis in fatal error handlers, e.g. the last
events are in the record buffer, the newest event overwrites the oldest
event.  It is possible to detect record buffer overflows for consumers
that expect a continuous stream of events, e.g. to display the system
state in real-time.

The implementation supports high-end SMP machines (more than 1GHz
processor frequency, more than four processors).

Add a new API instead. The implementation uses per-processor data
structures and no atomic read-modify-write operations.  It is uses
per-processor ring buffers to record the events.

The CPU counter is used to get the time of events. It is combined with
periodic uptime events to synchronize it with CLOCK_REALTIME.

The existing capture engine tries to solve this problem also, but its
performance is not good enough for high-end production systems.  The
main issues are the variable-size buffers and the use of SMP locks for
synchronization.  To fix this, the API would change significantly.

Update #3665.
2019-01-29 13:51:33 +01:00
Sebastian Huber
926ed2b020 score: Remove unused _ISR_lock_Flash() 2019-01-18 13:33:18 +01:00
Sebastian Huber
41310c026c score: Improve debug support for ISR locks
Ensure that interrupts are disabled while acquiring an ISR lock.
2019-01-18 13:33:18 +01:00
Sebastian Huber
93e3b34161 score: Simplify _Addresses_Is_aligned()
The CPU_ALIGNMENT must not be zero, this is also checked via a static
assertion.  Fix formatting.
2019-01-18 11:49:09 +01:00
Sebastian Huber
7bde91bd5f Fix format warnings due to ino_t changes 2019-01-10 09:06:56 +01:00
Sebastian Huber
956d76ccaf score: Remove superfluous include from chainimpl.h 2019-01-07 09:36:47 +01:00
Sebastian Huber
a7e89962df drvmgr: Improve LP64 compatibility 2018-12-27 09:00:59 +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
e7b0a72566 config: Remove CONFIGURE_CONFDEFS_DEBUG
This configuration option was undocumented and not really helpful.  To
debug issues in <rtems/confdefs.h> it is better to save the
preprocessesd file (GCC "-save-temps" option) and use the GCC "-Wp,-dD"
pre-processor option.
2018-12-17 09:53:39 +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
8b0e752fee score: Remove Objects_Information::auto_extend
Use Objects_Information::objects_per_block to provide this information.
Add and use _Objects_Is_auto_extend().

Update #3621.
2018-12-14 06:57:55 +01:00
Sebastian Huber
f70079ca20 score: Remove Objects_Information::the_api
Remove Objects_Information::the_class.  This information is already
contained in Objects_Information::maximum_id.

Update #3621.
2018-12-07 14:22:02 +01:00
Sebastian Huber
1c2d178397 score: Remove Objects_Information::maximum
This information is already present in Objects_Information::maximum_id.
Add and use _Objects_Get_maximum_index().

Update #3621.
2018-12-07 14:22:02 +01:00
Sebastian Huber
3899bc1a4b score: Optimize object lookup
Use the maximum ID for the ID to object translation.  Using the maximum
ID gets rid of an additional load from the object information in
_Objects_Get().  In addition, object lookups fail for every ID in case
the object information is cleared to zero.  This makes it a bit more
robust during system startup (see new tests in spconfig02).

The local table no longer needs a NULL pointer entry at array index
zero.  Adjust all the object iteration loops accordingly.

Remove Objects_Information::minimum_id since it contains only redundant
information.  Add _Objects_Get_minimum_id() to get the minimum ID.

Update #3621.
2018-12-07 14:22:01 +01:00
Sebastian Huber
359a3a36ca score: Rename Objects_Information::allocation_size
Rename Objects_Information::allocation_size in
Objects_Information::objects_per_block.  Adjust integer types in
_Objects_Shrink_information() and _Objects_Free().

Update #3621.
2018-12-07 14:22:01 +01:00
Sebastian Huber
0da9d805cd score: Rename Objects_Information::size
Rename Objects_Information::size to Objects_Information::object_size.
Change its type from size_t to uint16_t and move it to reduce the size
of Objects_Information.

Update #3621.
2018-12-07 14:22:01 +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
7ee64376ef rtems: Add rtems_scheduler_get_maximum_priority()
Update #3636.
2018-12-07 14:22:01 +01:00
Sebastian Huber
ef23838543 score: Avoid sbintime_t in API headers
The sbintime_t is a non-POSIX type and not visible if strict standard
options are selected.

Move implementation details from <rtems/score/timestamp.h> to
<rtems/score/timestampimpl.h>.

Update #3598.
2018-12-07 14:22:01 +01:00
Sebastian Huber
e50b4bd341 score: Use __typeof__ for strict ISO C compat
Enable the use of RTEMS_DEVOLATILE() and RTEMS_DECONST() in strict ISO C
environments.
2018-12-06 13:41:59 +01:00
Sebastian Huber
4e46ba8460 rtems: Fix rtems_task_restart() argument type
Close #3637.
2018-12-06 10:50:40 +01:00
Marçal Comajoan Cara
0446f68056 Spelling and grammar fixes in source code comments (GCI 2018) 2018-12-04 15:12:53 -06: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
0a75a4aa65 Remove rtems_cache_*_processor_set() functions
The following rtems_cache_*_processor_set() cache manager API functions
are exotic, complex, very hard to use correctly, not used in the RTEMS
code base, and apparently unused by applications.

Close #3622.
2018-11-26 14:09:43 +01:00
Sebastian Huber
5fc727fe77 score: <rtems/score/smplockstats.h>
Remove <rtems/score/chainimpl.h> include from
<rtems/score/smplockstats.h>.

Close #3598.
2018-11-26 08:29:33 +01:00
Sebastian Huber
eaa5ea84ea score: Introduce <rtems/score/heapinfo.h>
Move Heap_Information_block to separate header file to hide heap
implementation details from <rtems.h>.

Update #3598.
2018-11-26 07:51:57 +01:00