Commit Graph

3854 Commits

Author SHA1 Message Date
Gregory Nutt
11a635dcb3 mm/iob: IOB free notifier should accept the work queue ID as a paramter. The notification may need to run on either the high- or low- priority work queue. sched/work: Change the default priority of the low-priority work queue to 100. 2018-09-11 08:49:39 -06:00
Gregory Nutt
af0ee3c8f7 sched/wqueue: Add an option to work queue notifier so that the notification can occur on different work queues. 2018-09-11 07:22:23 -06:00
Gregory Nutt
9d3148406c Signals were not a good choice of IPC to implement the poll function for several reasons: In order to handle the asynchrnous poll-related event, a substantial amount of state information is needed. Signals are only capable of passing minimal amounts of data. There are also complexities with performing kernel space signal handlers in kernel space code that is better to avoid. So, instead of signals, the equivalent logic was converted to run via a callback that executes on the high-priority work queue.
Squashed commit of the following:

    Fix up some final compile isses.

    net/netdev:  Convert the network down notification logic to use the new wqueue-based notification factility.

    net/udp:  Convert the UDP readahead notification logic to use the new wqueue-based notification factility.

    net/tcp:  Convert the TCP readahead notification logic to use the new wqueue-based notification factility.

    mm/iob:  Convert the IOB notification logic to use the new wqueue-based notification factility.

    sched/wqueue:  Signals are not good IPCs to support the target poll functionality for several reasons including the amount of data that can be passed with a signal and in the fact that in protected and kernel modes, user threads executing signal handlers in protected, kernel memory is problematic.  Instead, convert the same logic to perform the notifications via function callback on the high priority work queue.
2018-09-09 15:01:44 -06:00
Gregory Nutt
20814acad2 sched/signal: In signal notification facility, use sigqueue() to notify vs. kill(). With sigqueue, we can pass more info (but still not enough). 2018-09-09 11:57:25 -06:00
Gregory Nutt
32e3e51678 net/netdev: Add signal notification for the case where the network goes down. 2018-09-09 10:39:25 -06:00
Gregory Nutt
fc127fd297 sched/signal: Add a generic signal notification facility. Modify the custom IOB available notifier so that it is now just a wrapper around this generic signal notification. This generic signal notification faility will, eventually, be used to support network polling.
Squashed commit of the following:

    mm/iob:  The IOB available notifier is now just a wrapper around the common signal notifier.

    sched/signal:  Add a generic signal notification facility.

    sched/signal/sig_evthread.c:  More trivial naming changes.

    sched/signal:  Rename nxsig_notification() to nxsig_evthread() to make forthcoming naming additions more consistent.
2018-09-09 08:32:37 -06:00
Gregory Nutt
bba8541ad6 mm/iob: Add an IOB notifier that will send a signal to any registered threads that want to be notified when an IOB has been freed. This is an untested work-in-progress and is intended to be a part of a larger solution to correctly handling network poll operations. 2018-09-08 11:21:18 -06:00
Gregory Nutt
33e3fb7a70 Correct mispellings of pseudo. Update some comments in signal.h. 2018-09-05 11:56:14 -06:00
Gregory Nutt
993321dda6 drivers/serial: Add support for Ctrl-Z. This works just like the recently added Ctrl-C support except that SIGSTP is sent when the Ctrl-Z characters is encountered vs. SIGINT. 2018-09-02 15:36:25 -06:00
Gregory Nutt
093348030e sched/: Update signal default STOP action. If waitpid was called with the WUNTRACED then wake up waitpid. Also fix some compile problems.. How did this work before? 2018-09-02 13:51:52 -06:00
Ouss4
adda352b15 drivers/sensors/dhtxx.c: Driver for DHTxx sensor. 2018-09-01 07:25:30 -06:00
Gregory Nutt
a7265d71c6 This commit adds support for default signal actions for SIGSTOP, SIGSTP, and SIGCONT.
Squashed commit of the following:

    Add procfs support to show stopped tasks.  Add nxsig_action() to solve a chicken and egg problem:  We needed to use sigaction to set default actions, but sigaction() would refuse to set actions if the default actions could not be caught or ignored.

    sched/signal:  Add configuration option to selectively enabled/disable default signal actions for SIGSTOP/SIGSTP/SIGCONT and SIGKILL/SIGINT.  Fix some compilation issues.

    sched/sched:  Okay.. I figured out a way to handle state changes that may occur while they were stopped. If a task/thread was already blocked when SIGSTOP/SIGSTP was received, it will restart in the running state.  I will appear that to the task/thread that the blocked condition was interrupt by a signal and returns the EINTR error.

    sched/group and sched/sched:  Finish framework for continue/resume logic.

    sched/signal:  Roughing out basic structure to support task suspend/resume
