Commit Graph

1410 Commits

Author SHA1 Message Date
Joao Matos 08ff68edec sched/pthread: Added non-standard pthread_get_stackaddr_np() and pthread_get_stacksize_np(). 2019-04-04 10:30:46 -06:00
Gregory Nutt 842d3dc4e5 Rename sched_alarm_expiration to nxsched_alarm_expiration. That is the appropriate name for an internal sched/ function (still many named incorrectly). 2019-03-20 19:34:23 -06:00
Gregory Nutt 9acb652e29 Rename sched_timer_expiration to nxsched_timer_expiration. That is the appropriate name for an internal sched/ function (still many named incorrectly). 2019-03-20 19:31:43 -06:00
Gregory Nutt b290160b3b Rename sched_process_timer to nxsched_process_timer. That is the appropriate name for an internal sched/ function (still many named incorrectly). 2019-03-20 19:27:40 -06:00
Gregory Nutt f6ac82e246 Backs out part of commit d7a602e9b2. When CONFIG_SCHED_CPULOAD_EXTCLK is defined, the prototype must still be available in nuttx/arch.h 2019-03-20 19:17:30 -06:00
Valmantas Paliksa d7a602e9b2 sched/sched and include/nuttx/arch.h: Rename sched_process_cpuload to nxsched_process_cpuload. All internal sched_ functions should be prefixed with nx. Remove duplicate prototype from nuttx/arch.h. 2019-03-20 08:01:27 -06:00
Gregory Nutt 622202da20 binfmt/nxflat.c: Update to last NxFLAT change: The logic must respect the reference count before freeing the dspace memory region. 2019-03-12 09:44:18 -06:00
Gregory Nutt f6b9fe5b14 tools/nxstyle.c: Add logic to detect a blank line following a left brace or a blank line preceding a right brace. 2019-03-10 09:53:33 -06:00
Gregory Nutt c8004c7e00 tools/nxstyle.c: Add capability to detect CamelCase identifiers. 2019-03-05 13:08:57 -06:00
Gregory Nutt 5fe6981c9a Squashed commit of the following:
libs/libc/pthread/pthread_spinlock.c:  Resolve several TODO issues by accessing up_testset() via the boardctl() interface rather than attempting to call it directly.

    configs/boardctl.c, include/sys/boardctl.h:  Add access to architecture-specific up_testset() via boardctl().

    arch/Kconfig's, sched/Kconfig, and include/nuttx/spinlock.h:  Spinlocks are not available unless the architecture supports the up_testset() operation.
