Commit Graph

256 Commits

Author SHA1 Message Date
ligd
0bb32f27c0 init: use exec_spawn instead of exec
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-24 08:23:30 -06:00
ligd
10ccba6671 init: move USERMAIN_XX out of INIT_ENTRYPOINT
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-24 08:23:30 -06:00
Juha Niskanen
422ceec99b Fix typos in comments and Kconfig files
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2021-12-21 03:26:16 -06:00
zhanghu6
d05b9a9c79 note dump: add CONFIG_SCHED_INSTRUMENTATION_SWITCH
1. If CONFIG_SCHED_INSTRUMENTATION_SWITCH is enabled, then these additional interfaces are expected:
        sched_note_suspend
        sched_note_resume
at the same time,If CONFIG_SMP is enabled,then expected:
        sched_note_cpu_pause
        sched_note_cpu_paused
        sched_note_cpu_resume
        sched_note_cpu_resumed
2. other board if enable SCHED_INSTRUMENTATION,SCHED_INSTRUMENTATION_SWITCH to defconfig.
2021-12-15 07:07:00 -06:00
zhanghu6
a32d14cb9c sched note trace: and note dump
note_type NOTE_DUMP_STRING API:
sched_note_string
sched_note_vprintf
sched_note_printf

note_type NOTE_DUMP_BINARY API:
sched_note_dump
sched_note_vbprintf
sched_note_bprintf
2021-12-13 21:21:22 -06:00
Jiuzhu Dong
6b5a7a73ba sim: add CONFIG_SIM_STACKSIZE_ADJUSTMENT to reduce variability
between sim and other different platform stack size setting

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-12-13 21:15:30 -06:00
Huang Qi
58e0781e2e arch/arm: Implement TLS support
Signed-off-by: Huang Qi <no1wudi@qq.com>
2021-12-07 23:31:41 -06:00
Abdelatif Guettouche
9b1d4de3be drivers/note: Fix typos.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-11-12 16:50:41 -03:00
Xiang Xiao
e57203eca4 sched: Disable message queue by default when DEFAULT_SMALL equals y
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-10 09:16:35 +01:00
Xiang Xiao
086b09cc84 sched: Reduce the default preallocated buffer when DEFAULT_SMALL=y
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-09 13:09:40 +01: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
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
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
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
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
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
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
ligd
adfaa140cc sched: add CONFIG_SCHED_CRITMONITOR_XX for debugging system lantency
Change-Id: Id2a75db28caf1a89552e33391bd90f85cde08dbd
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-02 08:25:02 -05:00
Nathan Hartman
a8cbcd084f signal: Fix docs and comments related to SIGWORK and its config
Documentation/reference/os/wqueue.rst:

    * CONFIG_SIG_SIGWORK: Fix sentence that was cut off in the
      middle.

include/signal.h:

    * SIGWORK: Fix grammar in comment.

sched/Kconfig:

    * config SIG_SIGWORK: Fix ---help--- text to indicate that
      this user-configured signal number may be used by various
      internal worker threads.
2021-06-30 21:22:49 -05:00
Abdelatif Guettouche
af5e0c620f Rename MODULE_TEXT to TEXT_HEAP as the latter is more generic.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-06-18 07:14:17 -05:00
Masayuki Ishikawa
1a9e7efde5 smp: Remove CONFIG_SMP_IDLETHREAD_STACKSIZE
Summary:
- The CONFIG_SMP_IDLETHREAD_STACKSIZE was introduced to optimize
  the idle stack size for other than CPU0
- However, there are no big differences between the idle stacks.
- This commit removes the config to simplify the kernel code

Impact:
- All SMP configurations

Testing:
- Tested with ostest with the following configs
- spresense:smp, spresense:rndis_smp
- esp32-devkitc:smp (QEMU), maix-bit:smp (QEMU)
- sabre-6quad:smp (QEMU), sabre-6quad:netnsh_smp (QEMU)
- raspberrypi-pico:smp, sim:smp (x86_64)

