Commit Graph

1073 Commits

Author SHA1 Message Date
Chris Johns
acc32a8e5c cpukit: Fixes for GCC 12 warnings
Updates #6442
2022-06-15 13:01:03 +10:00
Ryan Long
27fd10d76b cpukit/libmisc: Add file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-05-04 09:12:01 -05:00
Sebastian Huber
23426257c6 shell: Add rtems_shell_run_main_loop()
In contrast to rtems_shell_main_loop(), this new function does not
perform all sorts of initialization based on environment settings.  For
example, due to the use of isatty() in rtems_shell_main_loop() it is
impossible to run an interactive shell through a socket connection.
2022-04-06 16:26:52 +02:00
Sebastian Huber
a800e4de12 shell: Move rtems_shell_init_environment() call
Move rtems_shell_init_environment() call to rtems_shell_set_shell_env()
since this function uses the POSIX key.
2022-04-06 16:26:52 +02:00
Sebastian Huber
3407a3b1bc shell: Add and use SHELL_MAGIC 2022-04-06 16:26:52 +02:00
Sebastian Huber
e765cfb450 shell: Simplify rtems_shell_dup_current_env()
Do not assign members already provided by the global environment.
2022-04-06 16:26:52 +02:00
Sebastian Huber
1a8ad7e68f shell: Refactor rtems_shell_main_loop()
Disentangle the shell main loop from setup and teardown code.  Move main
loop into shell_main_loop().
2022-04-06 16:26:52 +02:00
Sebastian Huber
9320c7ecaa shell: Move line editor output check
Move call to isatty() to caller of rtems_shell_line_editor().  This
avoids a dependency on isatty() in rtems_shell_line_editor().
2022-04-06 16:26:52 +02:00
Chris Johns
500e69639e libmisc/untar: Use a larger block size to read and write files
- A larger block size lets files systems work better. On JFFS
  a 512 byte compressed block means lots of small flash updates

Closes #4635
2022-04-06 08:02:30 +10:00
Joel Sherrill
5f8c41c389 Update email address of Fernando Ruiz Casas to <fruizcasas@gmail.com>
This was requested to be executed prior to relicensing to BSD-2.
2022-04-05 13:13:31 -05:00
Joel Sherrill
2a7f7767ff cpukit/libmisc/dumpbuf/dumpbuf.c: Manually change license to BSD-2
There was a typo in the license text and this file was missed by
the script.

Updates #3053
2022-04-02 14:17:59 -05:00
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
Joel Sherrill
fab1a86221 cpukit/libmisc/untar: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
ed4200e770 cpukit/libmisc/check: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
50ec42c353 cpukit/libmisc/serdbg: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
c02836c485 cpukit/libmisc/rtems-fdt: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
aa4c01027a cpukit/libmisc/redirector: Manually change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
903bba259f cpukit/libmisc/mouse: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
8227a27943 cpukit/libmisc/fsmount/fsmount.c: Manual header clean up 2022-03-22 11:34:23 -05:00
Joel Sherrill
ccf8287197 cpukit/libmisc/fsmount: Change license to BSD-2.
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
3674288ad2 cpukit/libmisc/dumpbuf: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
9723662214 cpukit/libmisc/dummy: Change license to BSD-2.
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
183209b5e7 cpukit/libmisc/devnull/devzero.c: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
f1470914fb cpukit/libmisc/cpuuse: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
4b7fbc7c44 cpukit/libmisc/capture: Manually change license to BSD-2
These files did not follow the standard format and needed to be
changed manually.

Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
1dc5ba2a45 cpukit/capture: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
152ab750ca cpukit/libmisc/bspcmdline: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Sebastian Huber
b837c83869 shell: Avoid potential stack corruption
The rtems_shell_init() passed the address of a stack variable
(exit_code) to rtems_shell_run().  If wait == false, then the stack
variable goes out of scope but may be accessed by the created shell
thread.

The rtems_shell_script() was affected by the same problem.

Close #4629.
2022-03-16 07:35:27 +01:00
Christian Mauderer
bb2e149e0b cpukit: Automated IMD header file clean up
Use the same form of IMD in all copyright lines

Update #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
d7955b245e bsps and cpukit: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Joel Sherrill
255fe433fd cpukit/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:49 +01:00
Joel Sherrill
d836922525 libmisc/serdbg: Manual header clean up
Updates #4625.
2022-03-10 08:43:49 +01:00
Kinsey Moore
b539af865e cpukit: Prevent error with disabled stack checker
When the stack checker is not enabled, the stack checker reporting
function can still be called. This prevents that call from performing a
null memory access in trying to find the high water mark if the stack
checker was never initialized.

This also introduces a test to ensure this call does not cause a crash.

