Spinlocks from spinlock.h do not disable the scheduler and thus cannot safely
be directly used as a locking mechanism. A task holding the lock can get
pre-empted, and at that point the new running task will also be allowed to
take the spinlock and access whatever it was protecting.
Another issue is that the task holding a spinlock could migrate to a different
core which in turn would cause the application to fail asserts. The current
implementation assumes the core that takes the lock is also the core that
releases it.
Closes https://github.com/espressif/esp-idf/issues/5762
* changing dependencies from unity->cmock
* added component.mk and Makefile.projbuild
* ignore test dir in gen_esp_err_to_name.py
* added some brief introduction of CMock in IDF
- Introduce system time function and concept of system time provider.
esp_timer is system time provider when present.
- Set the reference point for system time, g_startup_time.
- Use the system time functions in newlib instead of calling esp_timer
functions directly
esp_common/shared_stack: refactored the implemenation of shared stack function (still not working properly)
esp_expression_with_stack: refactored the shared stack function calling mechanism and updated the documentation
If the olddelta argument is not a null pointer, the adjtime function returns information
about any previous time adjustment that has not yet completed.
Closes: https://github.com/espressif/esp-idf/issues/5194
BSDs and Unices defined some non standardised functions and symbols used
for endianness handling: converting from Little Endian to Big Endian,
converting from Host to a specific representation, converting from a
specific representation to Host.
With this commit, a modified version of those symbols provided by
FreeBSD is imported.
The license of the imported code is still 2-Clause BSD.
Signed-off-by: Francesco Giancane <francesco.giancane@accenture.com>
Closes https://github.com/espressif/esp-idf/pull/4784
Programs and libraries using compiler and system information about
endianness often include the system header `<endian.h>`.
In `xtensa-gcc` compiler with `newlib` distribution, that file is located in
`<machine/endian.h>`; this means that `#include <endian.h>` would fail
at compile time.
This commit fixes the issue by adding a compatibility `<endian.h>`
header which in turn just includes `<machine/endian.h>`.
Signed-off-by: Francesco Giancane <francesco.giancane@accenture.com>
Merges https://github.com/espressif/esp-idf/pull/4784
esp2020r1 toolchain includes a nano.specs file, which instructs GCC to
substitute libc.a with libc_nano.a.
In the build system, this simplifies handling of the nano formatting
option, eliminating LIBC and LIBM global variables.
poll: use "select" not "esp_vfs_select" move to newlib
pread, pwrite, select, utime: remove from newlib. VFS and/or LWIP will
provide aliases for these functions.
newlib/assert: replace unlikely with likely to keep original assertion
newlib/assert: fix assert macro that uses likely
freertos/port: add the missing sdkconfig.h back
newlib/assert: assert macro back to a single line
Since in b0491307, which has introduced the optimized window spill
procedure, _xt_context_save did not work correctly when called from
_xt_syscall_exc. This was because unlike _xt_lowint1, _xt_syscall_exc
does not save PS and EPC1. The new version of _xt_context_save
modified PS (on purpose) and EPC1 (accidentally, due to window
overflow exceptions), which resulted in a crash upon 'rfi' from the
syscall.
This commit adds restoring of PS and EPC1 in _xt_context_save. It also
slightly reduces the number of instructions used to prepare PS for
window spill.
Unit test for setjmp/longjmp (which were broken by this regression)
is added.
Closes https://github.com/espressif/esp-idf/issues/4541