2018-08-30 10:27:18 -06:00
Xiang Xiao
20fc3ebcdd include/nuttx/ioexpander/gpio.h: Fix build break introduced by commit 459d9f2851 2018-08-30 07:25:26 -06:00
Xiang Xiao
11bccf42ea include/nuttx/usb/audio.h: Fix warning: 'missing whitespace after the macro name' 2018-08-29 06:10:52 -06:00
ligd
289af9a0fb configs/boardctl.c: Add support for board_app_finalinitialize() 2018-08-28 15:34:31 -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
e7ce9bbfc4 drivers/serial: Integrate new Ctrl-C logic with the ISIG flag in the termios c_lflag. Fix several compiler errors resulting from recently flurry of renaming. 2018-08-28 09:15:29 -06:00
Xiang Xiao
70a0bf0849 Squashed commit of the following:
fs/partition/fs_partition.c:  Add PTABLE parser

    fs/partion:  Add a partition parser framework

    fs/driver/fs_blockpartition.c:  Add register_blockpartition for block partition
2018-08-28 07:30:21 -06:00
Xiang Xiao
8b5ac497ad drivers/mtd/ftl.c: Support initialization of an FTL block device with a custom name 2018-08-28 07:15:57 -06:00
Xiang Xiao
159b88c871 include/limits.h and include/sys/types.h: Fix warning about 'SIZE_MAX' redefined. include/nuttx/usb/audio.h: Fix warnings due to '-' used whete '_' intended. 2018-08-28 06:41:57 -06:00
wangyanjiong
25f2bcea38 drivers/mtd: Add gd25 driver 2018-08-28 06:31:54 -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
zhuguangqing
1bbe9baa29 drivers/pm: PM: Add PM_RESTORE to notify driver that device exit WFI so the driver could restore state. For example, WDT may stop counting before enter low power state and restore the counting agian in PM_RESTORE notification 2018-08-27 13:26:33 -06:00
zhuguangqing
7f4064e511 drivers/pm: PM: Decrease the power state in the reverse order. Since the child driver need power off before parent driver. 2018-08-27 13:22:11 -06:00
zhuguangqing
7d9787d530 drivers/power: PM: Add pm_querystate function 2018-08-27 13:18:09 -06:00
Xiang Xiao
006b7d3963 drivers/power: PM: Add pm_stay and pm_relax function so special apps(e.g. mediaplayer) could disable suspend during playback much like linux kernel counterpart 2018-08-27 13:16:34 -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
Xiang Xiao
6c057e608b Squashed commit of the following:
drivers/timers/arch_timer.c: implement timer arch API on top of timer driver interface

    drivers/timers/arch_alarm.c:  Implement alarm arch API on top of oneshot driver interface

    drivers/timers/arch_rtc.c:  Implement RTC arch API on top of RTC driver interface

    include/nuttx/timers/rtc.h:  Extend struct rtc_time by adding tm_nsec if RTC supporst hiresolution time.
2018-08-27 11:55:30 -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
798922b9c6 include/nuttx/lib/modlib.h: Eliminate warning: 'CONFIG_MODLIB_MAXDEPEND' is not defined' 2018-08-27 11:39:52 -06:00
zhuyanlin
459d9f2851 Squashed commit of the following:
driver/ioexpander:  Add gpio_pin_unregister function to GPIO driver
  driver/ioexpander:  Add pinset struct to GPIO driver for interrupt pins larger than 64
  driver/ioexpander:  Initialize pintype/inttype when registering ioexpander device
  driver/ioexpander:  Add SETPINTYPE ioctl command to the GPIO driver