Signed-off-by: Masayuki Ishikawa <asayuki.Ishikawa@jp.sony.com>
2021-04-19 21:46:39 -05:00
Alan C. Assis
c172ced3ba sched: Move the default Task Stack size to Stack menu 2021-03-31 02:29:04 -05:00
Jiuzhu Dong
e96c8b9283 fs: allocate file/socket dynamically
Change-Id: I8aea63eaf0275f47f21fc8d5482b51ffecd5c906
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-17 06:46:42 -07:00
Gustavo Henrique Nihei
76acb32e29 Fix typos reported by codespell 2021-02-25 11:31:49 -08:00
Masayuki Ishikawa
ad2e85433a boards, include, sched: Remove CONFIG_SPINLOCK_IRQ
Summary:
- This commit removes CONFIG_SPINLOCK_IRQ to avoid complexity

Impact:
- None

Testing:
- Tested with the following configs
- spresense:wifi, spresense:smp
- esp32-devkitc:smp (QEMU), sabre-6quad:smp (QEMU)
- maix-bit:smp (QEMU), sim:smp
- stm32f4discovery:wifi
2021-02-05 22:50:04 -08:00
chao.an
1241f910ce arch/spinlock: implement the default test-and-set semantics
use the default testset implement on single core platform
that does not support test-and-set, more flexibility for
SMP drivers(using spinlock) if configured in a single-core mode.

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-01 15:03:55 -06:00
Nathan Hartman
93b9ad0237 sched/Kconfig: Minor grammar fixes in help text
sched/Kconfig:

    * SCHED_CRITMONITOR, SCHED_CPULOAD: Minor grammar fixes in help
      text.
2020-12-21 20:04:45 -06:00
Xiang Xiao
deef880dae sched/signal: Make the pre-allocated irq actions configurable
the action can't be dynamically allocated in any irq handler
so it's important to let the user extend the number as needed

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id30c5d93003e63514c24f2ca0df2f634c4c63c5f
2020-12-20 19:31:59 +01:00
Xiang Xiao
c079760777 sched/mqueue: Make the pre-allocated irq messages configurable
the message can't be dynamically allocated in any irq handler
so it's important to let the user extend the number as needed

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia26584c3815bac6cf24de4c88be0844ac8e8fba2
2020-12-20 19:31:59 +01:00
ligd
2dfd7a4e8f signal.h: fix compile failed when open TTY_SIGINT
In file included from string/lib_strsignal.c:40:0:
string/lib_strsignal.c: In function ‘strsignal’:
string/lib_strsignal.c:142:12: error: ‘CONFIG_SIG_STOP’ undeclared (first use in this function); did you mean ‘CONFIG_SIG_PIPE’?
       case SIGSTOP:
            ^
string/lib_strsignal.c:142:12: note: each undeclared identifier is reported only once for each function it appears in
string/lib_strsignal.c:147:12: error: ‘CONFIG_SIG_STP’ undeclared (first use in this function); did you mean ‘CONFIG_SIG_STOP’?
       case SIGSTP:

Esnure all standard signal number is always defined

Change-Id: I3abce86079ebeba7bab038d7c770efc90b9cffd7
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-11-05 08:28:53 +01:00
Yoshinori Sugino
c13f869432 Modify SIGSTP to SIGTSTP
Follow the POSIX description.
SIGTSTP should be sent when the Ctrl-Z characters is encountered, not SIGSTP.

