If someone manages to open a file before rtems_libio_post_driver is run,
open() may allocate a file number other than 0 for stdin. This leads to
a silent failure of the logic in rtems_libio_post_driver, and confusing
behavior because your BSP behaves as if it doesn't have a console.
Instead of failing silently, raise an internal error if open() succeeds
but gives us an unexpected file number for stdin.
Previously this RTC was using the file system-based i2c interface in
/dev. Since the RTC is initialized pretty early on during system init,
we call open() before stdin/stdout/stderr have been opened. RTEMS
assumes that stdin == 0, stdout == 1, etc., and fails when that isn't
the case. In particular, when stdin != 0, RTEMS assumes that it wasn't
configured with a console driver and skips opening stdout/stderr,
leading to confusing issues with the standard I/O streams.
The RTEMS_FALL_THROUGH macro was needed to provide a portable
way to annotate that a case in a switch statement intentionally
does not have a break statement. It is known as "falling through"
and a common bug.
Adding this macro enabled addressing -Wimplicit-fallthrough warnings.
On the genmcf548x BSP variants, the "request" local variable was
flagged as having a pointer taken and passed to subroutines. GCC
is unable to detect that the "request" variable is removed from
the chain in an ISR. Disabled -Wdangling-pointer for the single
test function CallWithinISR().
The ACPI source has multiple tables where a Name field is defined.
The name field is a character array with a length of 4. All of the
string initializers are four characters plus a NUL. The code is
careful to use strn*() functions and intentionally avoids assuming
there is space for the NUL. With lots of entries in the various
arrays, this was clearly a design decision to save space.
This was caught by GCC's -Wunterminated-string-initialization
warning. The solution used is to use the "nonstring" attribute
recommended by the GCC manual.
Closes#5329
The file tm27-default.h is considered an internal flag. Accidentally
copying and pasting this include in while fixing attribution headers
was a mistake. Removing the line.
The code in flashio.c had a special case for handling unaligned buffers
during writes. That code did roughly the following:
If the size or start address of the buffer is not aligned to a word:
* align the size up to the next word
* create a temp buffer on heap or stack with the new size
* copy the data from write buffer to this temp buffer
* write the temp buffer with the _new_ size to the flash
* tell the code above, that the original size has been written
That means, that in certain cases, one to three random bytes have been
written to the flash. That is definitively not correct.
The special cases that trigger the behaviour seem to happen quite often
when using the RTEMS functions to unpack a .tar.gz with files in the
range of a few megabytes stored on the JFFS2 file system to the same
file system.
The RTEMS interface for flash drivers doesn't define any alignment
requirements. Therefore that code is not necessary and can just be
removed to solve these issues.
These files were written by Joel Sherrill with some being based
on descriptions from user reports.
testsuites/sptests/sp34/changepri.c
testsuites/sptests/sp52/sp52impl.h
testsuites/sptests/sp67/init.c
Updates #3053.
The definition of NEEDS_THUMB_SWITCH was not portable and flagged by
the GCC -Wexpansion-to-defined. It is not portable to expand a macro
which uses futher cpp directives.
Closes#5328.
This change adds attribution as appropriate for Ray Xu, Jay Monkman,
and Philippe Simons. The attribution is based on git archeology and
current permissions to relicense. Some of the code given attribution
was from the gp32 BSP which required looking at the 4.8 branch to
get attribution.
- Work by Ray Xu and Jay Monkman is now 2-BSD
- Work by Philipe Simon is GPL 2.0 w/RTEMS exception
Updates #3053.
Added pthread_cond_clockwait(), pthread_mutex_clocklock()
pthread_rwlock_clockrdlock() and pthread_rwlock_clockwrlock()
that are new in POSIX Issue 8. Also added tests.
The implementation used the timed versions of these functions
as a reference.
Updates
rtems/programs/gsoc#69
This change reflects adding attribution based on the initial
submitter per git history. Most files were from Eric Norum
and he has given permission to relicense to 2-BSD. One file
was from Mike Bertosh whom we are still trying to contact.
That file is assumed to have been submitted under the GPL
w/exception as was the norm when it was submitted.
Many tm27.h implementations were one line with no attribution.
Some were simply including a default non-functional implementation.
Others were including a header file giving an implementation based
on a standard counter/timer. This patch gives attribution based on
the split out being done by Sebastian Huber in 2017.
Added new functions to thread queue infrastructure to support
clock-specific timeout operations, making it easier to integrate
POSIX Issue 8 clock functions.
Updates
rtems/programs/gsoc#69
rtems#24
These files did not have copyright, license, or SPDX. Per git log
these files were authored by Petr Benes who has other code in the
RTEMS source base and given permission to use BSD-2.
Updates #3053
Update the rtems_region_get_information() and
rtems_region_get_information() documentation with various more or less
minor wording fixes:
* "obtain a diagnostic information." ->
"obtain diagnostic information."
* "This method forms am O(n)" ->
"This directive performs an O(n)"
* "scan of the free in the region" ->
"scan of the free blocks in the region"
* "many used blocks and a much smaller number of used blocks" ->
"many used blocks and a much smaller number of free blocks"
These changes were generated from rtems-central.
Newer C versions require that the storage-class specifier like
static or _Thread_Local be the first thing in a declaration. Adding
this warning to the default set to let us eliminate violations.