Since pthread_mutex is implemented by sem, it is impossible to see in ps who holds the lock and causes the wait.
Replace sem with mutex implementation to solve the above problems
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
reason:
spin_initialize is often used to release a lock,
and if we don't include a memory barrier,
it may lead to the lock being released prematurely.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
reason:
These interfaces are used when we assign interrupt
handling of the same priority to the corresponding priority work queues.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Some USB controllers can receive or send multiple data packets then
generate one interrupt. This mechanism can reduce the number of data
copies. Extend req buf to accommodate this.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
purpose:
To improve the real-time performance of the system, we prefer to perform
as few operations as possible within the interrupt function.
We have designed an interrupt thread for each interrupt,
where all the operations that are not necessary to be handled
in the interrupt function are delegated to be processed by the interrupt thread.
Up_enable_irq will be invoked after isrthread started.
Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
-machine virt,virtualization=on,gic-version=3 \
-net none -chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel ./nuttx
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Add TUNSETCARRIER ioctl, then we may change the carrier state of TUN dynamically. Note that we don't need an ioctl for getting carrier, it can be done by SIOCGIFFLAGS already.
Ref: https://github.com/torvalds/linux/blob/v6.10/drivers/net/tun.c#L3374-L3380
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
CC: serial/serial_io.c "/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/power/regulator.h", line 227: warning #231-D:
declaration is not visible outside of function
int regulator_gpio_init(FAR struct ioexpander_dev_s *iodev,
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
This is a memory monitoring interface implemented with reference to Linux's PSI (Pressure Stall Information),
which can send notifications when the system's remaining memory is below the threshold.
The following example code sets two different thresholds.
When the system memory is below 10MB, a notification is triggered.
When the system memory is below 20 MB, a notification (POLLPRI event) is triggered every 1s.
```
int main(int argc, FAR char *argv[])
{
struct pollfd fds[2];
int ret;
if (argc == 2)
{
char *ptr = malloc(1024*1024*atoi(argv[1]));
printf("Allocating %d MB\n", atoi(argv[1]));
ptr[0] = 0;
return 0;
}
fds[0].fd = open("/proc/pressure/memory", O_RDWR);
fds[1].fd = open("/proc/pressure/memory", O_RDWR);
fds[0].events = POLLPRI;
fds[1].events = POLLPRI;
dprintf(fds[0].fd, "%llu -1", 1024LLU*1024 * 10);
dprintf(fds[1].fd, "%llu 1000000", 1024LLU*1024 * 20);
while (1)
{
ret = poll(fds, 2, -1);
if (ret > 0)
{
printf("Memory pressure: POLLPRI, %d\n", ret);
}
}
return 0;
}
```
https://docs.kernel.org/accounting/psi.html
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
"/home/guoshichao/work_profile/vela_os/vela_car_4/nuttx/include/nuttx/net/netdev.h", line 493: warning #231-D:
declaration is not visible outside of function
FAR struct netdev_ifaddr6_s *addr,
^
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
1.Add sign to indicate negative and positive
2.Fix case where there are negative numbers in the operation
3.expand to 512 bytes to support rsa2048
Signed-off-by: makejian <makejian@xiaomi.com>
(1) RSA_PKCS15_VERIFY Misspell
(2) if iv not provided during decryption, iv should get from data.
It was not discovered before because all symmetric decryption comes with iv.
Signed-off-by: makejian <makejian@xiaomi.com>
Some macro definitions have already been defined in other header files, redundant macro definitions have been removed in include/nuttx/can.h. Align some code. Remove no use struct (can_response_s) and some variables.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Events groups are synchronization primitives that allow tasks to wait
for multiple conditions to be met before proceeding. They are particularly
useful in scenarios where a task needs to wait for several events to occur
simultaneously.
Signed-off-by: chao an <anchao@lixiang.com>