This code is licensed under BSD-4-Clause license which may render the OS unusable for some products.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Summary:
If we disable LIB_PATHBUFFER_MALLOC, that when the path buffer is insufficient, NULL is returned to avoid applying for a buffer from the heap.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Summary:
1.Modify the conditions for entering different include header files
2.Added pre-definition for _Atomic _Bool when it is missing
3.Added nuttx for stdatomic implementation. When toolchain does not support atomic, use lib/stdatomic to implement it
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
obstack_printf and obstack_vprintf should terminate the C string with
null byte but lib_vsprintf doesn't do it. It must be done on top of
that unless we get unterminated string.
This is fix to be consistent with GlibC behavior.
This also includes minor tweak to use obstack_1grow directly instead of
calling obstack_puts.
Summary:
Since there is a default definition for CONFIG_SMP_NCPUS in sys/types.h, we can remove #ifdef and return CONFIG_SMP_NCPUS directly.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Summary:
1.Remove the macro definition of getnproc in sysinfo
2.New get_nprocs_conf and get_nprocs interfaces, return CONFIG_SMP_NCPUS, return 1 when not defined
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Summary:
Warning: /home/runner/work/nuttx/nuttx/nuttx/libs/libc/stdio/lib_remove.c:59:32: warning: Wrong column position of comment right of code
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Summary:
When the deleted path is a file, the return value of get_errno is -EISDIR, so in Condition Two
(get_errno() ! = EPERM && /* .... . try to remove it. */
rmdir(path) ! = 0)
The judgment holds directly, so it can't actually execute to rmdir
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This is a tool for associating discrete IDs with addresses.
This tool is implemented through the red-black tree method provided by <sys/tree.h>, and the time complexity when calling, searching, and deleting is optimized to O(logn)
The implementation is the moving node operation of two red-black trees
1. When applying for a node, it will first check whether there is an available node in the "removed" tree. If so, the memory address of the node will be reused and moved to the "alloced" tree.
2. If the "removed" tree is an "empty tree", then the node will be requested from the memory and added to the "alloced" tree
3. Similarly, when removing a node, we set the address pointed to in the node to "NULL" and move it to the "removed" tree. Next time we alloc the node, we can reduce the overhead caused by memory application
For now, we still have something that can be optimized, and that is the memory elimination mechanism of the "removed tree". The current implementation will only release all the content under the "removed" tree when the idtree is destroyed.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
"stdio/lib_dtoa_engine.c", line 102: error #166: invalid floating constant
if (x < MIN_MANT)
^
"stdio/lib_dtoa_engine.c", line 102: warning #1626-D: concatenation with "("
in macro "PASTE" does not create a valid token
if (x < MIN_MANT)
^
"stdio/lib_dtoa_engine.c", line 102: error #109: expression preceding
parentheses of apparent call must have (pointer-to-) function type
if (x < MIN_MANT)
^
"stdio/lib_dtoa_engine.c", line 107: error #166: invalid floating constant
if (y < MAX_MANT)
^
"stdio/lib_dtoa_engine.c", line 107: warning #1626-D: concatenation with "("
in macro "PASTE" does not create a valid token
if (y < MAX_MANT)
^
"stdio/lib_dtoa_engine.c", line 107: error #109: expression preceding
parentheses of apparent call must have (pointer-to-) function type
if (y < MAX_MANT)
^
"stdio/lib_dtoa_engine.c", line 119: error #166: invalid floating constant
if (y >= MIN_MANT)
^
"stdio/lib_dtoa_engine.c", line 119: warning #1626-D: concatenation with "("
in macro "PASTE" does not create a valid token
if (y >= MIN_MANT)
^
"stdio/lib_dtoa_engine.c", line 119: error #109: expression preceding
parentheses of apparent call must have (pointer-to-) function type
if (y >= MIN_MANT)
^
"stdio/lib_dtoa_engine.c", line 144: error #166: invalid floating constant
if (x >= MAX_MANT)
^
"stdio/lib_dtoa_engine.c", line 144: warning #1626-D: concatenation with "("
in macro "PASTE" does not create a valid token
if (x >= MAX_MANT)
^
"stdio/lib_dtoa_engine.c", line 144: error #109: expression preceding
parentheses of apparent call must have (pointer-to-) function type
if (x >= MAX_MANT)
^
"stdio/lib_dtoa_engine.c", line 153: error #166: invalid floating constant
uint64_t decimal = MIN_MANT_INT;
^
"stdio/lib_dtoa_engine.c", line 153: warning #1626-D: concatenation with "("
in macro "PASTE" does not create a valid token
uint64_t decimal = MIN_MANT_INT;
^
"stdio/lib_dtoa_engine.c", line 153: error #109: expression preceding
parentheses of apparent call must have (pointer-to-) function type
uint64_t decimal = MIN_MANT_INT;
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
This commit fixes erronous assignment of lib_pwd_globals.c
previously guarded by CONFIG_LIBC_PASSWD_FILE. Original
Make.defs file has this in CSRCS scope.
Signed-off-by: Daniel Jasinski <jasinskidaniel95szcz@gmail.com>
The ELF loader needs to load the app into the memory before
executing it from the same location. As expected, this memory space
should be able to execute code. For architectures containing data
and instruction buses, the instruction bus may not be able to be
accessed in a non-aligned way, which is usually required when
copying data to that location. Eventually, this same memory space
can be accessed through the data bus, using different address
ranges. This commit enables accessing the memory through the data
bus to copy the app's data before executing it when
`CONFIG_ARCH_HAVE_TEXT_HEAP_WORD_ALIGNED_READ` is enabled.
To solve some compilation issues encountered during the porting of
third-party libraries, this function has been added.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Add a common method to format backtrace to buffer, so it can be used by both mm, fs and other possoble modules.
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
Disable sincos optimization for all functions in this file,
otherwise gcc would generate infinite calls.
Refer to gcc bug 46926.
-fno-builtin-sin or -fno-builtin-cos can disable sincos optimization,
but these two options do not work inside optimize pragma in-file.
Thus we just enforce -O0 when compiling this file.
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>