Commit Graph

34536 Commits

Author SHA1 Message Date
Sebastian Huber
6641cc87b8 score: Fix initialization of thread queue context
Set Thread_queue_Context::timeout_absolute in
_Thread_queue_Context_set_timeout_argument() to avoid using it uninitialized.

The bug was introduced by a89ecaa1a9.
2021-06-10 07:50:00 +02:00
Ryan Long
f83676d91f sysconf: Remove sysconf(515)
GCC originally needed this 20 years ago. No longer needed, so it
is being removed.

Closes #4391
2021-06-09 11:52:24 -05: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
Gedare Bloom
8299b79d66 aarch64: add qemu bsps for cortex-a72
The a72 BSPs are identical to the a53 BSPs just changing a53 to a72.
2021-06-09 10:32:08 -06:00
Joel Sherrill
7a723293ab futimens.c, utime.c: Remove unnecessary include of <sys/stat.h>. 2021-06-09 10:36:06 -05:00
Joel Sherrill
dbe355bfe7 fsnofs01/init.c: Check for ENOENT from utime().
The addition of the entire *utime*() family of functions resulted
in this call returning ENOENT not ENXIO. This is better aligned
with the POSIX definition of the methods.
2021-06-08 13:14:53 -05:00
Sebastian Huber
34b45b17c5 score: Remove unused _Per_CPU_Initialize() decl 2021-06-08 09:10:21 +02:00
Sebastian Huber
55ce66ca73 arm/fvp: Fix integer from pointer without a cast
Update #4202.
2021-06-07 09:41:07 +02:00
Sebastian Huber
2d1c494fa8 arm/fvp: Remove unused GICv2 BSP option
Update #4202.
2021-06-07 09:05:33 +02:00
Harrison Edward Gerber
9429115c8b cpukit/libdebugger: Fix for sockaddr_in not being initialized
See also CID 1468684

Closes #4445
2021-06-02 09:31:30 -06: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
ea41722c92 Change filesystem utime_h handler to utimens_h
Also updated licenses.

Closes #4400
Updates #3899
2021-05-28 14:27:40 -05:00
Ryan Long
6171a88d9c psx13: Added tests for utimensat() and futimens()
Improved tests for utime() and utimes() and update license.

Close #4399
2021-05-28 14:27:39 -05:00
Ryan Long
ea881bf7a1 libcsupport: Implement utimes() in terms of utimensat()
utimes() now calls utimensat() to update file access
and modification timestamps.

Updated license.

Closes #4398
2021-05-28 14:27:39 -05:00
Ryan Long
bb70412306 libcsupport: Implement utime() in terms of utimensat()
utime() now calls utimensat() to update file access
and modification timestamps.

Updated license.

Closes #4397
2021-05-28 14:27:39 -05:00
Ryan Long
335f705082 libcsupport: Added futimens() and utimensat()
Created futimens.c and utimensat.c to add support for the POSIX
methods futimens() and utimensat().

utime() and utimes() are considered obsolote by POSIX, but RTEMS
will continue to support them.

Closes #4396
2021-05-28 14:27:39 -05: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
Christian Mauderer
156896526f thread-API: Add rtems_*mutex_try_lock
This adds a rtems_mutex_try_lock and a rtems_recursive_mutex_try_lock.

Update #4440.
2021-05-28 08:22:04 +02:00
Christian Mauderer
023a270962 cpukit: Add description of release version numbers
The release version in the git sources doesn't change. Add a note why
that is the case.
2021-05-28 08:22:04 +02:00
Sebastian Huber
bf36f5de94 score: Add RTEMS_UNREACHABLE() to a group 2021-05-28 07:49:36 +02:00
Kinsey Moore
d0eaf3ec1c spec/aarch64: Add BSPs for real ZynqMP hardware
Add the BSPs for running on the ZU3EG Ultrascale+ Zynq MPSoC and alter
the option defaults necessary for them to run properly using the
standard BOOT.BIN configured for PetaLinux that comes in the Out-of-Box
package.
2021-05-27 14:09:00 -05:00
Kinsey Moore
5fe49a0853 bsps/aarch64: Add MMU driver to relax alignment
Currently, the AArch64 BSPs have a hard time running on real hardware
without building the toolchain and the bsps with -mstrict-align in
multiple places. Configuring the MMU on these chips allows for unaligned
memory accesses for non-device memory which avoids requiring strict
alignment in the toolchain and in the BSPs themselves.

