Commit Graph

5800 Commits

Author SHA1 Message Date
chao an
205c8934a3 sched/msgq: add support of System V message queue
https://man.openbsd.org/msgget.2

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-22 12:58:11 +08:00
chao an
96c3debe6a sched/mqueue: decoupling condition member to common prologue
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-22 12:58:11 +08:00
Alin Jerpelea
06c8e43df9 drivers: modem: update altair modem
update Altair modem with the ALT1250 implementation

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-10-22 09:00:32 +08:00
raiden00pl
36ae5316b7 include/nuttx/can.h: make error definitions compatible with Linux 2022-10-21 18:47:29 +08:00
Xiang Xiao
942513cd37 time: Typedef time_t to int64_t if CONFIG_SYSTEM_TIME64 is defined
to handle 2038 problem correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-20 22:17:52 +02:00
Xiang Xiao
1e6a8f56d3 sched/spawn: Fix the minor typo error
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-20 21:51:40 +02:00
YAMAMOTO Takashi
8a972817e0 sched.h: Simplify HAVE_GROUP_MEMBERS logic
After the retirement of CONFIG_SCHED_EXIT_KILL_CHILDREN, [1]
the behavior is now effectively controlled by
CONFIG_SCHED_CHILD_STATUS, which is IMO confusing.
(It was even surprising me.)

This commit solves it by making HAVE_GROUP_MEMBERS
a synonym of !CONFIG_DISABLE_PTHREAD. I guess this change aligns
the intention of the CONFIG_SCHED_EXIT_KILL_CHILDREN retirement.
That is, always tries to be similar to the standard behavior.

Another option would be to revive CONFIG_SCHED_EXIT_KILL_CHILDREN
and make the HAVE_GROUP_MEMBERS logic aware of it.
It might be a good idea if we want a finer-grained control of
code to build. (One can argue his application uses pthread
but does never _exit. In that case, it might be a waste to maintain
group membership. I suspect it might not be too rare in embedded
world.)

[1] commit 6982eb35fe
2022-10-19 21:32:30 +08:00
YAMAMOTO Takashi
f100a4bb92 Implement fdopendir 2022-10-19 21:20:35 +08:00
Xiang Xiao
e2a18ad339 sched: Support envp argument of task_spawn and nxtask_create
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-19 08:22:56 +09:00
Xiang Xiao
6b31918b42 Remove the unnecessary cast for main_t, NULL and argv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 08:51:45 +02:00
anjiahao
d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Xiang Xiao
6854cce059 sched/spawn: Add the dummy task_spawnattr_xxxstackyyy in the kernel mode
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:13:42 +02:00
Xiang Xiao
78f6a02bc8 boards: Remove the duplicated prototype of CONFIG_INIT_ENTRYPOINT
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:02:44 +02:00
luojun1
ec4af00538 Add Cellular link layer support
1.Add cellular link layer enum definition and register flow
2.Add ioctl flow to set cellular NICs parameters

