Jukka Laitinen
c79d2067c7
Move timespec calculations from sched into libc/sched
...
Allow using these functions also outside sched, where systick
related calculations are performed
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-04 13:19:01 -05:00
Xiang Xiao
b1879d5d24
sched/vfork: allocate tls_info_s instead task_info_s from stack
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-01 20:53:07 -03:00
Xiang Xiao
aec01e96fa
libc: Remove the empty lib_initialize
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-01 11:03:02 -03:00
Xiang Xiao
86fc19ff3f
Fix error: 'struct tcb_s' has no member named 'low_priority'
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-31 06:30:57 -03:00
anjiahao
0aa14f832d
mq_open: add long file name check and parameter check
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2021-10-21 11:01:45 -03:00
Jiuzhu Dong
7e59a6a31e
cpuload: fix crash because of the member of g_pidhash is NULL
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-18 15:13:52 +02:00
Xiang Xiao
4a7915e72b
sched: Check g_pidhash[hash_ndx] isn't NULL before access pid field in nxsched_get_tcb
...
Fix the regression by commit:
commit 8b67944c75
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Thu Oct 14 11:03:07 2021 +0800
sched: Remove pidhash_s and move ticks to tcb_s
simplify the code logic and reduce memory a little bit
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-17 17:28:57 +09:00
Xiang Xiao
8b67944c75
sched: Remove pidhash_s and move ticks to tcb_s
...
simplify the code logic and reduce memory a little bit
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-16 06:19:17 -03:00
chao.an
13741c9017
sched/pidhash: init g_pidhash to NULL to avoid wild pointer
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-10-16 06:19:17 -03:00
Jiuzhu Dong
9bc913abef
wd_start: use sclock_t type replace int
...
when enable SYSTEM_TIME64, tick may exceed the int32 range
example:
pthread_cond_clockwait
---->clock_abstime2ticks
---->wd_start
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-10 19:59:57 -07:00
chenhonglin
dfc08a0b66
sched/sched/remove_readytorun.c: Fix CPU affinity issues in SMP
...
the logical may choose the head of g_readytorun(the greatest priority)
task as the next while ignoring the cpu affinity of it.
Signed-off-by: chenhonglin <chenhonglin@xiaomi.com>
2021-09-29 16:23:17 +09:00
chenhonglin
cb38060db2
sched/sched_setpriority.c: Fix CPU affinity issues in SMP
...
In "nxsched_nexttcb": the task may not running on this_cpu,
and rtrtcb->affinity(the affinity of the task in g_readytorun)
may not include the current cpu which should be the tcb->cpu.
Signed-off-by: chenhonglin <chenhonglin@xiaomi.com>
2021-09-29 16:23:17 +09:00
Huang Qi
e72680bb46
sched/signal: Correct kill with cancellation
...
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-09-27 18:17:40 -07:00
Abdelatif Guettouche
3b2aea204c
sched/irq/irq_csection.c: Fix typos and correct some comments.
...
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-09-16 10:53:51 -05:00
Abdelatif Guettouche
20d34cce98
sched/irq_section.c: irq_waitlock is a private function; remove its
...
prototype from irq.h and define it as static.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-09-15 06:20:59 +09:00
Michal Lenc
cdfe7b5a54
sched/wdog/wd_start.c: prevent accessing watch-dog lag if head is NULL
...
If statement in line 103 could acces wdactivelist.head->lag when head was
NULL which could result in hard fault. The statement was also redundant
as the same condition is checked in the while loop below. This change
remove the if statement to prevent hard fault to occur.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2021-09-06 09:29:21 -07:00
ligd
35379403f8
sched/wdog: move SMP enter_critical_section to sched_timerexpiration.c
...
Change-Id: Id654e6d2151e3b807ed2df4ab8169b90ab07b015
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-08-27 16:59:20 +09:00
ligd
9116ed9247
sched/wdog: fix switch_context caused error in wd_start()
...
Thead A: Thread B:
wd_start(wdogX)
wd_cancel
nxsched_cancel_timer --> wd_start(wdogX)
wd_cancel
add wdogX to g_wdactivelist
<--
add wdogX to g_wdactivelist
then, you will find wdogX add twice.
Change-Id: Icbf3b2badff20908e115c9134e2400cdcb32b1e0
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-08-27 16:59:20 +09:00
chao.an
904348302a
sched/backtrace: simplify the assign of tcb in case of negative pid
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-20 13:11:45 -03:00
Jiuzhu Dong
35b3898ce1
task_spawn: release g_spawn_parmsem and sched_unlock at the ending
...
Change-Id: Ifcb5b9921e82fc495c4457fdb5f0607f40b07fc0
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-19 20:43:54 -07:00
Masayuki Ishikawa
cb167c3f7d
sched: Allow CONFIG_SMP_NCPUS=1 without CONFIG_DEBUG_FEATURES
...
Summary:
- This commit allows CONFIG_SMP_NCPUS=1 without CONFIG_DEBUG_FEATURES
Impact:
- None
Testing:
- Tested with sim:smp
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-08-19 19:17:56 -07:00
chao.an
1060953567
sched/backtrace: add sched_backtrace support
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-19 01:30:50 -07:00
chao.an
83964231a5
libs/libc: move the backtrace implement to sched
...
1. move the backtrace implement to sched
2. rename CONFIG_UNWINDER to CONFIG_SCHED_BACKTRACE
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-19 01:30:50 -07:00
Abdelatif Guettouche
9859ceb8fd
sched/: Fix some typos.
...
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-08-14 11:19:34 -07:00
Gustavo Henrique Nihei
b145ad82b7
sched: Fix crash on early syslog message with prepended process name
...
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-06 21:09:08 -07:00
Xiang Xiao
5025fbef8d
Rename LIB_ to LIBC_ for all libc Kconfig
...
follow other libc component naming convention
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-05 19:45:24 +02:00
Xiang Xiao
4bb50cdd37
signal: Allow SIG_EVTHREAD selectable in protected mode
...
since we can delivery signal through libs/libc/wqueue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-05 09:52:06 -03:00
Jiuzhu Dong
855c78bb9d
work_queue: schedule the work queue using the timer mechanism
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-27 21:01:38 -07:00
Jiuzhu Dong
a0c3a0923a
sched/wqueue: merge kwork_lpthread.c and kwork_hpthread.c to kwork_thread.c
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-27 21:01:38 -07:00
Jiuzhu Dong
11faf0cb20
fs/inode: add sanity check for inode to avoid nullpointer
...
Change-Id: Ib2c74ba308b8f15756fac4e69632c296243eb4ab
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-25 23:01:37 -07:00
Abdelatif Guettouche
de68507f84
sched/*/*spinlock.c: Fix some typos.
...
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-07-24 09:00:41 -07:00
jordi
b87333bae8
Kconfig: remove empty help sections
...
To avoid the setconfig warning: "has 'help' but empty help text"
2021-07-23 02:32:19 -07:00
SPRESENSE
5db4d2a83b
sched/task: Fix wrong return value from nxspawn_open()
...
nxspawn_open() is expected to return "OK" when it success, but
it doesn't return it in case of executing dup2.
Because of this, the "Command as parameter" couldn't work with
Builtin Apps.
2021-07-20 09:26:01 -03:00
Nathan Hartman
af1fd49fb0
wqueue: Fix typos
...
include/nuttx/wqueue.h:
libs/libc/wqueue/work_cancel.c:
libs/libc/wqueue/work_queue.c:
sched/wqueue/kwork_cancel.c:
sched/wqueue/kwork_queue.c:
* Fix spelling, grammar, and typos.
* Improve wording in a few areas.
* These changes affect comments only. No functional changes.
2021-07-16 19:54:08 -03:00
Jiuzhu Dong
9e4352ad64
group/child_status: Dynamically expand group child_status
...
Change-Id: I4033e93b6adceb01eebe1c2a12ffe8737042b1a6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-15 20:14:57 -07:00
Xiang Xiao
cee43ce280
arch/sim: Initialize the idle thread stack info correctly
...
and change the default value of IDLETHREAD_STACKSIZE to 65536
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia54efbbca4b69706150bc4178844b316688a104e
2021-07-16 08:37:53 +09:00
Xiang Xiao
a5ac4463c2
sched/init: initialize all idle thread's tl_task
...
since this patch forget to initialize the idle tls info:
commit 50c08bf45b
Author: Huang Qi <huangqi3@xiaomi.com>
Date: Tue Jun 29 16:01:02 2021 +0800
libc: Move pthread_key_destructor to task_info_s
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: If7d0c0118323fa3dcf44081d675cd57b14eba75a
2021-07-16 08:37:53 +09:00
Xiang Xiao
bd74dc2b88
sched/init: Remove the unnessary CONFIG_SMP check
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2afaf310b411993e37140b3d7977968a7fda5c3b
2021-07-16 08:37:53 +09:00
Xiang Xiao
0148e1d501
fs: Support the root file system attributes(mode, uid, gid and time)
...
Note: all attributes is guarded by PSEUDOFS_ATTRIBUTES to save the space
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I664d60382e356068fd920f08aca5b4a49d8d92a9
2021-07-14 10:35:15 -03:00
Jiuzhu Dong
9b1f554429
sched: Dynamically extend the pid hash table
...
Change-Id: I3a719bc575cd408cd530a39efa203f507b44fa9c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-11 19:42:30 -07:00
Jiuzhu Dong
bb867a38fc
nx_start: Simplify and unify the partial initialization process
...
for both SMP and non-SMP
Change-Id: I0fea8b4f59fc27d253a2ef9b7503acbb7410cc14
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-11 19:42:30 -07:00
Peter Bee
8a47dd95c9
sched/clock: add nsec range check in clock_settime
...
MIRTOS-109
Return error when tv_nsec <0 or >=1000 million.
Change-Id: Iddbbcda163cb402551f619efb7486f6798859d57
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2021-07-09 14:19:03 -03:00
Huang Qi
50c08bf45b
libc: Move pthread_key_destructor to task_info_s
...
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-04 07:36:44 -05:00
ligd
ece224a7e3
sched/waitpid: handle waitpid waitting tcb->group is NULL
...
Fail case:
exit -> nxtask_terminate -> nxtask_exithook -> nxsched_release_tcb
group_leave || nxsched_releasepid & group_leave
/\
/ \
switch out & waitpid()
Thread A group_leave in nxtask_exithook, switch out,
Thread B do waitpid(thread A) then meet traget thread A group is NULL, error.
Change-Id: Ia181d7a13aa645ec1c3141a45839fbf79db35b17
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-04 06:23:59 -05:00
ligd
8d2615f78d
sched: add STACK_USAGE_SAFE_PERCENT for stack overflow check
...
Change-Id: Ia70e243b36401e28c31fcd7e1b480b79374c27ef
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-03 12:56:40 -05:00
ligd
940c80f7b3
sched: fix stack check crash in idle thread
...
Change-Id: Iea7c096ffcab181f318edcc1bfe1717785831b7a
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-03 12:56:40 -05:00
ligd
68d66148ad
mm: idle check heap use mm_trysemaphore
...
Change-Id: I92e1df572fa6cd801b10e5b06e7b04d450b3e3fb
Signed-off-by: ligd <liguiding1@xiaomi.com>
(cherry picked from commit bc9a5d1ca9656f6effd3a419cc2488586dfb1489)
2021-07-03 12:56:40 -05:00
ligd
646b229f74
sched/init/nx_start.c: enter_critical_section when check heap & stack in idle
...
Change-Id: I2ef95ee8e1dc1ba3e74c1d6c8c6af20f53be85c7
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-03 12:56:40 -05:00
ligd
a96cab58ad
sched: add depends on ARCH_INTERRUPTSTACK to SMP
...
Change-Id: I7edbbcf314045c5567e30b39b0693672e5d10e9a
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-03 07:02:33 -05:00
Huang Qi
65fa11634b
sched: Refine tls_info_s and task_info_s
...
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-02 10:33:34 -05:00