Testing:
Built with hifive1-revb:nsh (CONFIG_SERIAL_TERMIOS=y, CONFIG_SIG_DEFAULT=y and CONFIG_TTY_SIGTSTP=y)
2020-10-29 01:12:43 -07:00
YAMAMOTO Takashi
6a2bd9a75b Change the default value of SIGPIPE
To avoid the conflicting default with SIGQUIT.
2020-10-25 20:35:41 -07:00
Nakamura, Yuuichi
d8d19911ef Add SCHED_INSTRUMENTATION_HIRES support 2020-10-21 00:33:10 +08:00
Nakamura, Yuuichi
87a7c0317e Add note_syscall args support 2020-10-21 00:31:51 +08:00
Nakamura, Yuuichi
89ea234af8 Add on-boot instrumentation support for note filter 2020-10-06 03:26:46 +08:00
Nakamura, Yuuichi
6b54377476 Add note filter functions 2020-10-06 03:26:46 +08:00
Xiang Xiao
539a0338dd sched: Refine the comment for SCHED_INSTRUMENTATION_EXTERNAL
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-14 13:43:42 -07:00
Xiang Xiao
b0797263ca libc/stdio: Allocate file_struct dynamically
1.Reduce the default size of task_group_s(~512B each task)
2.Scale better between simple and complex application

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia872137504fddcf64d89c48d6f0593d76d582710
2020-09-11 17:58:17 +08:00
ligd
f428160dcc signal: add SIGQUIT & SIGTERM support
SIGQUIT SIGTERM are equal with SIGINT now

Change-Id: Iefc084d58db28003dc40a17f1ff3fbd7a0b716ed
2020-09-11 10:41:24 +08:00
David Sidrane
1c488eb864 sched_note:Allow for external endpoints - spelling 2020-09-10 10:01:36 -06:00
David Sidrane
80405e15dd sched_note:Allow for external endpoints 2020-09-10 22:06:32 +08:00
Xiang Xiao
952af92690 sched/note: Move the circle buffer code to driver
so the format code can be shared by different transport

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-07 11:54:10 +08:00
Masayuki Ishikawa
08c4376606 arch, include, sched : Refactor ARCH_GLOBAL_IRQDISABLE related code
Summary:
- ARCH_GLOBAL_IRQDISABLE was initially introduced for LC823450 SMP
- At that time, i.MX6 (quad Cortex-A9) did not use this config
- However, this option is now used for all CPUs which support SMP
- So it's good timing for refactoring the code

Impact:
- Should have no impact because the logic is the same for SMP

Testing:
- Tested with board: spresense:smp, spresense:wifi_smp
- Tested with qemu: esp32-core:smp, maix-bit:smp, sabre-6quad:smp
- Build only: lc823450-xgevk:rndis, sam4cmp-db:nsh

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-09-03 10:20:20 +08:00
Xiang Xiao
d43bf7717e sched: Support config the argument passed to init
it is useful to pass the nonempty argument to change the init task behaviour

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I684e9c76b9eac54404d0e4e63ab78e51e039c9a8
2020-08-17 12:52:28 -06:00
Xiang Xiao
acca9fcc3b sched/wdog: Remove MAX_WDOGPARMS and related stuff
since the variable arguments are error prone and seldom used.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-14 08:19:50 -06:00
Xiang Xiao
a0ce81d659 sched/wdog: Don't dynamically allocate wdog_s
to save the preserved space(1KB) and also avoid the heap overhead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I694073f68e1bd63960cedeea1ddec441437be025
2020-08-11 12:28:55 -06:00
Xiang Xiao
154852acb5 sched/mqueue: Reduce the initial memory consumption
Change the preallocated message and descriptor from 32/24 to 4.
The total size is reduce from 1892 to 532

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I79d199465daef678986868f773876289859f42fc
2020-08-10 08:07:50 +02:00
Xiang Xiao
e1d3627bb1 sched/wdog: Change the default value of MAX_WDOGPARMS from 4 to 2
since the maximum number of argument pass to wd_start in the whole
code base is 2 and change CONFIG_MAX_WDOGPARMS in some defconfig
from 1 to 2 oherwise pthread_condclockwait will fail

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib6cb28b8c0722058849e7be916e164513431d21c
2020-08-06 10:36:22 -06:00
Nakamura, Yuuichi
02718f0827 Syscall instrumentation build system support for Arm and RISC-V 2020-07-22 12:01:40 -05:00