Signed-off-by: luojun1 <luojun1@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-15 18:34:07 +08:00
zhangyuan21
fc9b5e1980 arch_alarm: adjust oneshot/arch_alarm to support tick 2022-10-12 11:55:46 +08:00
zhangyuan21
750007ded9 sched: use tick count for sched timer expiration 2022-10-12 11:55:46 +08:00
liangchaozhong
cc426f8539 usrsock:add done flag in usrsock_iovec_do
set done to true if all data in iovec array is copied

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-10-11 00:57:49 +08:00
Xiang Xiao
a875e13105 list.h: Add local temp variable to avoid the double evaluation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-06 08:29:39 +02:00
Petro Karashchenko
d247e8d1d2 sched/semaphore: fix priority boost restoration for priority inheritance
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-03 15:14:24 -03:00
Xiang Xiao
6ec74d8d36 bluetooth: Forward ioctl to btuart lowerhalf driver
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-02 18:14:00 -03:00
wangbowen6
e9ccab2db3 fs/poll: using callback mechanism to implement poll notification
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-10-03 00:00:56 +08:00
raiden00pl
0aa0394ca2 include/stdint.h: add sig_atomic_t limits 2022-10-02 22:30:54 +08:00
raiden00pl
d8483a24e8 include/threads.h: return values should be integer type to prevent compiler warnings 2022-10-02 22:30:29 +08:00
zhangyuan21
85d013f69a sched: mqueue wait list optimize 2022-09-28 18:08:37 +08:00
zhangyuan21
838309313e sched: semaphore wait list optimize 2022-09-28 18:08:37 +08:00
Fotis Panagiotopoulos
bbf3f2866d Fixed non-UTF8 characters. 2022-09-28 09:38:55 +08:00
Xiang Xiao
764540267e sched/clock: Rename g_system_timer to g_system_ticks
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-27 17:45:44 -03:00
yinshengkai
ae38e3eb10 sched: Optimize sched_note_begin/end
Optimize sched_note_begin/end, replace note_printf with note_string
sched_note_begin/end optimized from 50us to 1us per consumption

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-09-27 21:32:35 +08:00
Xiang Xiao
40ef5bc6db libc: Move queue.h from include to include/nuttx
to avoid the conflict with libuv's queue.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-26 08:04:58 +02:00
wangbowen6
344c8be049 poll: add poll_notify() api and call it in all drivers
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-26 12:06:32 +08:00
chao an
74842880f9 compiler.h: add MSVC(Microsoft Visual C++)-specific definitions
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-26 04:40:34 +08:00
Xiang Xiao
70290b6e38 arch: Change the linker generated symbols from uint32_t to uint8_t *
and remove the duplicated declaration

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-24 21:26:56 +02:00
zhangyuan21
af72a528f1 sched: merge waitsem and msgwaitq 2022-09-22 16:32:44 +08:00
Xiang Xiao
4c44c6f709 arch.h: Make _sinit/_einit as an offical interface
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-22 08:29:24 +08:00
Xiang Xiao
53466c6d46 net: Add IN6_IS_ADDR_LINKLOCAL macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-21 18:28:40 +08:00
Xiang Xiao
03f45a124a watchdog: Support auto monitor keep alive from oneshot lowerhalf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 22:04:36 +02:00
Xiang Xiao
1eefec4db3 watchdog: Support auto monitor keep alive from timer lowerhalf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 22:04:36 +02:00
Xiang Xiao
db518bf0df fs: Allocate unique serial number for the root pseduo file system node
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:21:06 +08:00
Xiang Xiao
079a6fa6cc arch/armv7[a|r]: Implement up_affinity_irq
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:20:17 +09:00
Xiang Xiao
ef43283c67 arch/arm: Unify arm_cpu_sgi to up_trigger_irq
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:20:17 +09:00
chao an
d5a1576361 net/wireless: add support for netdev private ioctl
Signed-off-by: chao an <anchao@xiaomi.com>
Signed-off-by: caohongwei <caohongwei@xiaomi.com>
2022-09-20 01:16:22 +08:00
chao an
8b238e0b3d net/wireless: separate command catagory of bt/pktradio from wireless ioctl
1. separate command catagory of bt/pktradio from wireless ioctl
2. Remove commoand count limit to support vendor command

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-20 01:16:22 +08:00
ligd
e2df52390a SMP: fix crash when switch to new task which is still running
Situation:

Assume we have 2 cpus, and busy run task0.

CPU0                                CPU1
task0 -> task1                      task2 -> task0
1. remove task0 form runninglist
2. take task1 as new tcb
3. add task0 to blocklist
4. clear spinlock
                                    4.1 remove task2 form runninglist
                                    4.2 take task0 as new tcb
                                    4.3 add task2 to blocklist
                                    4.4 use svc ISR swith to task0
                                    4.5 crash
5. use svc ISR swith to task1

Fix:
Move clear spinlock to the end of svc ISR

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-17 17:37:47 +09:00
田昕
f6ebbe4429 drivers/mtd:init commit of power-loss resilient cfg
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-15 17:46:56 +08:00
liangchaozhong
62cbd72149 remove access on /dev/usrsock in up_usrsock.c
Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-09-10 13:08:22 +08:00
liangchaozhong
644c4afeed usrsock:refine usrsock's architecture
Seperate usrsock device driver with usrsock core function layer
to make it more flexiable to adopt other kind of usrsock interface driver

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-09-09 20:56:12 +09:00
wangbowen6
c754df6411 drivers/mtd: add rpmsg mtd support
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-09 19:27:57 +08:00
wangbowen6
25c2f3e042 driver: move find_mtddriver() to fs.h and add close_mtddriver.c
Rpmsg mtd need a way to find the mtd device according to the
mtd device path.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-09 19:27:57 +08:00
ligd
4bd88acf1b wqueue: fix work_qcancel() judge error caused by the union in struct work_s
in struct work_s:
union
{
  struct
  {
    struct dq_entry_s dq; /* Implements a double linked list */
    clock_t qtime;        /* Time work queued */
  } s;
  struct wdog_s timer;    /* Delay expiry timer */
}

while we use WDOG_ISACTIVE(&work->timer) to decide use dq or timer,
that is error, wd_cancel() maybe modify this area, dq_rem() also can
modify this area.
So we can't use the WDOG_ISACTIVE(&work->timer) to take as the judgement,
when there is a union.

Fix:
swap the order in struct wdog_s, move the arg to the second 32bit

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00
ligd
4a87578bdb wqueue: change single queue to double queue to improve speed
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00