Commit Graph

1295 Commits

Author SHA1 Message Date
Gregory Nutt d24f58c790 sched/group/group_killchildren.c: In some circumstances, group_killchildren() could have called pthread_cancel() to kill a task. Also, the behavior would not be as expected if a pthread had cancellation disabled. sched/signal/sig_default.c: Correct signal handling in the multiple threaded case. The SIGKILL signal may actually be processed on a pthread, not the main thread of the task. 2018-08-29 07:33:28 -06:00
Gregory Nutt 73c73af777 sched/irq/irq_dispatch.c: Fix my typo that was added while reviewing Xiang's changne. 2018-08-29 07:13:26 -06:00
Xiang Xiao 19bde835e2 sched/signal/sig_default.c: Fix warnings about implicit declaration of 'this_task' and 'group_killchildren' 2018-08-29 06:10:52 -06:00
Xiang Xiao 347d10497c sched/irq/irq_dispatch.c: Fix error 'ndx undeclared' 2018-08-29 06:10:52 -06:00
Gregory Nutt dcb3d4b050 sched/signal: Add logic and an interface to determin if a signal can be caught or ignored. sigaction now correctly returns EINVAL on any attempt to catch or ignore such signals (only SIGKILL for now and only if CONFIG_SIG_DEFAULT=y). 2018-08-28 12:39:03 -06:00
Gregory Nutt 0756cf66ed sched/signal: Add support for SIGINT in addition to SIGKILL. drivers/serial: Use SIGINT instead of SIGKILL when control-C is pressed. 2018-08-28 12:15:31 -06:00
Gregory Nutt 5a51702ef2 sched/signal/sig_default.c: Correct an error in signal number usage. Add critical sections (not sure if that is necessary). Update some comments. 2018-08-27 22:32:57 -06:00
Gregory Nutt 499b89feed sched/signal: Default Signal Actions. Change some types to superficially simplify. Add configuration options to enabled default signal behaviors on a per-signal basis. I don't think users are prepared for SIGALRM to terminate the task (which is the correct default behavior if you don't change it). Extend the implementation of default signals so that it is totally table driven and extensible by simply mondifying the content of const tables. 2018-08-27 15:37:43 -06:00
Gregory Nutt 6d094e4b33 sched/signals: Update the signal default action logic to support sigaction(). signaction() must be able to handle and input action of SIG_DFL to setup the default signal action; it mast also return SIG_DFL it is replacing the default action. 2018-08-27 13:13:23 -06:00
Gregory Nutt c0d234a474 Squashed commit of the following:
drivers/serial/Kconfig:  It is no longer necessary to restrict Ctrl-C handling to the FLAT build

    sched/signal:  Add a new configuration option to select signal default actions, separate handling of signal default actions from both task startup logic and from the serial TTY Ctrl-C logic.  Add a signal set in the group structure to keep track of what signals have been set to the default action.  In dispatching signals in PROTECTED or KERNEL mode, use this signal set to determine if the default signal handler is attached and dispatch the signal in kernel mode for the default actions.
2018-08-27 11:40:09 -06:00
Xiang Xiao 71ad1993f2 Move clock_timespec_[add|subtract] to include/nuttx/clock.h 2018-08-27 06:04:04 -06:00
ligd 11f8dc735c Squashed commit of the following:
drivers/serial:  Add Ctrl-C/Ctrl-X support.  This is an initial working implementation that still requires that several details be resolved.

    sched/task/task_start.c: Add default signal action to SIGKILL.
2018-08-26 08:49:08 -06:00
xuanlin 7e63b0b288 sched/wqueue, libs/libc/wqueue, configs: Remove work queue polling delay to simplify the code logic and save the power. 2018-08-25 14:58:07 -06:00
ligd 631071cded Squashed commit of the following:
sched/wqueue:  Modify high priority work queue to support multiple threads.

    sched/wqueue and libs/libc/wqueue:  workqueues don't need set global data to zero since .bss is cleared automatically.  Removing this unnecessary initialization also avoids the loss the work items queued before initialization.
