| 17967299 | 28-Dec-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutil: add hdr_size parameter to bget
Adds a hdr_size parameter to bget(), bgetz() and bgetr(). hdr_size must be a multiple of BGET_HDR_QUANTUM. If hdr_size is larger than 0 the buffer will be all
libutil: add hdr_size parameter to bget
Adds a hdr_size parameter to bget(), bgetz() and bgetr(). hdr_size must be a multiple of BGET_HDR_QUANTUM. If hdr_size is larger than 0 the buffer will be allocated so that the alignment constraints are fulfilled after advancing hdr_size bytes into the returned buffer.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| cc5981b2 | 28-Dec-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutil: add alignment parameter to bget
Adds alignment parameter to bget(), bgetz() and bgetr(). If alignment is larger then 0 the returned buffer is guaranteed to have an address which is a multip
libutil: add alignment parameter to bget
Adds alignment parameter to bget(), bgetz() and bgetr(). If alignment is larger then 0 the returned buffer is guaranteed to have an address which is a multiple of this value.
The algorithm is basically unchanged, in the way that the memory is still allocated from the end of a free memory block. The difference is in the core implementation in bget() where now alignment of the returned memory is taken into account. If only allocating with the minimum alignment the memory blocks are expected to be allocated in the same pattern.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 27e8d08d | 27-Dec-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
Introduce CFG_TA_BGET_TEST
Introduces CFG_TA_BGET_TEST which compiles the integrated bget test suite together with the rest of bget. When enabled, the test entry point is bget_main_test() in libutil
Introduce CFG_TA_BGET_TEST
Introduces CFG_TA_BGET_TEST which compiles the integrated bget test suite together with the rest of bget. When enabled, the test entry point is bget_main_test() in libutils.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 145ae446 | 02-Dec-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
Use barrier_read_cntpct() to read CNTPCT
Arm ARM quite clearly mentions [1] [2] that such reads must be preceded by an ISB to forbid re-ordering.
[1] https://developer.arm.com/documentation/ddi0487
Use barrier_read_cntpct() to read CNTPCT
Arm ARM quite clearly mentions [1] [2] that such reads must be preceded by an ISB to forbid re-ordering.
[1] https://developer.arm.com/documentation/ddi0487/fc/ page D13-2863 "Synchronization requirements for AArch64 System registers" and page G8-6146 "Ordering of reads of System registers". [2] https://developer.arm.com/documentation/ddi0406/cd/ page B3-1441 "Ordering of reads of system control registers"
Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reported-by: Olivier Deprez <Olivier.Deprez@arm.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 00b3b9a2 | 31-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add generic struct ts_session
As a step in making room for Secure Partitions (SPs) running at S-EL0 add a Trusted Service (TS) abstraction. Both TAs and SPs is a TS.
Adds the generic struct t
core: add generic struct ts_session
As a step in making room for Secure Partitions (SPs) running at S-EL0 add a Trusted Service (TS) abstraction. Both TAs and SPs is a TS.
Adds the generic struct ts_session. All future sessions structs (currently only struct tee_ta_session exists) should add this struct to allow generic session operations.
With this struct comes new functions replacing previous struct tee_ta_session oriented functions. The following functions are replaced as: tee_ta_get_current_session() -> ts_get_current_session() tee_ta_push_current_session() -> ts_push_current_session() tee_ta_pop_current_session() -> ts_pop_current_session() tee_ta_get_calling_session() -> ts_get_calling_session()
ts_get_current_session() is changed compared to its predecessor to panic() in case of failure to return a valid pointer.
A new function ts_get_current_session_may_fail() is added to handle an eventual case where a return NULL session may be handled.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a8d59198 | 26-Oct-2020 |
Rouven Czerwinski <r.czerwinski@pengutronix.de> |
libutils: strtoul.c: adjust license text to upstream
Adjust the license text in strtoul.c according to upstream commit "Use remove-advertising-clause script to edit BSD licenses" [1]. With this, the
libutils: strtoul.c: adjust license text to upstream
Adjust the license text in strtoul.c according to upstream commit "Use remove-advertising-clause script to edit BSD licenses" [1]. With this, the file also matches its SPDX License identifier correctly.
Link: [1]: https://sourceware.org/git/?p=newlib-cygwin.git;a=commit;h=9042d0ce65533a26fc3264206db5828d5692332c Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Acked-by: Jerome Forissier <jerome@forissier.org> [jf: minor edits to commit message] Signed-off-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 762a5553 | 19-Oct-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
Add alignment parameter to FUNC() and LOCAL_FUNC() macros
Adds a default alignment parameter to FUNC() and LOCAL_FUNC() assembly macros. This is needed since the function macro also sets the sectio
Add alignment parameter to FUNC() and LOCAL_FUNC() macros
Adds a default alignment parameter to FUNC() and LOCAL_FUNC() assembly macros. This is needed since the function macro also sets the section of the function making any alignment directives before the function macro useless.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 36e784f6 | 13-Oct-2020 |
Volodymyr Babchuk <volodymyr_babchuk@epam.com> |
libutils: provide empty __getauxval() implementation
Never version of libgcc are built with LSE implementation in mind. To determine if LSE is available on platform it calls __getauxval(), so in som
libutils: provide empty __getauxval() implementation
Never version of libgcc are built with LSE implementation in mind. To determine if LSE is available on platform it calls __getauxval(), so in some cases we can get undefined reference to __getauxval() error.
Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception handler depends on atomic operations, so it tries to call init_have_lse_atomics() first. This function in turn calls __getauxval(), which causes linking error.
In the future we can make __getauxval() to return actual platform capabilities.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| d6583096 | 08-Oct-2020 |
Jerome Forissier <jerome@forissier.org> |
libutils: arm: add .cantunwind to __gnu_mcount_nc()
The __gnu_mcount_nc() function lacks proper annotation as registers are pushed onto the stack. The unwind table information for this symbol is the
libutils: arm: add .cantunwind to __gnu_mcount_nc()
The __gnu_mcount_nc() function lacks proper annotation as registers are pushed onto the stack. The unwind table information for this symbol is therefore incorrect and stack unwinding may fail in spectacular ways. For example, xtest 1007 enters an infinite loop as ldelf tries to unwind the call stack when the TA panics:
# Platform: QEMU (buildhost)$ make CFG_FTRACE_SUPPORT=y CFLAGS_ta_arm32=-pg run (qemu)$ xtest 1007 ... E/TC:? 0 TA panicked with code 0xbeef E/LD: Status of TA 5b9e0e40-2636-11e1-ad9e-0002a5d5c51b E/LD: arch: arm E/LD: region 0: va 0x00102000 pa 0x0e300000 size 0x002000 flags rw-s (ldelf) E/LD: region 1: va 0x00104000 pa 0x0e302000 size 0x00c000 flags r-xs (ldelf) E/LD: region 2: va 0x00110000 pa 0x0e30e000 size 0x001000 flags rw-s (ldelf) E/LD: region 3: va 0x00111000 pa 0x0e30f000 size 0x004000 flags rw-s (ldelf) E/LD: region 4: va 0x00115000 pa 0x0e313000 size 0x001000 flags r--s E/LD: region 5: va 0x00116000 pa 0x0e426000 size 0x003000 flags rw-s (stack) E/LD: region 6: va 0x00149000 pa 0x00001000 size 0x02b000 flags r-xs [0] .ta_head .text .plt .rodata .gnu.hash .ARM.extab .ARM.exidx .dynsym .dynstr .hash E/LD: region 7: va 0x00174000 pa 0x0002c000 size 0x0e7000 flags rw-s [0] .dynamic .tdata .tbss .got .rel.got .rel.plt .data .init_array .bss .rel.dyn E/LD: region 8: va 0x00291000 pa 0x00000000 size 0x00b000 flags r-xs [1] .hash .gnu.hash .dynsym .dynstr .rel.dyn .rel.plt .plt .text .rodata .ARM.extab .ARM.exidx E/LD: region 9: va 0x0029c000 pa 0x0000a000 size 0x002000 flags rw-s [1] .tdata .tbss .init_array .dynamic .got .data .bss E/LD: [0] 5b9e0e40-2636-11e1-ad9e-0002a5d5c51b @ 0x00149000 (out-br/build/optee_test_ext-1.0/ta/os_test/out/5b9e0e40-2636-11e1-ad9e-0002a5d5c51b.elf) E/LD: [1] ffd2bded-ab7d-4988-95ee-e4962fff7154 @ 0x00291000 (out-br/build/optee_test_ext-1.0/ta/os_test_lib/out/libos_test.so) E/LD: Call stack: E/LD: 0x0029481c _utee_panic at optee_os/lib/libutee/arch/arm/utee_syscalls_a32.S:51 E/LD: 0x002944fc TEE_Panic at optee_os/lib/libutee/tee_api_panic.c:24 E/LD: 0x0014c494 ta_entry_panic at out-br/build/optee_test_ext-1.0/ta/os_test/os_test.c:787 E/LD: 0x00293574 __gnu_mcount_nc at optee_os/lib/libutils/ext/arch/arm/mcount_a32.S:44 E/LD: 0x00293574 __gnu_mcount_nc at optee_os/lib/libutils/ext/arch/arm/mcount_a32.S:44 E/LD: 0x00293574 __gnu_mcount_nc at optee_os/lib/libutils/ext/arch/arm/mcount_a32.S:44 [repeats indefinitely]
The bug is triggered by commit 3513f961cda0 ("arm32: fold UNWIND(.fnstart/.fnend) into the FUNC macros"). Prior to that commit, the unwind entry for __gnu_mcount_nc() was "0x1 [cantunwind]", probably because the function had no .fnstart/.fnend directive.
This commit adds a .cantunwind directive to restore the previous behavior: unwinding stops at __gnu_mcount_nc(). Since the ftrace code overwrites LR on the stack, it seems there is no simple way to produce correct and comprehensive stack dumps short of introducing an unwind helper function with a knowledge of the ftrace transformation, similar to what ftrace_return() does.
At least with this patch the unwinding code does not fail.
Fixes: 3513f961cda0 ("arm32: fold UNWIND(.fnstart/.fnend) into the FUNC macros") Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 919a5a68 | 06-Oct-2020 |
Jerome Forissier <jerome@forissier.org> |
Use fallthrough pseudo-keyword in switch/case statements
Use fallthrough; in switch/case statements. Imported libraries (libtomcrypt, libmbedtls) are not modified to minimize differences with upstre
Use fallthrough pseudo-keyword in switch/case statements
Use fallthrough; in switch/case statements. Imported libraries (libtomcrypt, libmbedtls) are not modified to minimize differences with upstream.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 0887ca5f | 06-Oct-2020 |
Jerome Forissier <jerome@forissier.org> |
libutils: compiler.h: introduce fallthrough pseudo-keyword
Adds the fallthrough pseudo-keyword to be used in switch/case statements. Tested with GCC 6.2.1, 7.2.1, 8.2.1, 8.3.0, 9.2.1 and Clang 9.0.1
libutils: compiler.h: introduce fallthrough pseudo-keyword
Adds the fallthrough pseudo-keyword to be used in switch/case statements. Tested with GCC 6.2.1, 7.2.1, 8.2.1, 8.3.0, 9.2.1 and Clang 9.0.1 and 10.0.0.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 355fa095 | 24-Sep-2020 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
libutils: do not redefine ARRAY_SIZE
Do not redefine ARRAY_SIZE if it is already defined
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@lina
libutils: do not redefine ARRAY_SIZE
Do not redefine ARRAY_SIZE if it is already defined
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 9b0773cb | 11-Sep-2020 |
Jerome Forissier <jerome@forissier.org> |
libutils: fix memset(), memcpy(), memmove() with -O3
When libutils is built with optimization -O3 (make CFG_CC_OPT_LEVEL=3), memset() may cause infinite recursion. This bug was observed with GCC 8.3
libutils: fix memset(), memcpy(), memmove() with -O3
When libutils is built with optimization -O3 (make CFG_CC_OPT_LEVEL=3), memset() may cause infinite recursion. This bug was observed with GCC 8.3 with QEMUv8. The reason is, at this optimization level the compiler may decide to replace loops with calls to memset(), which is obviously not valid when the loop is in the memset function itself. This behavior can be turned off with -fno-tree-loop-distribute-patterns.
Therefore, add the appropriate build flag to memset.c. Note that a similar fix was introduced in upstream newlib [1] but since it depends on the newlib build script to detect compiler support, the patch is not directly applicable. Instead $(call cc-option,...) is used here.
Although I have not observed any issue with memcpy() and memmove(), upstream did apply the compiler flag to these functions too [1], [2], which seems quite reasonable so do the same here.
Link: [1] https://github.com/bminor/newlib/commit/10e4d79a191f07999bc94b21535fba5d7c04f419 Link: [2] https://github.com/bminor/newlib/commit/82dfae9ab0734b9946321590162dc6021057fec1 Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ebc961da | 11-Sep-2020 |
Jerome Forissier <jerome@forissier.org> |
libutils: memset(): add -O2 only if optimization is -Os
Commit 5b2aaa117eee ("libutee: optimize memcpy() for speed") added -O2 to memset.c to exclude the slower implementation which would be selecte
libutils: memset(): add -O2 only if optimization is -Os
Commit 5b2aaa117eee ("libutee: optimize memcpy() for speed") added -O2 to memset.c to exclude the slower implementation which would be selected when level is -Os (in which case __OPTIMIZE_SIZE__ is defined).
Since the optimization level can now be selected globally with CFG_CC_OPT_LEVEL, -O2 should not be forced unconditionally or it could actually reduce the desired level (when CFG_CC_OPT_LEVEL=3).
Therefore, add -O2 only if the global optimization is -Os.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 0bdc8233 | 04-Sep-2020 |
Khoa Hoang <admin@khoahoang.com> |
core: thread: add compiler barrier to thread_set_exceptions()
With compiler optimizer enable (-O2) compiler generate invalid code for thread_get_id_may_fail(). The curr_thread read got re-order afte
core: thread: add compiler barrier to thread_set_exceptions()
With compiler optimizer enable (-O2) compiler generate invalid code for thread_get_id_may_fail(). The curr_thread read got re-order after exceptions unmask.
Signed-off-by: Khoa Hoang <admin@khoahoang.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3513f961 | 03-Sep-2020 |
Jerome Forissier <jerome@forissier.org> |
arm32: fold UNWIND(.fnstart/.fnend) into the FUNC macros
This change applies to arm32 assembler sources.
Instead of using UNWIND(.fnstart) after FUNC or LOCAL_FUNC and UNWIND(.fnend) before END_FUN
arm32: fold UNWIND(.fnstart/.fnend) into the FUNC macros
This change applies to arm32 assembler sources.
Instead of using UNWIND(.fnstart) after FUNC or LOCAL_FUNC and UNWIND(.fnend) before END_FUNC, let's fold these statements into the FUNC macros.
The .fnstart/.fnend directives mark the start and end of a function with an unwind table entry (.ARM.exidx) and therefore a function without them has no entry and cannot be unwound. This means that a stack dump (on abort or panic) would stop when reaching such a function.
As a result of this patch, a small number of functions now have an entry in the unwind table when they had none before (the functions which were using FUNC or LOCAL_FUNC but had no .fnstart/.fnend). It was almost always a bug and this pacth only increases the size of the .ARM.exidx section by a few bytes (tested on QEMU).
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 827be46c | 03-Sep-2020 |
Jerome Forissier <jerome@forissier.org> |
arm32: move the UNWIND() macro to <asm.S>
All the users of the UNWIND() macro include <asm.S> already, which is therefore a good place to define this macro. Let's move it from <kernel/unwind.h> to <
arm32: move the UNWIND() macro to <asm.S>
All the users of the UNWIND() macro include <asm.S> already, which is therefore a good place to define this macro. Let's move it from <kernel/unwind.h> to <asm.S>, remove a couple of duplicates in assembler files, and drop the useless includes.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| e6f01334 | 03-Sep-2020 |
Jerome Forissier <jerome@forissier.org> |
core: remove stack dump macros and multiple log levels
Of the various xPRINT_STACK() macros (x in {E,I,D,F}), only EPRINT_STACK() is used. Let's simplify the code by removing the macros altogether a
core: remove stack dump macros and multiple log levels
Of the various xPRINT_STACK() macros (x in {E,I,D,F}), only EPRINT_STACK() is used. Let's simplify the code by removing the macros altogether and calling print_kernel_stack() instead. Since only the TRACE_ERROR is used, the 'level' argument to print_kernel_stack(), print_stack_arm32() and print_stack_arm64() is removed too.
In addition to simplifying the code, these changes will allow the consolidation of the stack unwinding code between core and ldelf.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 64df747c | 17-Aug-2020 |
Etienne Carriere <etienne.carriere@linaro.org> |
libutils: embed AEABI personality routines upon CFG_UNWIND
Fix a TA build issue found when CFG_UNWIND=n. This issue produces a build error trace like the below:
.../toolchains/aarch32/bin/arm-linux
libutils: embed AEABI personality routines upon CFG_UNWIND
Fix a TA build issue found when CFG_UNWIND=n. This issue produces a build error trace like the below:
.../toolchains/aarch32/bin/arm-linux-gnueabihf-ld.bfd: .../toolchains/aarch32/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/libgcc_eh.a(unwind-arm.o): in function `__aeabi_unwind_cpp_pr0': /tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--arm-linux-gnueabihf/build/src/gcc/libgcc/config/arm/unwind-arm.c:494: multiple definition of `__aeabi_unwind_cpp_pr0'; .../optee_os/out/arm/export-ta_arm32/lib/libutils.a(aeabi_unwind.o): .../optee_os/lib/libutils/ext/arch/arm/aeabi_unwind.c:9: first defined here .../optee_os/out/arm/export-ta_arm32/mk/link.mk:109: recipe for target 'out/5b9e0e40-2636-11e1-ad9e-0002a5d5c51b.elf' failed
I don't understand why toolchain support for __aeabi_unwind_cpp_pr0() conflicts with the libutils implementation only when CFG_UNWIND=n. Yet the current change works around the issue.
Fixes: https://github.com/OP-TEE/optee_test/issues/440 Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| e2f03e07 | 04-Jun-2020 |
Jerome Forissier <jerome@forissier.org> |
core: add stack overflow detection
This commit introduces CFG_CORE_DEBUG_CHECK_STACKS to check the stack limits using compiler instrumentation (-finstrument-functions). When enabled, the C compiler
core: add stack overflow detection
This commit introduces CFG_CORE_DEBUG_CHECK_STACKS to check the stack limits using compiler instrumentation (-finstrument-functions). When enabled, the C compiler will insert entry and exit hooks in all functions in the TEE core. On entry, the stack pointer is checked and if an overflow is detected, panic() is called.
How is this helpful since we have stack canaries already? 1. When a dead canary is found, the call stack will give no indication of the root cause of the corruption which may have happened quite some time before. Running the test case again with a debugger attached and a watchpoint on the canary is not always an option. 2. The system may corrupt the stack and hang in an exception handler before the first canary check, for instance, during boot when the temporary stack is used. This code will likely catch such issues, too.
The downside is increased stack usage and a significant runtime overhead which is why this feature should be enabled only for troubleshooting.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, QEMUv8) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 405a5072 | 21-Jul-2020 |
Jerome Forissier <jerome@forissier.org> |
libutils: add simplified fputc(), fputs(), fwrite(), write()
Preparing for C++ support in TAs.
Adds a few <stdio.h> functions to libutils:
fputc() fputs() fwrite() write()
The proposed implem
libutils: add simplified fputc(), fputs(), fwrite(), write()
Preparing for C++ support in TAs.
Adds a few <stdio.h> functions to libutils:
fputc() fputs() fwrite() write()
The proposed implementations are limited in the sense that they only accept writing to stdout or stderr. The output goes directly to the secure console and no difference is made between stdout and stderr.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f35d131b | 21-Jul-2020 |
Jerome Forissier <jerome@forissier.org> |
libutils: add sprintf()
Preparing for C++ support in TAs.
Implement sprintf() in libutils.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linar
libutils: add sprintf()
Preparing for C++ support in TAs.
Implement sprintf() in libutils.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 93aade0f | 09-Jul-2020 |
Jerome Forissier <jerome@forissier.org> |
core: mempool: use recursive mutex
The mempool code can be simplified by using a recursive mutex.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carri
core: mempool: use recursive mutex
The mempool code can be simplified by using a recursive mutex.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 64fd5a92 | 09-Jul-2020 |
Jerome Forissier <jerome@forissier.org> |
libutils: atomic.h: add atomic_{load,store}_short()
Adds atomic functions operating on the 'short int' type.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <et
libutils: atomic.h: add atomic_{load,store}_short()
Adds atomic functions operating on the 'short int' type.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f86aa9e1 | 09-Jul-2020 |
Jerome Forissier <jerome@forissier.org> |
core: make thread ID a short int
Changes thread_get_id() and thread_get_id_may_fail() to return 'short int' instead of 'int'. That is, 16 bits instead of 32 on all supported architectures which is m
core: make thread ID a short int
Changes thread_get_id() and thread_get_id_may_fail() to return 'short int' instead of 'int'. That is, 16 bits instead of 32 on all supported architectures which is more than enough since the largest thread ID value is (CFG_NUM_THREADS - 1). Note, struct wait_queue_elem::handle is already a short int.
trace_ext_get_thread_id() is not changed (still returns an int) because it is part of the TA API and modifying it would needlessly introduce incompatibilities.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|