Commit Graph

26 Commits

Author SHA1 Message Date
Xiang Xiao 6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Gregory Nutt be325924fb This commit corrects a problem with NSH: NSH was calling the OS internal function ramdisk_register() in violation of the portable POSIX interface. This commit solves the problem by introducing a new boardctl() function BOARDIOC_MKRD which moves the RAM disk creation into the OS.
Squashed commit of the following:

    drivers/:  Run tools/nxstyle against all drivers/*.c.

    boards/boardctl.c:  Add new boardctl() command, BOARDIOC_MKRD, that can be used to create a RAM disk.  This will replace the illegal call to ramdisk_register() currently used by NSH.

    drivers/mkrd.c:  Add wrapper around ramdisk_register() for creating a proper ramdisk.
2019-10-26 09:35:32 -06:00
Gregory Nutt b49be4bb20 Squashed commit of the following:
arch/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    sched/ audio/ crypto/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    Documentation/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    fs/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    graphics/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    net/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    drivers/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    include/, syscall/, wireless/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    configs/:  Remove all references to CONFIG_DISABLE_POLL.  Standard POSIX poll can no longer be disabled.
2019-05-21 18:57:54 -06:00
Gregory Nutt 9568600ab1 Squashed commit of the following:
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.
2017-10-04 15:22:27 -06:00
Gregory Nutt 42a0796615 Squashed commit of the following:
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
2017-10-03 15:35:24 -06:00
Gregory Nutt 4b4dbc79a2 Move driver related prototypes out of include/nuttx/fs/fs.h and into new include/drivers/drivers.h 2016-07-20 13:15:37 -06:00
Paul A. Patience f8f7b7582c Silence some warnings 2016-05-26 14:06:13 -04:00
Gregory Nutt cf14f8d1b5 drivers/: Fixes to spacing and alignement 2015-10-10 10:41:00 -06:00
Gregory Nutt 417f67c132 Clean up some naming: fd vs. fildes vs. filedes and filep vs filp 2013-09-28 16:50:07 -06:00
patacongo 3bd865b3d0 Fix an error in LPC43xx clock configuratin that can cause fail to boot
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4945 42af7a65-404d-4744-a932-0658087f49c3
2012-07-16 19:16:57 +00:00
patacongo 5b7341f5db drivers/, drivers/pipes, and drivers/serial file clean-up
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4944 42af7a65-404d-4744-a932-0658087f49c3
2012-07-15 14:56:25 +00:00
patacongo 2fe4ad52f8 Move file-system header files to include/nuttx/fs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4499 42af7a65-404d-4744-a932-0658087f49c3
2012-03-21 18:01:07 +00:00
patacongo 9634f25391 Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2343 42af7a65-404d-4744-a932-0658087f49c3
2009-12-15 14:25:14 +00:00
patacongo aa22bbeb39 All file_operations vtables should be static const
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1871 42af7a65-404d-4744-a932-0658087f49c3
2009-06-10 15:22:49 +00:00
patacongo cf12e1690e Move poll save area back into struct pollfd (as it was
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1288 42af7a65-404d-4744-a932-0658087f49c3
2008-11-19 18:43:50 +00:00
patacongo 0f4896d7b8 Revert part of last change
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1285 42af7a65-404d-4744-a932-0658087f49c3
2008-11-19 02:39:21 +00:00
patacongo b2b69f173b Implement poll/select for sockets
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1277 42af7a65-404d-4744-a932-0658087f49c3
2008-11-18 17:30:30 +00:00
patacongo 68ec2ba098 Add poll() method
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1262 42af7a65-404d-4744-a932-0658087f49c3
2008-11-17 20:24:28 +00:00
patacongo dbda581f26 Add infrastructure to support poll()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1258 42af7a65-404d-4744-a932-0658087f49c3
2008-11-16 18:48:29 +00:00
patacongo ff7c75a90d Add function headers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1233 42af7a65-404d-4744-a932-0658087f49c3
2008-11-14 15:10:31 +00:00
patacongo 174a9f77c6 Fix /dev/zero
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@616 42af7a65-404d-4744-a932-0658087f49c3
2008-02-02 15:04:39 +00:00
patacongo 1e52a8f36a Add pascal test
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@606 42af7a65-404d-4744-a932-0658087f49c3
2008-02-01 20:47:32 +00:00
patacongo 7b6b0aaf21 Reflect changes due to fs structures
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@211 42af7a65-404d-4744-a932-0658087f49c3
2007-05-09 00:08:54 +00:00
patacongo bcd6ba97bd This creates a 8051 build that can run in 24Kb of RAM
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@26 42af7a65-404d-4744-a932-0658087f49c3
2007-03-01 21:05:55 +00:00
patacongo a60059d9d0 Finally, a clean SDCC compile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@20 42af7a65-404d-4744-a932-0658087f49c3
2007-02-27 21:17:21 +00:00
patacongo b08a86171f NuttX RTOS
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3 42af7a65-404d-4744-a932-0658087f49c3
2007-02-17 23:21:28 +00:00