2018-08-25 14:52:13 -06:00
Xiang Xiao c9b24615a6 sched/irq: Monitor the irq execution time. This is very useful for measuring the interrupt latency. 2018-08-25 07:12:21 -06:00
Gregory Nutt 3931eaf015 sched/Kconfig: Fix a warning found in build testing. 2018-08-24 16:14:21 -06:00
Gregory Nutt 38452007a3 sched/irq/irq_dispatch.c: Fix an error found in build testing. 2018-08-24 16:12:31 -06:00
Xiang Xiao 2aa208ccf0 sched/irq/irq_procfs.c: Fix occasional computation error when fracpart >= 1000 2018-08-24 15:16:11 -06:00
zhuguangqing d38be46655 sched/irq: Add support interrupt chains in NuttX. IRQ chain is very useful in these cases: (1) Multiple hardware connect to the same request line(e.g. PCI), (2) Need multiple driver to support one hardware block (like Linux MFD) 2018-08-24 15:10:23 -06:00
Xiang Xiao 6cb606d42b sched/irq/irq_dispatch.c: Ensure vector never points to NULL since interrupt may happen before irq_initialize() 2018-08-24 15:01:32 -06:00
Xiang Xiao 3af35699b9 include/nuttx/clock.h, sched/sched: Support the CPU load measurement using timer_lowerhalf_s interface 2018-08-24 10:10:57 -06:00
Xiang Xiao 430bf16f1e Squashed commit of the following:
include/nuttx/arch.h:  Add prototype for an architecture-specific up_trigger_irq function
    arch/, include/nuttx, sched/sched:  Add the garbage collection hook so each architecture can do custom memory cleanup if necesary.
    arch/Kconfig:  Add configureation CONFIG_ARCH_GNU_NO_WEAKFUNCTIONS to suppress use of weak functions.  Some gnu derived toolchains do not support weak symbols
2018-08-24 08:30:01 -06:00
Xiang Xiao 36b46a6a40 arch/ and task/sched: vfork operation needs to allocate and copy the task argument too. Also correction of the address correction cannot depend on the stack pointer since it is not available in all architectures. Rather callculate the offset from the stack allocation pointer 2018-08-24 07:43:00 -06:00
Xiang Xiao e1202d2ed3 Replace all ASSERT with DEBUGASSERT to save the code space 2018-08-24 06:58:30 -06:00
Xiang Xiao 467d2a58ea Replace non critical PANIC with DEBUGPANIC to save the code space 2018-08-24 06:21:15 -06:00
anchao 95163b2c59 Squashed commit of the following:
Author: Xiang Xiao <xiaoxiang@xiaomi.com>

     arch/arm/src/armv7-m:  Implement SYSTICK timer driver

   Author: anchao <anchao@pinecone.net>

     configs/sim/loadable:  Add loadable demo for arch sim
     sched/init: Restore previously reverted option to mount block device for INIT_FILEPATH case
     configs/stm3240g-eval/knxwm: Fix build breakage.

   Author: Gregory Nutt <gnutt@nuttx.org>
     configs:  With recent changes to apps/ all configurations that build applications as modules must now also select CONFIG_APPS_LOADABLE.

   Author: anchao <anchao@pinecone.net>
      configs/sim/loadable:  Add loadable demo for arch sim
       Kconfig and tools/Makefile.unix and : add dynamic application loadable support
