-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for Annex K functions according to C11 #13
Commits on Jul 30, 2024
-
semihosting: reduce code duplication for calls with indirect arguments
These functions make it easier to call the semihosting functions without having to declare a local struct in each caller. Since there is only one call with 4 indirect parameters, I did not add a sys_semihost4 wrapper.
Configuration menu - View commit details
-
Copy full SHA for 1098984 - Browse repository at this point
Copy the full SHA 1098984View commit details -
Optimize strcmp by calling orc.b (OR-Combine) instruction when Zbb extension is supported instead of 4 instructions to detect if zero byte is exist in word Signed-off-by: Mohamed Moawad <moawad@synopsys.com>
Configuration menu - View commit details
-
Copy full SHA for e71c602 - Browse repository at this point
Copy the full SHA e71c602View commit details -
Enable zbb extension in CI configuration
Enable zbb extension in CI for RISC-V to test optimizations using bit manipulation instructions like `orc.b`. This ensures that the strcmp optimization and other features using zbb are tested and validated Signed-off-by: Mohamed Moawad <moawad@synopsys.com>
Configuration menu - View commit details
-
Copy full SHA for 61560a1 - Browse repository at this point
Copy the full SHA 61560a1View commit details
Commits on Jul 31, 2024
-
picocrt: Add an option to enable MMU (and caches)
This is currently only implemented for Arm32 v7a where the CPU starts off with MMU disabled. This requires 8KB of page table memory, so there is an option to disable it if necessary.
Configuration menu - View commit details
-
Copy full SHA for 5252f4d - Browse repository at this point
Copy the full SHA 5252f4dView commit details -
arm: Initialize all of the shadow SPs for non-M targets
Non-M processors have a wealth of stack pointers, one for each interrupt entry point. As the only thing we're using the other entry points for in the sample code is to catch errors, we'll just smash the same stack for every one. This allows us to stop setting the SP in the vectors themselves which trashed one of the saved register values. This is mixed in with code which uses ARM mode exception vectors on 'A' profile targets; attempting to set the TE bit on those doesn't seem to work on QEMU. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for b2d921a - Browse repository at this point
Copy the full SHA b2d921aView commit details -
scripts: Split out non-'A' V7 arm targets in run-arm
We need to distinguish between v7, v7-a and v7-r targets as the v7-r don't support the 32-bit ARM ISA and hence can't use ARM mode for exception handling, while the v7-a only seem to support ARM mode for exception handling. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 2740e4f - Browse repository at this point
Copy the full SHA 2740e4fView commit details
Commits on Aug 1, 2024
-
arm: Use aeabi_memcpy-armv7a.S on aligned targets, memcpy-armv7a on u…
…naligned This seems like it got scrambled when merging newlib updates from arm. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 06abb65 - Browse repository at this point
Copy the full SHA 06abb65View commit details -
picocrt: Set correct reason value in non-M arm exception handlers
copy-paste programming error left them all using REASON_UNDEF. Also switch instruction to 'movs', which makes clang happy. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 64d0ff4 - Browse repository at this point
Copy the full SHA 64d0ff4View commit details -
picocrt: Call thumb-1 stack setting function from non-naked function
Clang doesn't let us do any regular C code from a naked function, so move all of the Thumb-1 stack pointer setup into a single function and call that from _cstart instead of _start. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for dd71126 - Browse repository at this point
Copy the full SHA dd71126View commit details -
scripts: Use arm926 for v5T targets too
clang sticks 'v5T' into the CPU_arch tag instead of 'v5TE', so check for that value. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for e67e8b8 - Browse repository at this point
Copy the full SHA e67e8b8View commit details -
scripts: Add clang arm v7a thumb v5 sample scripts
Allow these architectures to be tested Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 5a41939 - Browse repository at this point
Copy the full SHA 5a41939View commit details -
.github: Disable testing on aarch64 targets for now
These fail on current qemu which now checks memory access alignment when the MMU is disabled. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 8a9d58a - Browse repository at this point
Copy the full SHA 8a9d58aView commit details -
.github: Test clang on arm v7a and arm 5 in thumb mode
Make sure these two architectures work when using clang. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for c8a2a97 - Browse repository at this point
Copy the full SHA c8a2a97View commit details
Commits on Aug 2, 2024
-
math/aarch64: Fix lrint/lround in ilp32 mode
In this mode, longs are only 32 bits, so we need to use the 32-bit form of the fcvtzs instruction instead of the 64-bit form. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 2ef817b - Browse repository at this point
Copy the full SHA 2ef817bView commit details
Commits on Aug 3, 2024
-
aarch64: Fix up strcmp for ilp32
The asm version was missing a check for LP64 causing it to also define the function. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 8686449 - Browse repository at this point
Copy the full SHA 8686449View commit details -
We need to enable the MMU so that unaligned access to normal memory doesn't trap. On aarch64, that's not too bad as we can create level-1 block maps that cover 1GB apiece and then set up an 8GB virtual space. That means we only need 8 PTEs. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 343aead - Browse repository at this point
Copy the full SHA 343aeadView commit details -
picocrt/aarch64: Add sample interrupt vector
This provides for override-able interrupt handling at the cost of wasting all of the room provided for these functions in the interrupt table. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 594d11d - Browse repository at this point
Copy the full SHA 594d11dView commit details -
picocrt/aarch64: Trap exceptions in semihost mode
Handle exceptions in semihost mode so that we'll get useful data. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for a662ca1 - Browse repository at this point
Copy the full SHA a662ca1View commit details -
test: Add invalid instruction for aarch64 to test-except
Now that exceptions are trapped, make sure they work. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for b7bdbb8 - Browse repository at this point
Copy the full SHA b7bdbb8View commit details -
scripts: Add aarch64-zephyr configuration script
This uses the existing aarch64-zephyr cross compile file. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 2dc7540 - Browse repository at this point
Copy the full SHA 2dc7540View commit details -
.github: Re-enable aarch64 testing with linux toolchain
Now that the MMU is enabled, testing can be turned back on. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 6b39d34 - Browse repository at this point
Copy the full SHA 6b39d34View commit details -
.github: Test aarch64 using zephyr toolchain
Update the Zephyr SDK and add aarch64 bits Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for ee52287 - Browse repository at this point
Copy the full SHA ee52287View commit details
Commits on Aug 7, 2024
-
tinystdio: handling
"nan(n-sequence char)"
byscanf()
family & `s……trtod()` Quoting from C standard part 7.19.6.2 > `a,e,f,g` Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of the `strtod` function. The corresponding argument shall be a pointer to floating. Regarding `strtod`, quoting from C standard part 7.20.1.3 > A character sequence `NAN` or `NAN(n-char-sequence)`, is interpreted as a quiet NaN, if supported in the return type, else like a subject sequence part that does not have the expected form; the meaning of the `n-char sequences` is implementation-defined. Signed-off-by: Abdallah Abdelhafeez (Abdallahs70)
Configuration menu - View commit details
-
Copy full SHA for eadb39b - Browse repository at this point
Copy the full SHA eadb39bView commit details -
tinystdio: Reformat conv_flt change
Make the new code match the old format Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for e434fa1 - Browse repository at this point
Copy the full SHA e434fa1View commit details
Commits on Aug 8, 2024
-
test: Place libc in link_args consistently
To avoid depending on a .specs file, we can't let meson insert the libraries relative to the link_args by itself as the link_args end up after the libs, which breaks the printf/scanf symbol definitions. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for bf0b693 - Browse repository at this point
Copy the full SHA bf0b693View commit details -
Don't use specs files when building tests
The generated specs files reference installed versions of the library files. If those are already present in the system, we may end up using them for things like #include_next. The existing compile and link args already provide all of the values which the .specs files want to add. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for a88bcb7 - Browse repository at this point
Copy the full SHA a88bcb7View commit details -
posix: Disable analyzer bounds checks for computematchjumps
I couldn't figure out why it got confused about the bounds checking for pmatches. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 766eae1 - Browse repository at this point
Copy the full SHA 766eae1View commit details -
tinystdio: Remove public header includes from stdio.h
Keep stdio.h from making other standard symbols visible Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for c4b55b0 - Browse repository at this point
Copy the full SHA c4b55b0View commit details -
signal: Remove sys/signal.h, clean up signal.h
Follow POSIX requirements for visible symbols by placing them all in signal.h and then cleaning that up to stop making other symbols visible. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 37f520a - Browse repository at this point
Copy the full SHA 37f520aView commit details -
string: Remove sys/features from string.h
sys/cdefs already includes this Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 4759097 - Browse repository at this point
Copy the full SHA 4759097View commit details -
include: Clean up errno.h (and sys/errno.h)
move 'error_t' to argz.h and envz.h where it belongs. Get rid of __LINUX_ERRNO_EXTENSIONS__ -- C allows the library to define as many errno values as it likes. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 2f56cbd - Browse repository at this point
Copy the full SHA 2f56cbdView commit details -
Move sys/cdefs include to the top of the file. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for e9aeef5 - Browse repository at this point
Copy the full SHA e9aeef5View commit details -
include: Remove unnecessary sys/config.h includes
sys/config.h is included by sys/cdefs.h, which is included by every public header. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 3eac897 - Browse repository at this point
Copy the full SHA 3eac897View commit details -
Remove internal source references to sys/cdefs.h
This will be included by any public header, so the internal source files don't need to also include it. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for ea86a27 - Browse repository at this point
Copy the full SHA ea86a27View commit details -
posix: Remove the entirely unused LC_COLLATE file support
Not even newlib still supports any of this mechanism. Remove the collate.c file and eliminate all internal usage of __collate_load_error. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for a785772 - Browse repository at this point
Copy the full SHA a785772View commit details -
test: semihost test needs POSIX limits for PATH_MAX
PATH_MAX is a posix value, not a C value. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 025c2cf - Browse repository at this point
Copy the full SHA 025c2cfView commit details -
include: _POSIX_2_RE_DUP_MAX -> unistd.h. Mask POSIX limits.
Make sure limits.h doesn't expose any non-C limits unless the application requests them. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 2f5f843 - Browse repository at this point
Copy the full SHA 2f5f843View commit details -
Move sys/fenv.h to machine/fenv.h
This is a machine-specific file, not an OS specific file. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 38b527a - Browse repository at this point
Copy the full SHA 38b527aView commit details -
sys/time.h: remove time_t declaration
This is declared in sys/_timespec.h already, no need to duplicate it here. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for e2d144a - Browse repository at this point
Copy the full SHA e2d144aView commit details -
include/math.h: Define FP_FMA*
These are required by C. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 5a04e1c - Browse repository at this point
Copy the full SHA 5a04e1cView commit details -
regex: Use RE_DUP_MAX instead of _POSIX2_RE_DUP_MAX
_POSIX2_RE_DUP_MAX is the minimum acceptable value for any POSIX system while RE_DUP_MAX is the value supported by the library. Signed-off-by: Keith Packard <keithp@keithp.com>
Configuration menu - View commit details
-
Copy full SHA for 29f1da4 - Browse repository at this point
Copy the full SHA 29f1da4View commit details
Commits on Aug 12, 2024
-
Add Support for Annex K functions according to C11
Adding an implementation of the bounds-checking C functions (as specified in Annex K of the C11 standard) to the PicoLibc. These functions lower the risk of introducing security vulnerabilities such as buffer overflows and format string vulnerabilities into your code by providing clear and easy-to-use interfaces. For each C function a secure alternate function ending in a "_s" postfix is provided (e.g., strcpy_s). Use of these functions is recommended by security experts and secure coding standards. also, Implemented unit tests for the Annex-K functions to ensure their corrctness. Covered various scenarios including normal operation, boundary conditions, and error handling. Signed-off-by: Mostafa Salman <mostafas@synopsys.com>
Configuration menu - View commit details
-
Copy full SHA for 1e23bb1 - Browse repository at this point
Copy the full SHA 1e23bb1View commit details