Commit Graph

49 Commits

Author SHA1 Message Date
Xiang Xiao
5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
YAMAMOTO Takashi
83354983c3 Fix "with with" typos
In many cases, remove one of them.
In a few places, it looks like a typo of "width" actually.
2020-01-27 08:46:46 +01:00
patacongo
ecb2f99dfb drivers/rwbuffer.c: Fix coding style issues. (#164)
Run .c and .h files affected by PR163 through nxstyle and fix all coding style complaints.

Co-authored-by: Gregory Nutt <gnutt@nuttx.org>
2020-01-25 15:26:42 +01:00
Satoshi Togawa
aad1ab2574 Fix assertion occurrence in rwb_invalidate_writebuffer() 2020-01-25 07:48:34 -06:00
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
Xiang Xiao
6ee09e8888 drivers/mtd/ftl.c: Support BIOC_FLUSH ioctl 2018-11-09 08:12:52 -06:00
zhuyanlin
0849af133e drivers/rwbuffer.c: Improve the rwb_read/write overlap performance 2018-11-09 08:10:40 -06:00
Xiang Xiao
44c9728a60 rivers/rwbuffer.c: Don't queue work to flush write buffer if CONFIG_DRVR_WRDELAY == 0 2018-11-09 08:10:40 -06:00
Xiang Xiao
ec70aa86a6 drivers/rwbuffer.c: Fix a lock issue 2018-11-09 08:10:40 -06:00
Gregory Nutt
2722fd8192 tools/nxstyle.c: Add capability to detect multiple blank lines. Single spacing required by the coding standard. Also coding standard fixes to server .c files for problems found during testing nxstyle. 2018-08-24 05:51:44 -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
83cdb0c552 Squashed commit of the following:
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.
2017-10-03 12:52:31 -06:00
Gregory Nutt
8e6c78f425 Fix last commit. It violates the NuttX coding standard because it is not C89 compliant. 2017-08-30 13:44:13 -06:00
Oleg Evseev
18f4dcffa8 Eliminate unused variable warning. 2017-08-30 08:46:48 -06:00
Jussi Kivilinna
1cc842794d drivers/rwbuffer.c: Fix compiler warnings 2017-05-31 09:28:20 -06:00
Gregory Nutt
46dbbe837e rwbuffer.h moved from include/nuttx/ to include/nuttx/drivers. 2016-07-20 13:54:38 -06:00
Gregory Nutt
a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt
fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00
Gregory Nutt
0fb035f76b Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
Gregory Nutt
59b912477e Fix some warnings: Mismatched prototypes 2015-12-05 10:36:00 -06:00
Gregory Nutt
cf14f8d1b5 drivers/: Fixes to spacing and alignement 2015-10-10 10:41:00 -06:00
Gregory Nutt
cb9e27c3b0 Standardize naming used for public data and function groupings 2015-10-02 16:30:35 -06:00
Juha Niskanen
70620d3dd6 rivers/rwbuffer: Fix some logic errors 2015-08-26 07:18:50 -06:00
Gregory Nutt
e4d2822af8 Make some file section headers more consistent with standard 2015-04-08 07:15:32 -06:00
Gregory Nutt
b99db64f15 rwbuffer, fix compiler error 2014-11-05 15:26:48 -06:00
Gregory Nutt
b33f8b3013 MTD read-ahear/write buffering layer seems functional 2014-09-25 13:35:10 -06:00
Gregory Nutt
a5bc26db4a Fixes for compile of rwbuffer.c 2014-09-25 11:02:30 -06:00
Gregory Nutt
1780810d3d Rename kmalloc to kmm_malloc for consistency 2014-08-31 17:26:36 -06:00
Gregory Nutt
54fa3b0b59 Rename kfree to kmm_free for consistency with other naming conventions 2014-08-31 17:04:02 -06:00
Gregory Nutt
98cf3b06e5 nuttx/drivers: Remove explicity references to errno. That is a problem from within the kernel for certain configurations 2014-08-28 16:59:06 -06:00
Gregory Nutt
58ab6ec03f NX graphics library: Macroize some color operators that become trivial when there is only one color plane 2014-07-12 07:44:56 -06:00
Gregory Nutt
ab1ab379dd Addition rwbuffer interfaces should not be enabled unless they are needed; if rwbuffer support is enabled, it should not be unconditionally enabled in SMART and FTL 2014-07-11 16:19:17 -06:00
Gregory Nutt
8516551e54 Add an MTD layer that will add read-ahead or write buffering to any MTD driver (incomplete) 2014-07-11 11:20:11 -06:00
Gregory Nutt
3a1324741a More trailing whilespace removal 2014-04-13 14:32:20 -06:00
Gregory Nutt
4d25119e62 Fix various typos in comments. From Alan Carvalho de Assis 2014-04-06 09:02:02 -06:00
Gregory Nutt
c6b141d190 Fix typoes in drivers/rwbuffer.c from Chia Cheng Tsao 2013-07-09 07:59:28 -06:00
patacongo
561bea0899 Add support for multiple work queues
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5081 42af7a65-404d-4744-a932-0658087f49c3
2012-09-04 00:54:09 +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
12afb230bf Fixes for kernel stub builds
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3473 42af7a65-404d-4744-a932-0658087f49c3
2011-04-06 16:40:47 +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
c76c6b0e52 Fix block read/write return values; SDIO error reporting; slow down clock if interrupt mode
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2278 42af7a65-404d-4744-a932-0658087f49c3
2009-11-25 13:50:26 +00:00
patacongo
d9413c1214 Fix confusion between byte and block transfers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2235 42af7a65-404d-4744-a932-0658087f49c3
2009-11-06 13:43:21 +00:00
patacongo
00e7c5f8ac Integrte work thread
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2232 42af7a65-404d-4744-a932-0658087f49c3
2009-11-06 00:44:22 +00:00
patacongo
64e5bef2f6 Incorporate the work thread
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2230 42af7a65-404d-4744-a932-0658087f49c3
2009-11-05 22:58:36 +00:00
patacongo
86987e3b02 Add beginnings of a work thread
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2229 42af7a65-404d-4744-a932-0658087f49c3
2009-11-05 21:44:33 +00:00
patacongo
fcf4b9767c cosmetic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2228 42af7a65-404d-4744-a932-0658087f49c3
2009-11-05 20:16:15 +00:00
patacongo
6b2827a112 Add generic support for read-ahead buffering and write buffering in block drivers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2227 42af7a65-404d-4744-a932-0658087f49c3
2009-11-05 18:15:06 +00:00