2018-08-23 11:08:22 -06:00
xuanlin 2c93467436 pthreads: Add support static pthread stack. Add standard pthread_attr_setstack() and pthread_attr_getstack(). In all cases where the stack is released, add check to see which allocator must be used to free the stack: The user or the kernel allocator. 2018-08-23 09:49:20 -06:00
Xiang Xiao 377eb30129 binfmt: Add binfmt_initialize(). All binary formats are now registered centrally vs. in board-specific logic. This simplifies the usage of the binfmt subsystem. 2018-08-23 09:09:39 -06:00
Gregory Nutt b56d5a7548 Revert "sched/init: Add option to mount block device for INIT_FILEPATH case"
This reverts commit e5f9b7d66b.
2018-08-22 07:29:55 -06:00
Xiang Xiao e5f9b7d66b sched/init: Add option to mount block device for INIT_FILEPATH case 2018-08-22 06:57:00 -06:00
anchao 0124b629a9 sched/symtab: Reference default symtab name to binfmt 2018-08-22 06:21:20 -06:00
Gregory Nutt 8e203e09d4 Costmetic changes 2018-08-19 11:19:43 -06:00
Gregory Nutt 5a23ca37b1 Cosmetic update to comments. 2018-08-17 14:23:38 -06:00
Gregory Nutt 8c61c2f31b Remove trailing spaces at the end of lines. 2018-08-13 07:39:38 -06:00
Gregory Nutt 25fa50d504 fs/proc and sched/environ: Add support for a procfs entry that will permit examining the environment of any task. 2018-08-10 10:16:39 -06:00
Gregory Nutt 3973640fff Update some comments. Remove references to non-existent CONFIG_MAX_TASK_ARG. 2018-08-08 17:06:46 -06:00
Gregory Nutt a2428db499 configs/olimex-stm32_p407: Add logic to support initialization of the kernel module symbol table installed in the pass2/ directory during the application phase of the build. The kmodule configuration appears to be fully functional. 2018-08-07 10:50:25 -06:00
Masayuki Ishikawa 651f5e2622 Merged in masayuki2009/nuttx.nuttx/fix_loadable_elf_with_smp (pull request #706)
sched/group: Fix a deadlock when loading an ELF

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: GregoryN <gnutt@nuttx.org>
2018-08-06 03:36:14 +00:00
Gregory Nutt c6adc4ba8e sched/pthread/pthread_initialize.c: Fix a warning found in build testing (that is actually and bug and would cause an incorrect value to be returned in many cases. 2018-08-05 16:23:07 -06:00
Gregory Nutt c2267a57a0 Kconfig files: Fix several errors noted by Alex Denisov in Bitbucket issue 115. 2018-08-05 10:48:02 -06:00
Gregory Nutt 4fa546c5d8 Refresh a configuration: Fix an assertion that was messed up in the previous commit. 2018-08-05 08:41:32 -06:00
Gregory Nutt 20a86dfc1b binfmt/ and sched/group: Re-architect the way that loadable ELF or NXFLAT modules are unloaded. Memory resources must be recovered when the task loaded into memory exits. The originmal implementatino used the death-of-child SIGCHLD signal to perform the unload. There are several problems with this: It is overly complex, it requires that the parent task stay resident while the loaded task runs, and it has fatal logic flaws in the protected and kernel model builds because the user signal handler attempts to run in the kernel address space. This commit corrects with using a mindlessly simply BINFMT callback when the task exits. 2018-08-05 08:09:54 -06:00
Simon Liedl 6fe770bb21 Merged in sliedl/nuttx (pull request #700)
sched/mqueue/mq_notify.c: Fix - only part of struct copied to internal structure

As source adress the adress of the struct member sigev_value was used,
and it is not located the start of the struct.
This leads to invalid data being copied to internal structure.
Both source and destination should be of type struct sigevent* .

Approved-by: GregoryN <gnutt@nuttx.org>
2018-07-30 12:50:04 +00:00
Gregory Nutt 4c67062457 Squashed commit of the following:
binfmt/, libs/libc/unistd, and others:  Rename CONFIG_EXECFUNCS_SYMTAB to CONFIG_EXECFUNCS_SYMTAB_ARRAY.  Rename CONFIG_EXECFUNCS_NSYMBOLS to CONFIG_EXECFUNCS_NSYMBOLS_VAR.  Unlike CONFIG_EXECFUNCS_NSYMBOLS, CONFIG_EXECFUNCS_NSYMBOLS_VAR holds the name of an 'int' variable that contains the number of symbols in the symbol table.

    configs/sama5d4-ek:  Partial update to knsh build instructions.
2018-07-15 11:20:37 -06:00
Alan Carvalho de Assis 283b73edc5 Fix lots of typos in C comments and Kconfig help text 2018-07-08 18:24:45 -06:00
Gregory Nutt 8fca244f36 syscall: clock_systimer() is no longer a system call. It has been replaced with the equivalent, standard interface clock() as the system call.
sched/clock:  Move the implementation of clock() from libs/libc/time to sched/clock.  This is necessary because it calls the (now) internal OS function clock_systimer.  clock() is now accessed only via a system call in certain configuratins.
libs/libc/wqueue:  Replace calls to clock_systimer() with calls to the equivalent clock().
2018-06-16 12:50:28 -06:00
Gregory Nutt 8fdbb1e0a4 Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
Squashed commit of the following:

    sched:  Rename all use of system_t to clock_t.
    syscall:  Rename all use of system_t to clock_t.
    net:  Rename all use of system_t to clock_t.
    libs:  Rename all use of system_t to clock_t.
    fs:  Rename all use of system_t to clock_t.
    drivers:  Rename all use of system_t to clock_t.
    arch:  Rename all use of system_t to clock_t.
    include:  Remove definition of systime_t; rename all use of system_t to clock_t.
2018-06-16 12:16:13 -06:00
Gregory Nutt 450e0809de sched/Kconfig: Add a dependency 2018-06-16 11:36:27 -06:00
Gregory Nutt a6a88198c0 sched/modules: Be consistent use of binary loader debug instrumentation. Was mixed system and binary loader debug. libs/libc/modlib: Switch from systemb to binary load debug to be consistent with sched/modules. 2018-06-01 10:10:17 -06:00
Alan Carvalho de Assis f3d940aac5 sched/module/mod_modhandle.c: Fix typo in debug statement. 2018-06-01 08:54:37 -06:00