In writing this driver, it was found that the synchronous exception
handling code needed to be rewritten since it relied on clearing SCTLR_EL1 to
avoid thread stack misalignments in RTEMS_DEBUG mode. This is now
avoided by exactly preserving thread mode stack and flags and the new
implementation is compatible with the draft information provided on the
mailing list covering the Exception Management API.
2021-05-27 14:09:00 -05:00
Kinsey Moore
ae5e1d9797 bsps/a53: Increase available RAM
The default available RAM on the A53 BSP is quite small at 8MB. This
bumps that to 128MB to avoid allocation failures in tmcontext01 caused
by large allocations on a cache size of 16MB reported by the system
registers in QEMU.
2021-05-27 14:09:00 -05:00
Kinsey Moore
8810e08371 bsps/aarch64: Advertise cache function support
Ensure that cache functions are flagged as usable by the generic cache
implementation code.
2021-05-27 14:09:00 -05:00
Kinsey Moore
12ec459f4a bsps/aarch64: Align MVAs consistently
This fixes a bug where addresses were not being aligned correctly.
Addresses used in cache functions are now aligned consistently using
RTEMS_ALIGN_DOWN.
2021-05-27 14:09:00 -05:00
Kinsey Moore
25ca2ec4cb bsps/aarch64: Break out system registers
Break out system register definitions and accessors so that they're
usable by other parts of RTEMS.
2021-05-27 14:09:00 -05:00
Sebastian Huber
2fdd00fcdc rtems: Document new rtems_task_delete() error
Update #4414.
2021-05-27 07:12:49 +02:00
Harrison Edward Gerber
e2011dca26 cpukit/libpci: fix potential buffer overflow in pci_cfg_print_code.c
See also CID 1399721

Closes #4442
2021-05-26 16:43:26 -06:00
Kinsey Moore
342fe19842 score/aarch64: Align context validation frame
Ensure the stack remains aligned by keeping the context frame at a
multiple of 16 bytes. This avoids stack alignment exceptions which occur
when the stack pointer is not 16 byte aligned.
2021-05-26 16:08:25 -05:00
Sebastian Huber
de694b753c score: Direct thread dispatch in a self restart
Commit 73ebf9a27e accidentally removed the
direct thread dispatch in a self thread restart.  In case of a self
restart (always in task context) the directive shall not return.  If
this is not possible due to a bad thread dispatch disable level, then a
fatal error shall occur.

Update #4412.
2021-05-26 13:40:24 +02:00
Sebastian Huber
ce6319ade4 score: Fix _Thread_Cancel()
The _Thread_Cancel() (in contrast to _Thread_Restart() which used a
similar code block) may have produced ready threads with an active timer
in case the thread to cancel had its thread life protection enabled. The
problem was this code block:

    Priority_Control priority;

    _Thread_Add_life_change_request( the_thread );

    if ( _Thread_Is_life_change_allowed( previous ) ) {
      _Thread_State_release( the_thread, &lock_context );

      _Thread_queue_Extract_with_proxy( the_thread );
      _Thread_Timer_remove( the_thread );
    } else {
      _Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
      _Thread_State_release( the_thread, &lock_context );
    }

    priority = _Thread_Get_priority( executing );
    _Thread_Raise_real_priority( the_thread, priority );
    _Thread_Remove_life_change_request( the_thread );

The life change request should only be added/removed if a life change is
allowed (see _Thread_Restart()).  Add _Thread_Try_life_change_request()
and use it in _Thread_Cancel() and _Thread_Restart().

Close #4435.
2021-05-26 13:40:24 +02:00
Sebastian Huber
29187be532 posix: Allow pthread_cancel() from within ISRs
Close #4413.
2021-05-26 13:40:24 +02:00
Sebastian Huber
3cef3198a5 score: Simplify calling _Thread_Exit()
Move common code into _Thread_Exit().  This enables a tail call
optimization in most cases.
2021-05-26 13:40:24 +02:00
Sebastian Huber
b81d1ffd23 rtems: Return RTEMS_CALLED_FROM_ISR
If rtems_task_delete() is called from within interrupt context, then
return RTEMS_CALLED_FROM_ISR.  This makes the behaviour predictable.

