Older versions of newlib already provide the magic endian numbers
via `machine/endian.h`, which may be indirectly included. This changes
the header to only provide the macros if the are not provided otherwise.
For sanity, it checks if the values are indeed the expected magic
numbers, even if provided from other sources.
The constants BIG_ENDIAN etc. were not consistently defined. This
bug was not caught by the unit tests, as the preprocessor would
treat undefined macros as being `0` in numeric comparisons, hence
the following test did select the correct implementation:
```C
#if BYTE_ORDER == LITTLE_ENDIAN
/* correct implementation for all currently supported boards */
#endif
```
This adds now an explicit test to the unit tests to ensure that the
magic numbers are consistently the correct values. Hence, this bug
should no longer be able to sneak in.
Co-authored-by: Teufelchen <9516484+Teufelchen1@users.noreply.github.com>
The script to fix the vendor header files has been renamed to
`fix_headers.sh` and now does two things:
1. Strip bogus type qualifiers in front of padding (as before)
2. Strip bogus `LITTLE_ENDIAN` defines.
Back when specific control of the Rust version used with RIOT was
needed, CARGO_CHANNEL was added to explicitly set the Rust version with
consideration for CI special cases.
Rust's mechansims of selecting a toolchain can be used instead now.
If `register_interrupt` somehow fails, we leak the already created
POSIX timer by returning immediately.
Fix this by calling `timer_delete` before returning.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
When using `err`, no stacktrace is generated and the standard panic
functionallity of RIOT is sidestepped.
Use `core_panic` instead.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
In `timer_init`, `freq` is being check so its not unused.
In `timer_set_periodic`, `flags` is being used too.
Remove the uses of `(void)` in both cases.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Initial version to test 64 bit compatibility.
Instead of a separate board, the inital version for Linux/x86_64 is enabled
by setting the environment variable `NATIVE_64BIT=y` and compiling as usual.
Not currently implemented:
* Architectures other than x86_64 or operating systems other than Linux
* No FreeBSD support
* No Aarch support
* Rust support for x86_64
This provides glibc, NetBSD, FreeBSD compatible endian.h header with a
lean and simple API to convert between host byte order to little endian
and big endian and the other way around.
Add support for querying the frequency supported by
`periph_timer`. This allows applications which require
this feature to run on the `native` board.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
The tramp assembly was missing a `.note.GNU-stack` section,
meaning the compiler was forced to assume that we require
an executable stack.
Fix this by adding the necessary section.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>