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
many locations: Change occurences of open() followed by file_detach() to file_open(). Change most non-controversion calls to open() to nx_open().
fs/inode/fs_fileopen.c: Flesh out file_open() with some interim, placeholder logic.
fs/inode/fs_fileopen.c: Add a framework for a file_open() implementation (no real logic in place yet).
fs/vfs/fs_open.c: Add nx_open() which is the same as open() except that it does not create a cancellation point nor does it modify the errno variable.
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
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.
drivers/serial/uart_16550.c: Support 16550 auto hardware flow control
drivers/serial/uart_16550.c: Add configuration option CONFIG_16550_SUPRESS_INITIAL_CONFIG. This is identical to the standard configuration in arch/Kconfig CONFIG_SUPPRESS_UART_CONFIG, but with scope of only the 16550 driver.
drivers/serial/uart_16550.c: Add a configuration, analogous to the STM32 configuration option, to suppress the NuttX standard re-ordering for /dev/ttySN for special case of the 16550 UART.
config/serial: UART 16550: Add CONFIG_SERIAL_UART_ARCH_MMIO option so the a memory mapped device doesn't need to provide uart_getreg() and uart_putreg() implementations.
u16550_txempty() should check UART_LSR_TEMT to avoid some data left in the transmit FIFO
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.
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.
Squashed commit of the following:
arch/arm/src/lpc54xx: Finish off some missing logic. Complete now execpt for GPIO and LED support.
arch/arm/src/lpc54xx: Add lpc54_clrpend.c
arch/arm/src/lpc54xx: Serial driver is complete and compiles.
arch/arm/src/lpc54xx: Add beginning of a serial driver (still missing some logic)
arch/arm/src/lpc54xx: Fleshes out low level USART intialization.
arch/arm/src/lpc546xx/Kconfig: Add hooks to integrate with common seril upper half.
arch/arm/src/lpc54xx: Beginning of USART console support.
arch/arm/src/lpc54xx: Completes very basic clock configuration.
arch/arm/src/lpc54xx: Add clocking logic (still not complete)
arch/arm/src/lpc54xx: Beginning of PLL configuration logic.
arch/arm/src/lpc54xx: Fix a few things from first compile attempt. Compilation cannot work until I at least finish the clock configuration logic.
arch/arm/src/lpc54xx: Addes some SysTick logic.
arch/arm/src/lpc54xx: Completes basic startup logic (sans clock configuration) and interrupt configuration.
arch/arm/src/lpc54xx: Add generic ARMv7-M start-up logic (needs LPC54628 customizations); add emtpy file that will eventually hold the clock configuration logic.
arch/arm/src/lpc54xx: Add (incomplete) SYSCON register definition header file.
arch/arm/src/lpc54xx: Add FLEXCOMM header file.
arch/arm/src/lpc54xx: Bring in tickless clock logic from LPC43; configs/lpcxpresso-lpc54628: mount procfs if enabled.
arch/arm/src/lpc54xx: Add RIT clock definitions; add SysTick initialization (not finished)
LPC54xx and LPCXpresso-LPC54628: add more boilerplate files and stubbed out files.
arch/arm/src/lpc54xx: Add (incomplete) USART header file.
Add another condition to a Kconfig; refresh a defconfig.
arch/arm/src/lpc54xx/chip: Add LPC54628 memory map header files.
configs/lpcxpresso-lpc54628: Add basic build files for the LPCXpresso-LPC54628
arch/: Basic build directory structure for the LPC54628
According to the specification, the close function must wait until all data
has been written before it closes the file (except O_NONBLOCK is set). The
maximum waiting time for this is not specified.
To be able to edit the file list of the process, the close function has to lock
the file list semaphore. After that the close function of the serial driver is
called.
Waiting for the complete transmission of all data is done in the serial driver.
This causes the semaphore to remain locked until all data has been sent.
However, no other thread of the process can edit the file list for that time
(open, close, dup2, etc.). This is not optimal in a multithreaded environment.
Therefore, we have to keep the waiting time within the driver as short as possible.
Squashed commit of the following:
Change all calls to usleep() in the OS proper to calls to nxsig_usleep()
sched/signal: Add a new OS internal function nxsig_usleep() that is functionally equivalent to usleep() but does not cause a cancellaption point and does not modify the errno variable.
sched/signal: Add a new OS internal function nxsig_sleep() that is functionally equivalent to sleep() but does not cause a cancellaption point.
This commit backs out most of commit b4747286b1. That change was added because sem_wait() would sometimes cause cancellation points inappropriated. But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.
In the OS, all calls to sem_wait() changed to nxsem_wait(). nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.
In all OS functions (not libraries), change sem_wait() to nxsem_wait(). This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.
sched/semaphore: Add the function nxsem_wait(). This is a new internal OS interface. It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
sched/semaphore: Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable. Changed all references to sem_post in the OS to nxsem_post().
sched/semaphore: Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable. Changed all references to sem_destroy() in the OS to nxsem_destroy().
libc/semaphore and sched/semaphore: Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable. Changed all references to sem_setprotocol in the OS to nxsem_setprotocol(). sem_getprotocol() was not used in the OS
libc/semaphore: Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable. Changed all references to sem_getvalue in the OS to nxsem_getvalue().
sched/semaphore: Rename all internal private functions from sem_xyz to nxsem_xyz. The sem_ prefix is (will be) reserved only for the application semaphore interfaces.
libc/semaphore: Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable. Changed all references to sem_init in the OS to nxsem_init().
sched/semaphore: Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.
sched/semaphoate: Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
configs/z80sim and xtrs: Serial driver lower halfs ioctl methods should return a negated errno value, not set the errno variable.
drivers/wireless: CC1101 driver not permitted to set errno.
drivers/sensors: LIS331DL driver not permitted to set errno.
drivers/lcd: ILI9341 initialize method not permitted to set errno,
drivers/serial: 16550 UART driver IOCTL method must not set errno; it must return a negated errno value.