2019-03-04 14:22:50 -06:00
Gregory Nutt f914ec6e2b tools/nxstyle.c: Fix logic that detects if an operator is correctly delimited with spaces. sched/: Various changes because sched/ C files were used as Guinea Pigs to test nstyle.c. 2019-03-01 10:50:02 -06:00
Gregory Nutt 3c0f6f4876 arch/xtensa/src/esp32/esp32_serial.c: Fix some backward arguments. Correct 2-stop bit setting.
sched/sched/sched_waitid.c:  Could exit without leaving critical section on some error conditions.
sched/signal/sig_deliver.c: Update some comments.
2019-02-28 11:32:31 -06:00
Gregory Nutt 0951151c33 libs/libc/pthread, syscall/, and include/sys/syscall.h: Support for pthread_mutex_timedlock() was added recently, however no new system call was added for the API make is usable only in the FLAT build. With a pthread_mutex_timedlock() system call, there is no reason for a pthread_mutex_lock() system call since it is now nothing more than an wrapper around pthread_mutex_timedlock(), passing NULL for the time value. The pthread_mutex_lock() syscall was removed and the pthread_mutex_lock() implemented was moved from /sched/pthread to where it now belows in libs/libc/pthread. 2019-02-25 18:19:13 -06:00
Gregory Nutt 9a5134acac sched/pthread/pthread_mutexlock.c: Fix an error in last PR. The abs_timeout value as not being passed from pthread_mutex_timedlock() to pthread_mutex_take(). 2019-02-24 16:04:48 -06:00
Gregory Nutt c7cc6bab96 included/pthreads, sched/pthreads, and Documetions: Updates after review of last PR. 2019-02-24 14:40:11 -06:00
Leif Jakob 58e387fc6f Merged in leif_jakob/nuttx/pthread_mutex_timedlock (pull request #830)
support for pthread_mutex_timedlock

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-02-24 20:04:24 +00:00
Gregory Nutt 11eb7ef4f8 Minor fixed to documents and C comments. 2019-02-23 17:46:43 -06:00
Gregory Nutt 2fbec4cdf6 Doumentation/NuttxPortingGuide.html: Add description of board_early_initialize() and board_late_initialize(). 2019-02-18 17:36:11 -06:00
Gregory Nutt 32a300806e Let's rename board_driver_initialize() to board_early_initialize() to emphasize its relationship to board_late_initialize(). 2019-02-18 16:25:08 -06:00
Gregory Nutt a76e137ce2 Squashed commit of the following:
sched/init/nx_start.c:  Add support for CONFIG_BOARD_DRIVER_INITIALIZE.  If this option is selected then nx_start() will call a board-provided function board_driver_initialize() immediately after calling up_initialize().

    Rename CONFIG_BOARD_INITIALIZE to CONFIG_BOARD_LATE_INITIALIZE.

    Raname board_initialize() to board_late_initialize()
2019-02-18 15:32:00 -06:00
Gregory Nutt bc5908d9fd tools/nxstyle.c: Beef up logic that detects multiple variable definitions per line. 2019-02-17 10:57:28 -06:00
Michał Łyszczek 626afb015b nuttx/sched/mqueue: Change 'int prio' to 'unsigned int prio'. According to open group specification, priority field in mq_* functions should have unsigned type: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html 2019-02-15 19:18:55 -06:00
Gregory Nutt fa1e151b12 sched/: Removed too much conditional compilation in commit 967dc523bb 2019-02-12 21:01:22 -06:00
Gregory Nutt 967dc523bb sched/: Remove the option CONFIG_BOARD_INITTHREAD. Now, if CONFIG_BOARD_INITIALIZE is selected, then the board_initialize() logic will ALWAYS run on an internal kernel thread. This will prevent the problems people have had doing inappropriate board_initialization on the IDLE thread. 2019-02-12 19:13:22 -06:00
Gregory Nutt efe65749ce Fix condition logic: The setup seems to support a network without sockets. That is not the case.
Squashed commit of the following:

    sched/sched/sched_getsockets.c:  Fix an error in conditional compilation.
    fs/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    Documentation/:  Remove all references to CONFIG_NSOCKET_DESCRIPTORS == 0
    include/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    libs/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    net/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    sched/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    syscall/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    tools/:  Fixups for CONFIG_NSOCKET_DESCRIPTORS no longer used to disable sockets.
2019-02-11 15:47:25 -06:00
Gregory Nutt a64869aa67 CONFIG_NFILE_DESCRIPTORS=0 can no longer be used to disable the file system. NuttX with no file system does not make sense.
Squashed commit of the following:

    configs/:  The few configurations that formerly set CONFIG_NFILE_DESCRIPTORS=0 should not default, rather they should set the number of descriptors to 3.
    fs/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    tools/:  Tools updates for changes to usage of CONFIG_NFILE_DESCRIPTORS.
    syscall/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    libs/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    include/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    drivers/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    Documentation/:  Remove all references to CONFIG_NFILE_DESCRIPTORS == 0
    binfmt/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    arch/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    net/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    sched/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    sched/Kconfig:  CONFIG_NFILE_DESCRIPTORS may no longer to set to a value less than 3
    configs/:  Remove all settings for CONFIG_NFILE_DESCRIPTORS < 3
2019-02-11 12:09:26 -06:00
Gregory Nutt a2e62f557d Squashed commit of the following:
sched/init/nx_bringup.c:  Fix a naming collision.
    sched/init:  Rename os_start() to nx_start()
    sched/init:  Rename os_smp* to nx_smp*
    sched/init:  Rename os_bringup to nx_bringup
    sched/init:  rename all internal static functions to begin with nx_ vs os_
2019-02-04 16:20:35 -06:00
Gregory Nutt bb623d1e04 This commit renames all internal OS functions defined under sched/task so that they begin with the prefix. For example, nxtask_exit() vs. task_exit().
Squashed commit of the following:

    Trivial, cosmetic
    sched/, arch/, and include:  Rename task_vforkstart() as nxtask_vforkstart()
    sched/, arch/, and include:  Rename task_vforkabort() as nxtask_vforkabort()
    sched/, arch/, and include:  Rename task_vforksetup() as nxtask_vfork_setup()
    sched/:  Rename notify_cancellation() as nxnotify_cancellation()
    sched/:  Rename task_recover() to nxtask_recover()
    sched/task, sched/pthread/, Documentation/:  Rename task_argsetup() and task_terminate() to nxtask_argsetup() and nxtask_terminate(), respectively.
    sched/task:  Rename task_schedsetup() to nxtask_schedsetup()
    sched/ (plus some binfmt/, include/, and arch/):  Rename task_start() and task_starthook() to nxtask_start() and nxtask_starthook().
    arch/ and sched/:  Rename task_exit() and task_exithook() to nxtask_exit() and nxtask_exithook(), respectively.
    sched/task:  Rename all internal, static, functions to begin with the nx prefix.
2019-02-04 13:42:51 -06:00
Gregory Nutt 90e4cf4349 mm/umm_heap: sbrk() is only available in the KERNEL build. 2019-02-04 10:32:31 -06:00
Gregory Nutt 641a98a434 arch/: The saved return register state is available on the user stack. Thic commit reorders some logic so that certain, critical registers are preserved in the TCB. This does not make the logic 100% secure, but does prevent some obvious things. sched/signal/sig_delivery: Add a flag to the TCB to indicate that we are in a signal handler. Use this flag to assure that a there a never attempts to nest signal handling operations on a thread. This was guaranteed before but when locking of pre-emption during signal delivering was eliminated in a previous commit, there was a remote possibility of an attempt to do nested signal handling. This flag assures that there is only one signal handled at a time. 2019-02-03 15:29:47 -06:00
Gregory Nutt 71e6793702 sched/sched: Rename all internal, static functions from sched_* to nxsched_* to indicate that they are NuttX internal functions. This is only a start. Eventually, need to rename all sched_ functions prototyped in sched/sched/sched.h and in include/nuttx with nxsched_. 2019-02-03 14:18:39 -06:00
Gregory Nutt 1b1be1f327 sched/signal/sig_deliver.c: Restructure nxsig_deliver() so that the signal handler is not called with the pre-emption disabled (or, at least no with pre-emption disabled by nxsig_deliver() itself). 2019-02-03 10:39:41 -06:00
Gregory Nutt 40b74d1f1c sched/wqueue/kwork_notifier.c: Fix broken assertion introduced in recent commit. Breaks non-error path. Suggested by Jussi Kivilinna in Butbucket commit comment. 2019-02-01 08:53:18 -06:00
Gregory Nutt 8dd17362e3 sched/sched/sched_processtimer.c: Should include board if CONFIG_SYSTEMTICK_HOOK=y. 2019-01-30 08:21:09 -06:00
Gregory Nutt 6408857f6d sched/sched/sched_processtimer.c: Add a configurable call out to a user-provided function, 'timer hook', on each timer interrupt. 2019-01-30 07:22:44 -06:00
Gregory Nutt 78c8485b0d Fix some warnings found in build testing. 2019-01-27 17:23:01 -06:00
Xiang Xiao d6b0b0d94b sched/mqueue/mq_desclose.c: Fix warning: variable 'msgq' set but not used 2019-01-27 11:08:28 -06:00
ligd 14573202bc sched/sched/sched_timerexpiration.c: Fix macro SEC2TICK() 32-bits overflow by using uint64_t in calculation. 2019-01-27 11:07:09 -06:00
Gregory Nutt cc8878f08a sched/Kconfig: Change SCHED_NOTE_GET type from int to bool~ 2019-01-27 11:04:54 -06:00
Xiang Xiao fe421022e2 sched/wqueue/kwork_notifier.c and several Kconfig files: Notifier should work with either lpwork or hpwork and other minor typo fix. 2019-01-27 11:02:56 -06:00
Xiang Xiao e57f7cf6ae Critical Section Monitor (sched/ and fs/procfs: Remove SCHED_IRQMONITOR_GETTIME to simplify the clock source selection: (1) Use up_critmon_gettime if SCHED_IRQMONITOR, (2) Call clock_systimespec if SCHED_TICKLESS, (3) Don't collect timing info for all other cases and move up_critmon_* to arch.h avoid the duplicated declaration. 2019-01-27 10:13:28 -06:00
Xiang Xiao fb63c0a293 sched/signal and related changes to other OS subsystems. 2019-01-27 09:28:59 -06:00
Xiang Xiao c43e4673ab sched/Kconfig, libs/libc/dllfcn/Kconfig, libs/libc/modlib/Kconfig: Refine ELF related configurations. 2019-01-26 11:50:09 -06:00
anchao 88efb84847 libs/libc/dllfcn, sched/init: Add LD_LIBRARY_PATH environment variable support. 2019-01-26 11:47:14 -06:00
Xiang Xiao 9e2238f6cd libs/libc/dllfcn: Implement dlerror using strerror. 2019-01-26 11:39:05 -06:00
Xiang Xiao 095e28d45e binfmt/, binfmt/libelf/, include/nuttx, libs/libc/machine, libs/libc/modlib, and others: Move elf related arch function to include/nuttx/elf.h because the implementation is located in libs/libc/machine and in order to avoid the conflict with the 3rd party libraries and clean up the file inclusion: (1) Remove redundant elf32.h, (2) Remove nuttx/binfmt/elf.h in libs/libc/machine, (2) Remove nuttx/binfmt/elf.h in modlib, and (4) Rmove nuttx/module.h in modlib. 2019-01-26 11:18:45 -06:00
Gregory Nutt bdd02a6aed Some cosmetic updates, mostly to spacing and comments. 2018-12-30 11:58:19 -06:00
Gregory Nutt 40cdc187bb mm/mm_heap/mm_sem.c and sched/task/task_getpid.c: Commits 43d37c866b and f37202cbc0 resolved some problems with the original fix of 91aa26774b. However, Those changes used an internal OS interface (sched_self()) which is not available when the the user-space memory manager is built in the PROTECTED or KERNEL builds and resulted in build failures.
This commit repartitions the logic by moving some of the changes from mm_sem.c into task_getpid.c.  The logic is equivalent for the case of mm_trysemaphore(), but no has wider impact since it potentially affects all callers of getpid().  Hence, this change may also introduce some other issues that will need to be addressed.
2018-12-30 08:41:06 -06:00
David Sidrane 24db683368 arch/arm/src/imxrt/chip/imxrt106x_pinmux.h: Add FLEXCAN3 to pinmux 2018-12-28 15:08:20 -06:00
Gregory Nutt 8b21960ba3 sched/pthread: Implement pthread_key_delete(). This involves some minor changes to the group data structure. 2018-12-28 14:21:19 -06:00