Commit Graph

256 Commits

Author SHA1 Message Date
Joel Sherrill
e4cc56a792 cpukit/libmisc/monitor/: Manually change to BSD-2 license
This code did not have any copyrights or licenses and a bit
of archeology was needed to determine authorship.

This code was in the initial import into the RTEMS CVS repository when
it was established in May 1995. There was very little, if any, code not
written by OAR Corporation in that initial import.  After discussion
with Chris Johns, it was determined that this code was from OAR
Corporation and that he had added a few features later. Both
Chris Johns and OAR Corporation have given permission to relicense.

Updates #3053.
2022-03-24 12:45:03 -05:00
Sebastian Huber
9399e12c21 rtems: Fix rtems_partition_return_buffer()
The rtems_partition_return_buffer() wrongly accepted which were exactly
at the buffer area end.  Use the buffer area limit address for the range
checking.

Close #4490.
2021-08-12 10:09:04 +02:00
Harrison Edward Gerber
6a56fd9340 cpukit/libmisc/monitor: Fix src/dest overlap of strcpy in mon-editor.c
See also CID 1399727

Closes #4444
2021-05-28 16:00:32 -06:00
Vijay Kumar Banerjee
2a13ad389a cpukit: Remove libnetworking
Update #3850
2021-04-07 16:15:38 -06:00
Frank Kühndel
f3df25b65c cpukit/libmisc/monitor: Fix an illegal string copy
This is actually an illegal use of strcpy() because one is not allowed to
use this function with overlapping source and destination buffers; whereas
memmove() is explicitly designed to handle such cases.

The compiler warning was:

../../../cpukit/libmisc/monitor/mon-editor.c:342:15: warning:
'strcpy' accessing 1 byte at offsets [0, 75] and [0, 75] overlaps
1 byte at offset [0, 74] [-Wrestrict]
2020-10-12 08:46:48 +02:00
Sebastian Huber
24ea1cebeb rtems: Remove Message_queue_Control::attribute_set
Add Message_queue_Control::is_global if RTEMS_MULTIPROCESSING is defined.  This
reduces the Message_queue_Control size in standard RTEMS configurations.

Update #4007.
2020-09-28 06:19:52 +02:00
Sebastian Huber
ba46b9368e config: Add _SMP_Is_enabled
Move the is SMP enabled configuration constant out of the
configuration table.

Since this was the last configuration constant in
rtems_configuration_table, remove this type.

Update #3875.
2020-02-25 07:15:19 +01:00
Sebastian Huber
9520ec3a2a config: Simplify initialization task config
With the removal of the CONFIGURE_HAS_OWN_INIT_TASK_TABLE configuration
option at most one Classic API user initialization task can be
configured.

Provide an RTEMS API configuration table for backward compatibility.

Update #3873.
2020-02-25 07:15:18 +01:00
Sebastian Huber
c621c11b4f monitor: Use proper API for all config constants 2020-02-17 08:03:56 +01:00
Sebastian Huber
24f8915a07 config: Add _MPCI_Configuration
Replace the user MPCI configuration table with a system provided
_MPCI_Configuration.

Update #3735.
2019-12-13 08:35:17 +01:00
Sebastian Huber
01f8c12ee5 rtems: Optimize semaphore control block
Move variant, discipline, and global information to flags stored in a
node pointer of active semaphores.

Update #3833.
2019-12-11 09:05:07 +01:00
Sebastian Huber
5803f3738f score: Add and use _Thread_Get_unmapped_priority().
Add and use _Thread_Get_unmapped_real_priority().
2019-06-28 08:30:11 +02: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
59e7209fb3 score: Remove support for RTEMS_USE_16_BIT_OBJECT
The RTEMS_USE_16_BIT_OBJECT define is not set by an RTEMS port.  Remove
support for 16-bit object identifiers.  If someone really wants to use
RTEMS on a 16-bit target, then it is better to use self-contained
objects instead of playing around with object identifier optimizations.

Update #3603.
2018-11-21 08:06:27 +01:00
Sebastian Huber
5fc855d960 rtems: Move internal structures to extensiondata.h
Update #3598.
2018-11-12 13:25:40 +01:00
Sebastian Huber
b7af3e449a rtems: Move internal structures to tasksdata.h
Update #3598.
2018-11-12 13:25:40 +01:00
Sebastian Huber
e8e914b3b1 rtems: Move internal structures to regiondata.h
Update #3598.
2018-11-12 13:25:40 +01:00
Sebastian Huber
f00c5c6e34 rtems: Move internal structures to partdata.h
Update #3598.
2018-11-12 13:25:40 +01:00
Sebastian Huber
ef30eb1c4d monitor: Remove dead code
Update #3587.
Update #3589.
2018-11-08 08:09:25 +01:00
Sebastian Huber
54f3588831 posix: Provide threads by default
Update #2514.
2018-10-29 10:52:45 +01:00
Sebastian Huber
f004b2b8dc Use rtems_task_exit()
Update #3530.
Update #3533.
2018-10-02 10:22:15 +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
fc438dae30 monitor: Fix thread priority values 2018-01-22 07:21:20 +01:00
Sebastian Huber
47f236c67a monitor: Include <rtems/monitor.h>
Prepare for header file move to common include directory.

Update #3254.
2017-12-13 09:04:27 +01:00
Sebastian Huber
ae359a9df4 shell: Display scheduler instead of current CPU
Display the scheduler name instead of the current CPU in the "task"
shell command.  The current CPU could be misleading in case locking
protocols are involved.  The "cpuuse" command can be used to obtain the
current CPU.
2017-06-16 06:13:50 +02:00
Chris Johns
4fd25c4340 libmisc/monitor: Correctly print unlimited configuration table entries.
Closes #2997.
2017-04-19 12:36:32 +10:00
Sebastian Huber
36338fb312 monitor: Do not zero sema id and name 2017-03-07 13:42:21 +01:00
Sebastian Huber
468e9a4d99 monitor: Print short and long task names
Print wait object identifier only if it exists.

