use PTHREAD_CLEANUP_STACKSIZE to enable or disable interfaces pthread_cleanup_push() and pthread_cleanup_pop().
reasons:(1)same as TLS_TASK_NELEM (2)it is no need to use two variables
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
we will integrate network management tools in future projects. In the
process of porting the tools, we encounter some situations where the
structure is not defined, refer to the common implementation of other
systems and add relevant definitions.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
if config_walltime_signal is enabled, NuttX_sim will receive a lot of
signals, the socket api will break and errno will be EINTR, masking irq
before calling the host socket api will avoid this problem.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
the previous patch can not handle the revent is POLLHUP or POLLERR,
poll_setup needs to be executed only when the POLLIN or POLLOUT event
changes.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
There is no control over whether a valid index is input when user use
ioctl to get netdev information, so removing this assertion will allow
ENODEV to be returned.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
In SMP mode, the fpu owner may switch from core0 to core1,
so it is necessary to force saving the FPU context when a
context switch occurs.
This PR fixed the crash issue mentioned in #8799.
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
Test on sim/nsh:
(CONFIG_DEBUG_ASSERTIONS=y CONFIG_DEFAULT_SMALL=y)
text data bss dec hex filename
423626 27152 4128 454906 6f0fa nuttx /* before */
417010 27152 4128 448290 6d722 nuttx /* after */
-6616
Signed-off-by: chao an <anchao@xiaomi.com>
In embedded development environments, due to the lack of address isolation between processes,
fd may be passed between processes and lead to misuse,
We have designed an fd cross-process automatic detection tool,
fdcheck_protect returns the fd containing the pid information,
indicating that the ownership of the current fd belongs to the pid and is not allowed to be used by other processes.
fdcheck_restore will obtain the true fd and check if the ownership of the fd is legal
For ease of understanding, let's give an example where
the following information is represented in 32-bit binary format
fd 00000000 00000000 00000000 10001010
pid 00000000 00000000 00000011 01010101
ret 00000000 00000011 01010101 10001010
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Fix warning:
```
serial/ptmx.c:205:34: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Wformat-truncation=]
205 | snprintf(devname, 16, "/dev/pty%d", minor);
|
serial/ptmx.c:205:25: note: directive argument in the range [0, 2147483647]
205 | snprintf(devname, 16, "/dev/pty%d", minor);
| ^~~~~~~~~~~~
serial/ptmx.c:205:3: note: ‘snprintf’ output between 10 and 19 bytes into a destination of size 16
205 | snprintf(devname, 16, "/dev/pty%d", minor);
```
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
When the file pointer is reopened, keep f_tag unchanged as fd remains unchanged
fix issue https://github.com/apache/nuttx/issues/9494
Signed-off-by: hujun5 <hujun5@xiaomi.com>
If a kernel stack exists, use that whenever the user process is in
privileged mode, i.e. running an exception or in system call. Previously
the exception context was stored into the user's stack, which is not ideal.
Why?
1. Because the exception entry status (REG_INT_CTX) is needed by the
kernel, and this is now in user memory which requires that the correct
user mappings are active when it is accessed.
2. The user must currently account for the exception stack frame (which
is BIG) in its own stack allocation. Moving the exception context save
to the kernel stack offloads this responsibility from the user to the
kernel, which is IMO the correct behavior.
3. The kernel access to user memory is currently allowed without condition,
however this is not ideal either. The privileged mode status CSR allows
blocking access to user memory via the STATUS_SUM-bit, which should be
disabled by default and only enabled when access to user space is really
needed. This patch allows implementing such features.
This is preparation to use kernel stack for everything when the user
process enters the kernel. Now the user stack is in use when the user
process runs a system call, which might not be the safest option.
Updated alt1250 driver with regarding to the following changes.
- Add LTE hibernation feature
- Split source code per module
- Some refactoring
- Some bug fixes
This also removes kconfig warning:
Normalize icicle/knsh
.config:248:warning: symbol value '' invalid for ARCH_KMAP_VBASE
.config:248:warning: symbol value '' invalid for ARCH_KMAP_VBASE