Commit Graph

1283 Commits

Author SHA1 Message Date
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
EunBong Song
5951bcd837 Change ordering of round-robin time slice check (sched_process_scheduler()) and processing of wdog timers (wd_timer()). wd_timer()'s callback function can change current running task and, hence, must be done after the time slice check.
The time slice check will decrement the currently running task's time slice allotment.  If such a context switch occurs, then the newly started task will lost one could of that allotment before it even has a chance to run.
2018-04-13 07:38:15 -06:00
Masayuki Ishikawa
97ca4ef956 Merged in masayuki2009/nuttx.nuttx/change_copyright (pull request #621)
Change all Sony related copyright to conform with our company's internal rules.

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

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-04-04 12:35:47 +00:00
Masayuki Ishikawa
1d958980bd Merged in masayuki2009/nuttx.nuttx/fix_smp_bugs (pull request #615)
Fix SMP related bugs

* sched/sched: Fix a deadlock in SMP mode

    Two months ago, I introduced sched_tasklist_lock() and
    sched_tasklist_unlock() to protect tasklists in SMP mode.
    Actually, this change works pretty well for HTTP audio
    streaming aging test with lc823450-xgevk.

    However, I found a deadlock in the scheduler when I tried
    similar aging tests with DVFS autonomous mode where CPU
    clock speed changed based on cpu load. In this case, call
    sequences were as follows;

    cpu1: sched_unlock()->sched_mergepending()->sched_addreadytorun()->up_cpu_pause()
    cpu0: sched_lock()->sched_mergepending()

    To avoid this deadlock, I added sched_tasklist_unlock() when calling
    up_cpu_pause() and sched_addreadytorun(). Also, added
    sched_tasklist_lock() after the call.

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

* libc: Add critical section in lib_filesem.c for SMP

    To set my_pid into fs_folder atomically in SMP mode,
    critical section API must be used.

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

* mm: Add critical section in mm_sem.c for SMP

    To set my_pid into mm_folder atomically in SMP mode,
    critical section API must be used.

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

* net: Add critical section in net_lock.c for SMP

    To set my pid (me) into fs_folder atomically in SMP mode,
    critical section API must be used.

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

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-03-20 12:34:38 +00:00
Gregory Nutt
90c6d71503 Update some comments. 2018-03-16 09:34:09 -06:00
Gregory Nutt
06e7533bb0 Update some comments. 2018-03-14 08:17:50 -06:00
Gregory Nutt
149f3bd471 Standardization of some function headers. 2018-03-13 09:56:16 -06:00
Gregory Nutt
b54ffe858a Standardization of some function headers. 2018-03-13 09:52:27 -06:00
Gregory Nutt
e6e7dae05b sched/clock: Fix a recently introduced name collision 2018-03-12 13:36:06 -06:00
Gregory Nutt
02df81bc5f Squashed commit of the following:
drivers/lcd:  Add an IOcTL to FT80x driver to write to FIFO CMD RAM.
2018-02-20 15:24:52 -06:00
Masayuki Ishikawa
7062ca2c03 Merged in masayuki2009/nuttx.nuttx/lc823450_smp_test (pull request #601)
lc823450 smp test

* sched/clock: Replace critical section APIs with spin lock APIs in clock_gettime.c

    This change will improve performance for SMP systems but nothing
    changes for non-SMP systems. (Pls see include/nuttx/irq.h)

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

* sched/sched: Remove unnecessary DEBUGASSERT in sched_removereadytorun.c

    In SMP mode, rtrtcb is not always at the g_readytorun.head.
    This change removes DEBUGASSERT() to avoid this condition.

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

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-02-15 14:18:25 +00:00
Gregory Nutt
3ddea73dc1 arch/arm/src/armv7-a: Port the SMP change by Masayuki Ishikawa to the ARMv7-A family. 2018-02-14 08:36:34 -06:00
Gregory Nutt
d7fae340c1 Trivial changes from review of last PR. 2018-02-14 08:20:40 -06:00