Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
The reason for using builtin atomic is that in C++, when include <atomic> in <nuttx/atomic.h> easily conflicts with third-party function libraries. We wanted to completely separate the implementation of <nuttx/atomic.h>.
There are two points:
1. use builtin function directly.
2. Without the standard library implementation, need implement "atomic_fetch_xxx", leading conflicts with the standard library used by third-party programs, introducing redefinition issues and requiring name changes.
Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
Adjust the order of all options where the level is SOL_SOCKET. If an
option occupies a bit in socket_conn_s:s_options, place it at the front.
This is to save bits for options of other levels and prevent the 32-bit
overflow of socket_conn_s:s_options.
The definition of many options for other levels uses _SO_PROTOCOL as the
base value. If _SO_PROTOCOL is relatively small, more bits will be left
for options of other levels. Before adjustment, there were 16 bits
available; after adjustment, this number has increased to 23 bits.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
"/home/guoshichao/work_profile/vela_os/vela_car_dev_1/nuttx/libs/libc/net/lib_getifaddrs.c", line 215: error #1982-D:
target stack alignment is insufficient to guarantee alignment of
this variable
struct lifreq req;
^
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
change the environ implementation from sched/environ to
libc/environ, thus we can access the environ related API can vai libc
directl, which could improve the access speed in kernel build.
And in order to support this modification, we change the
struct task_info_s's ta_lock from nxmutex_t to nxrmutex_t,
this is because the env_*-related APIs require the ta_lock
to be reentrant.
If recursive locks are not supported, it may lead to deadlocks
in certain scenarios. For example, during initialization on the
qemu-miwear platform, it is necessary to call getenv while already
holding the ta_lock. To support such cases, we need to change
the ta_lock from nxmutex_t to nxrmutex_t.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
The atomic implementation logic can be broken down into follow scenarios:
1. Toolchain support, which is ideal.
2. Single-core interrupt disabling, the default for non-SMP environments.
3. If atomic instructions are supported, the libc_atomic_arch version can be implemented.
Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
According to the PSE52 POSIX header file specification,
function prototypes declared in header files must not
include parameter names. Otherwise, the header test case
check will fail and prompt us to remove the parameter names.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This reverts commit 6bb97bac15f0aa8012be22cc21d7c9dad93f9a51.
conflict with libcxx byte order check
libs/libxx/libcxx/include/__config(444):
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
int nxsem_clockwait
int nxsem_tickwait
int nxsem_timedwait
int nxsem_tickwait_uninterruptible
int nxsem_clockwait_uninterruptible
int nxsem_timedwait_uninterruptible
Signed-off-by: hujun5 <hujun5@xiaomi.com>
We use USERSPACE to get builtin data,so don't need this patch
This reverts commit ef1f5ba351eb4a35ea31b84be92d6ce58e072a31.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
1. add the DISABLE_SIGNALS build option
2. make the sleep/usleep/nanosleep function can work with signal
function disabled
3. make the driver/fs/sched/libc kernel module can decouple from signal
module
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
refs : https://man7.org/linux/man-pages/man2/timerfd_create.2.html
If the associated clock is either CLOCK_REALTIME or
CLOCK_REALTIME_ALARM, the timer is absolute
(TFD_TIMER_ABSTIME), and the flag TFD_TIMER_CANCEL_ON_SET
was specified when calling timerfd_settime(), then read(2)
fails with the error ECANCELED if the real-time clock
undergoes a discontinuous change. (This allows the
reading application to discover such discontinuous changes
to the clock.)
examples code:
{
int nevents = epoll_wait(epollfd, events, N_ANDROID_TIMERFDS, -1);
if (nevents < 0) {
return nevents;
}
int result = 0;
for (int i = 0; i < nevents; i++) {
uint32_t alarm_idx = events[i].data.u32;
uint64_t unused;
ssize_t err = read(fds[alarm_idx], &unused, sizeof(unused));
if (err < 0 && errno != EAGAIN) {
if (errno == ECANCELED) {
//get time changed
} else {
return err;
}
} else {
//....
}
}
}
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
packing the internal substructures will reduce the overall alignment of
`sockaddr_storage` to 2, which triggers an unaligned access warning
in 32-bit systems.
Add an overall 8-byte alignment to the outermost layer of the structure.
Related commit: 855336bf
Refer to https://datatracker.ietf.org/doc/html/rfc2553#section-3.10
Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
When protect building mode, posix_spawn only enters the kernel space to
find the buildin executable file, but some executable files are in user
space. So first execute posix_spawn. If it is not found in kernel
space, then execute task_spawn to start it.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
1. According to the POSIX specification, the functions `pthread_kill`
and `pthread_sigmask` have been moved from `pthread.h` to `signal.h`.
2. As required by the POSIX standard, the pthread-related constants
have been relocated from `pthread.h` to `sys/types.h`.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
When cross-compiling PSE52 VSX testcases based on Vela, VSX defines its
own "OK" constant as a macro, which conflicts with the "OK" constant
defined as an enum in <sys/types.h>. To ensure compatibility, we
have undef'd the macro version of "OK" in advance.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
smartspeaker-knsh/libs/libc/libc.a(lib_mutex.c.o): in function `nxmutex_clocklock':
libs/libc/misc/lib_mutex.c:203:(.text.nxrmutex_clocklock+0x40): undefined reference to `nxsem_clockwait_uninterruptible'
Signed-off-by: ligd <liguiding1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
To save more space (equivalent to the size of one erase sector of
MTD device) and to achieve faster read and write speeds, a method
for direct writing was introduced at the FTL layer.
This can be accomplished simply by using the following oflags during
the open operation:
1. O_DIRECT. when this flag is passed in, ftl internally uses
the direct write strategy and no read cache is used in ftl;
otherwise, each write will be executed with the minimum
granularity of flash erase sector size which means a
"sector read back - erase sector - write sector" operation
is performed by using a read cache buffer in heap.
2. O_SYNC. When this flag is passed in, we assume that the
flash has been erased in advance and no erasure operation
will be performed internally within ftl. O_SYNC will take
effect only when both O_DIRECT and O_SYNC are passed in
simultaneously.
3. For uniformity, we remapped the mount flag in mount.h and
unified it with the open flag in fcntl.h. The repetitive
parts of their definitions were reused, and the remaining
part of the mount flag redefine to the unused bit of open
flags.
Signed-off-by: jingfei <jingfei@xiaomi.com>