2018-08-27 09:25:11 -06:00
Xiang Xiao
b5f8c035a6 audio/audio_comp.c: Add the composite audio driver 2018-08-27 09:03:09 -06:00
ZhongAn
85a993999e drivers/audio/audio_i2s.c: Add audio_i2s device driver. 2018-08-27 08:52:08 -06:00
ZhongAn
47db09633c include/nuttx/audio/i2s.h: Add i2s_rxchannels and i2s_txchannels methods to the I2S lower half interface. 2018-08-27 08:37:57 -06:00
anchao
d795344014 nuttx/audio: Add hardware format support 2018-08-27 07:58:22 -06:00
ZhongAn
d77b9b1209 include/nuttx/audio/audio.h: Add ioctl cmd 'AUDIOIOC_SETBUFFERINFO' so user space could config the buffer 2018-08-27 07:57:16 -06:00
ZhongAn
4d115e925f include/nuttx/audio/audio.h: Change member samp of apb to pointer so driver can customize sample buffer allocation 2018-08-27 07:45:27 -06:00
anchao
5f28be71e5 Kconfig: Move 'option modules' from NSH_FILE_APPS to BUILD_LOADABLE 2018-08-27 07:06:57 -06:00
zhuyanlin
7864ef1588 include/nuttx/nuttx.h: Added nuttx.h header file which is analogous to the linux.h header file. Currently, it contains on the defintion of the container_of() macro. 2018-08-27 06:52:02 -06:00
Xiang Xiao
894ca622e6 nclude/sys/types: Move wint_t and wctype_t from wchar.h to types.h. This change is compatible as before since wchar.h include types.h indirectly. This fixes a compilation error with newlib's math.h: 'unknown type name wint_t' 2018-08-27 06:26:37 -06:00
QianWenfa
e2e0911bc4 include/nuttx/mutex.h: Add inline wrapper functions to more clearly support semaphores when used as mutexs. 2018-08-27 06:26:11 -06:00
liuhaiyang
0c9a4ac4f9 nclude/nuttx/semaphore: apply the semaphore wait function nxsem_wait_uninterruptible(). The function nxsem_wait_uninterruptible() is a wrapped version of nxsem_wait(), which is uninterruptible and convenient for use. 2018-08-27 06:07:50 -06:00
Gregory Nutt
8980b08fae include/nuttx/semaphore.h: don't include nuttx/fs/fs.h. (1) Avoid nested loops if CONFIG_SIG_EVTHREAD enabled, (2) semaphore.h doesn't depends on fs.h. 2018-08-27 06:05:28 -06:00
Xiang Xiao
71ad1993f2 Move clock_timespec_[add|subtract] to include/nuttx/clock.h 2018-08-27 06:04:04 -06:00
dongjiuzhu
bd24562aa5 include/nuttx/i2c/i2c_master.h: Add the standard speed macros. 2018-08-27 06:02:13 -06:00
Xiang Xiao
05949ff79c include/spawn.h: Fix posix_spawnattr_destroy warning: 'the address of attr will always evaluate as true' 2018-08-27 06:00:33 -06:00
zhuguangqing
8780c51cb3 include/queue.h: Add dq_tail marco 2018-08-27 05:57:53 -06:00
zhuyanlin
57b91a8cfc include/nuttx/kmalloc.h: Add {kumm/kmm}_calloc API. Add calloc API for manage user memory and kernel memory in Flat Build/Kernel Build without kernel heap. 2018-08-27 05:55:09 -06:00
Xiang Xiao
439aac1449 include/nuttx/compiler.h: fix warning: __cplusplus is not defined. Some gcc derived compiler do not define __cplusplus 2018-08-27 05:53:16 -06:00
Xiang Xiao
c139478f60 nclude/nuttx/fs/binfs.h: Fix warning: Type defaults to 'int' in declaration of 'mountpt_operations' 2018-08-27 05:50:52 -06:00