Update #2858.
2017-02-14 11:12:00 +01:00
Sebastian Huber
f7ba2945d3 monitor: Add support for BSD wakeup messages 2017-01-31 09:38:08 +01:00
Sebastian Huber
e366f774a7 score: Add _Thread_queue_Object_name
Add the special thread queue name _Thread_queue_Object_name to mark
thread queues embedded in an object with identifier.  Using the special
thread state STATES_THREAD_QUEUE_WITH_IDENTIFIER is not reliable for
this purpose since the thread wait information and thread state are
protected by different SMP locks in separate critical sections.  Remove
STATES_THREAD_QUEUE_WITH_IDENTIFIER.

Add and use _Thread_queue_Object_initialize().

Update #2858.
2017-01-31 09:38:07 +01:00
Sebastian Huber
7ced9d9bb2 score: Add and use _Thread_Get_name()
Update #2858.
2017-01-13 08:10:24 +01:00
Sebastian Huber
a3730b38cc Add and use rtems_assoc_thread_states_to_string() 2017-01-12 07:44:37 +01:00
Sebastian Huber
d063e7b3d8 score: Replace STATES_DELAYING
Replace STATES_DELAYING with STATES_WAITING_FOR_TIME.

There is no need for separate timeout thread states.  The
Thread_Control::Timer::header and Watchdog_Control::cpu members can be
used to figure out the kind of timeout.
2017-01-12 07:44:36 +01:00
Sebastian Huber
9a448aabe6 score: Add STATES_THREAD_QUEUE_WITH_IDENTIFIER
Add thread state bit to identify thread queues that are embedded in an
object with identifier.
2017-01-11 08:16:27 +01:00
Sebastian Huber
c6000d2b54 score: Delete STATES_WAITING_FOR_BUFFER 2017-01-11 08:16:27 +01:00
Sebastian Huber
5b6c290ed0 score: Initialize thread queue context early
Initialize thread queue context early preferably outside the critical
section.

Remove implicit _Thread_queue_Context_initialize() from
_Thread_Wait_acquire().
2016-12-02 12:41:03 +01:00
Sebastian Huber
3a27248054 score: First part of new MrsP implementation
Update #2556.
2016-11-02 10:05:43 +01:00
Sebastian Huber
9b0445685b monitor: Support priority inheritance queues 2016-09-30 07:54:29 +02:00
Sebastian Huber
b20b736382 score: Introduce _Thread_Get_priority()
Avoid direct access to thread internal data fields.
2016-09-08 09:55:28 +02:00
Sebastian Huber
1fcac5adc5 score: Turn thread lock into thread wait lock
The _Thread_Lock_acquire() function had a potentially infinite run-time
due to the lack of fairness at atomic operations level.

Update #2412.
Update #2556.
Update #2765.
2016-07-27 10:55:30 +02:00
Sebastian Huber
77ff5599e0 score: Introduce map priority scheduler operation
Introduce map/unmap priority scheduler operations to map thread priority
values from/to the user domain to/from the scheduler domain.  Use the
map priority operation to validate the thread priority.  The EDF
schedulers use this new operation to distinguish between normal
priorities and priorities obtain through a job release.

Update #2173.
Update #2556.
2016-06-22 14:36:40 +02:00
Sebastian Huber
73f2ddb915 rtems: Fix semaphore field name 2016-05-30 16:16:24 +02:00
Sebastian Huber
3692095f2c rtems: Move MrsP semaphore operations
Move MrsP semaphore operations to a less prominent location.  Fix field
name.
2016-05-30 16:16:23 +02:00
Sebastian Huber
0b713f8940 score: Rework CORE inherit priority mutex
Provide dedicated seize and surrender methods for inherit priority
mutexes.  This eliminates CORE_mutex_Attributes.
2016-05-30 16:16:23 +02:00
Sebastian Huber
5a598ac99b score: Add CORE mutex variants
Add CORE_recursive_mutex_Control and CORE_ceiling_mutex_Control to avoid
the run-time evaluation of attributes to figure out how a particular
mutex methods should behave.  Start with the no protocol variants.  This
eliminates the CORE_MUTEX_DISCIPLINES_FIFO and
CORE_MUTEX_DISCIPLINES_PRIORITY disciplines.
2016-05-30 16:16:23 +02:00
Sebastian Huber
862a0eeb11 score: Rework _Thread_Restart_other()
Rework _Thread_Restart_other() to use _Thread_Change_life_locked().
Cope with concurrent change requests by means of a pending request
counter.

Update #2555.
Update #2626.
2016-05-20 07:49:38 +02:00
Sebastian Huber
232147ddc1 score: Add _Thread_Join() and _Thread_Cancel()
Split _Thread_Close() into _Thread_Join() and _Thread_Cancel() to
prepare for a re-use in pthread_join() and pthread_cancel().

Update #2555.
Update #2626.
2016-05-20 07:49:37 +02:00
Sebastian Huber
e135271b93 score: Avoid Giant lock _Scheduler_Set_affinity()
Update #2555.
2016-05-12 13:24:41 +02:00
Sebastian Huber
36cd27c1e3 score: Simplify _Objects_Get_next()
Remove unused location parameter.
2016-04-21 07:29:40 +02:00
Sebastian Huber
c39da818c7 rtems: Delete Region_Control::page_size 2016-04-12 07:36:19 +02:00