Closes #4588
2022-01-27 13:07:30 -06:00
Ryan Long
98ab69323e libmisc/rtems-fdt: close() file 'bf'
close() file 'bf' to avoid leaking descriptor.

CID 1437645: Resource leak in rtems_fdt_load().

Closes #4297
2021-12-17 10:27:27 -06:00
Christian Mauderer
ffc57e3cf3 untar: Make behavior similar to GNU or BSD tar
RTEMS untar implementation had problems with overwriting or integrating
archives into existing directory structures. This patch adapts the
behavior to mimic that of a GNU tar or BSD tar and extends the tar01
test to check for the behavior. That is:

* If a directory structure exists, the files from the archive will be
  integrated. Existing files are overwritten.

* If a file exists and the archive contains a directory with the same
  name, the file is removed and a directory is created. In the above
  example: if l1/l2 is a file it will be overwritten with a new
  directory.

* If a directory exists and the archive contains a file with the same
  name, the directory will be replaced if it is empty. If it contains
  files, the result is an error.

* An archive also can contain only a file without the parent
  directories. If in that case one of the parent directories exists as a
  file extracting the archive results in an error. In the example: if
  l1/l2 is a file and the archive doesn't contain the directories but
  only the file l1/l2/x.txt that would be an error.

* In case of an error, it is possible that the archive has been
  partially extracted.

Closes #4568
2021-12-09 08:23:47 +01:00
Sebastian Huber
0d83bed2e5 rtems: Move scheduler directives to own header
Move all rtems_scheduler_* directives to the new header file
<rtems/rtems/scheduler.h>.  Add a Scheduler Manager API and
implementation group.
2021-12-02 14:09:51 +01:00
Sebastian Huber
0221da5f56 rtems: Fix rate monotonic statistics
The rate monotonic period statistics were affected by
rtems_cpu_usage_reset().  The logic to detect and work around a CPU
usage reset was broken.

The Thread_Contol::cpu_time_used is changed to contain the processor
time used throughout the entire lifetime of the thread.  The new member
Thread_Contol::cpu_time_used_at_last_reset is added to contain the
processor time used at the time of the last reset through
rtems_cpu_usage_reset().  This decouples the resets of the CPU usage and
the rate monotonic period statistics.

Update #4528.
2021-10-25 08:01:02 +02:00
Chris Johns
8f3973fe8d libmisc/shell: Check the shell command pointers when adding a command 2021-08-21 12:49:36 +10:00
Chris Johns
4dc81f65c7 libmisc/fdt: fix node initialise error with RTEMS_DEBUG 2021-08-21 12:46:32 +10: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
Ryan Long
4127a6c056 main_edit.c: get rid of malloc warning
A warning was present when building RTEMS that stated that the argument
for malloc() exceeded the maximum object size. To get rid of this, I
  changed many places where 'int' was being used to 'size_t'.
2021-06-09 11:52:24 -05: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
Ryan Long
2deba0240e main_help.c: Do not care what char is returned by getchar()
CID 1437650: Unchecked return value from library in rtems_shell_help().

Closes #4291
2021-05-28 12:15:50 -05:00
Ryan Long
f29b312ea4 main_cp.c: Ignore return value from stat()
CID 26051: Unchecked return value from library in main_cp().

Closes #4365
2021-05-28 12:15:50 -05:00
Ryan Long
a187b09228 gen_uuid.c: Ignore return values from fcntl()
CID 1049146: Unchecked return value from library in get_clock().
CID 1049147: Unchecked return value from library in get_random_fd().

Closes #4280
2021-05-28 12:15:50 -05:00
Stephen Clark
cd5fd85730 stackchk: Fixed 32bit pointers
Using 32bit types like uint32_t for pointers creates issues on 64 bit
architectures like AArch64. Replaced occurrences of these with uintptr_t,
which will work for both 32 and 64 bit architectures.
2021-05-05 09:45:56 -05:00
Stephen Clark
ca02143321 rtems-fdt: Fixed 32bit pointers
Using 32bit types like uint32_t for pointers creates issues on 64 bit
architectures like AArch64. Replaced occurrences of these with uintptr_t,
which will work for both 32 and 64 bit architectures.
2021-05-05 09:45:56 -05:00
Ryan Long
8cf30c41d9 main_rtrace.c: Add error return when malloc fails
CID 1399709: Dereference after null check in
rtems_trace_buffering_shell_save().

Closes #4329
2021-04-29 09:48:00 -05:00
Ryan Long
0b2366024d print-ls.c: Unused value (CID #1255346)
CID 1255346: Unused value in rtems_shell_ls_printacol().

Closes #4340
2021-04-08 17:58:19 -05:00
Ryan Long
fbc764403f main_cp.c: Unused value (CID #1255344)
CID 1255344: Unused value in copy().

Closes #4339
2021-04-08 17:58:19 -05:00