Update #4414.
2021-05-26 13:36:57 +02:00
Joel Sherrill
76d5722b4a sysinit: Do not open console when just referencing reentrancy structure.
This change eliminates a system initialization dependentcy which resulted
in an application without a file system or console referencing errno being
forced to include the code to open(/dev/console), close(), atexit(),
and the unmount infrastructure.

Closes #4439.
2021-05-25 08:33:04 -05:00
Joel Sherrill
402a206a1b powerpc/.../sbrk.c: Do not reference errno.
Closes #4r37.
2021-05-25 08:33:04 -05:00
Joel Sherrill
f9d590753a ppc-irq-legacy.c: Use rtems_malloc() instead of malloc().
Closes #4438.
2021-05-25 08:33:04 -05:00
Vijay Kumar Banerjee
71521ff21f telnetd.c: Remove RTEMS_NETWORKING check
Set the priority manually to make telnetd compatible with the
2021-05-20 17:55:33 -06:00
Vijay Kumar Banerjee
a5fd2935b7 testsuites: Remove telnetd01
telnetd01 test cannot be run without a network stack, so this test is being
moved to the rtems-net-legacy repository.
2021-05-20 17:52:37 -06:00
Sebastian Huber
a89ecaa1a9 score: Simplify thread queue timeout handling
Add Thread_queue_Context::timeout_absolute to specify an absolute or
relative timeout.  This avoid having to get the current time twice for
timeouts relative to the current time.  It moves also functionality to
common code.
2021-05-18 18:47:43 +02:00
Sebastian Huber
24c6293294 posix: Fix use of clock for relative times
Close #4426.
2021-05-18 18:47:18 +02:00
Sebastian Huber
d45f87cf35 score: Add _CPU_Context_switch_no_return()
The __builtin_unreachable() cannot be used with current GCC versions to
tell the compiler that a function does not return to the caller, see:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99151

Add a no return variant of _CPU_Context_switch() to avoid generation of
dead code in _Thread_Start_multitasking() if RTEMS was built with SMP
support enabled.
2021-05-18 08:02:50 +02:00
Sebastian Huber
80b3c938ce score: Move _Thread_queue_Queue_get_name_and_id()
Move this diagnostic function to a separate file since it does not
provide a core function of the system.

Change license to BSD-2-Clause according to file history and
re-licensing agreement.

Update #3053.
2021-05-17 17:30:39 +02:00
Sebastian Huber
9918735448 posix: Use RTEMS_POSIX_API in clock_nanosleep()
It is only possible to get interrupted by a POSIX signal if
RTEMS_POSIX_API is defined.
2021-05-17 17:29:36 +02:00
Sebastian Huber
815a94326c posix: Move clock_nanosleep()
Move clock_nanosleep() to a separate file to avoid a dependency on errno
which pulls in the Newlib reentrancy support.  This is an issue since
most parts which are pulled in cannot be garbage collected by the linker
due to the system initialization linker set.
2021-05-17 17:29:36 +02:00
Christian Mauderer
15e26f4d7f bsps/imxrt: Enable DMA clock
The EDMA is intialized so make sure the the clock is initialized too.

Update #4180
2021-05-17 09:06:41 +02:00
Christian Mauderer
691fec407a bsps/imxrt: Fix OCRAM, ITCM and DTCM sizes
The sizes are configurable via fuses or per software via some registers.
At the moment the registers are not changed. Changing the registers
destroys data stored in the RAM areas (like application code or data).
So either the fuses or some bootloader should be used to set them before
the application starts.

This also adds an OCRAM only linker command file.

Update #4180
2021-05-17 09:06:41 +02:00
Christian Mauderer
988cc1a795 bsps/imxrt: Add addresses and interrupts to dts
Add addresses and interrupts for most internal peripherals to the dts.
The additional aliases make it possible for an application to easily
access these informations.

Update #4180
2021-05-17 09:06:41 +02:00