Commit Graph

31 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 bff30ff9bc Fix minor typo / copy-paste. 'cancellaction point'->'cancellation point' 2019-08-23 11:57:35 -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 8fdbb1e0a4 Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
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.
2018-06-16 12:16:13 -06:00
Gregory Nutt da50646bcf sched/wdog: wd_start() is an internal OS function and should not set the errno value. Reviewed and updated every call to wd_start() to verify if return value is used and if so if the errno value is accessed. 2018-01-31 10:09:14 -06:00
Gregory Nutt fca07be1df Squashed commit of the following:
Change all calls to mq_send() and mq_timedsend() in the OS to calls to nxmq_send() and nxmq_timedsend(), making appropriate changes for differences in return values.

    sched/mqueue:  Add internal function nxmq_send() and nxmq_timedsend() that are equivalent to mq_send() and mq_timedsend() except that they do not create cancellation points and do to not modify the errno variable.
2017-10-10 08:44:12 -06:00
Gregory Nutt e7c52bac60 Squashed commit of the following:
sched/mqueue:  Rename all private static functions for use the nxmq_ vs. mq_ naming.

    sched/mqueue:  Rename all OS internal functions declared in sched/mqueue/mqueue.h to begin with nxmq_ vs. mq_.  The mq_ prefix is reserved for standard application interfaces.
2017-10-09 09:06:46 -06:00
Arjun Hary b274a97840 Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
Jussi Kivilinna c57d49f420 clock: Add new type ssystime_t for relative 64-bit ticks, change ticks<->time conversion functions to use ssystime_t 2017-04-21 08:51:31 -06:00
Gregory Nutt b52e4e5ecd Move cancellation point definitions to their own header file. 2016-12-10 09:08:26 -06:00
Gregory Nutt bc3ca25cc7 Cancellation points: Close up some logic to eliminte some race conditions. 2016-12-10 08:36:58 -06:00
Gregory Nutt 7fce8022c6 Finishes all cancellation point logic 2016-12-09 16:50:34 -06:00
Gregory Nutt f0b4705d57 Correct a comment 2016-09-15 13:10:42 -06:00
Gregory Nutt e3bbfa2d85 mq_send() was not setting the errno value on certain failures to allocate a message 2016-09-15 12:42:24 -06:00
Gregory Nutt 6e3107650d nuttx/sched: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 08:17:46 -06:00
Gregory Nutt 74db48202e sched/: Replace explict references to g_readytorun with indirect references via the this_task() macro 2016-02-06 17:44:41 -06:00
Gregory Nutt cb9e27c3b0 Standardize naming used for public data and function groupings 2015-10-02 16:30:35 -06:00
Gregory Nutt 84f0303fc0 mq_timedreceive() move the location where the errno value is set; the TIMEDOUT errno setting was being overwritten by subsequent actions before returning. Noted by Freddie Chopin. 2015-06-03 07:24:50 -06:00
Gregory Nutt 3adcae8ffb Update the type passed to watchdog timer handlers. Using uint32_t is a problem for 64-bit machines. 2015-05-18 08:53:42 -06:00
Gregory Nutt caea44a624 Fix a case in mq_timedsend() where the return errno value was being overwritten 2015-03-10 12:05:33 -06:00
Gregory Nutt 7d46801f46 Reorder some operations to minimize a race condition 2015-03-10 10:41:21 -06:00
Gregory Nutt 4c6057eca1 mq_timedsend(): Do check for time errors if the message queue is not full. Noted by Freddie Chopin 2015-03-10 09:42:35 -06:00
Gregory Nutt cded7ea682 Fix some time value changes; mostly changing greater than 1000000000 to greater than or equal to 1000000000. From Juha Niskanen 2015-02-20 07:07:36 -06:00
Gregory Nutt ad05793c0f msg type should be char * not void * in mq_send, mq_timedsend, mq_receive, and mq_timedreceive. Noted by Pierre-Noel Bouteville 2014-12-05 19:16:14 -06:00
Gregory Nutt fcfe877e96 Cosmetic update to comments 2014-09-29 16:22:21 -06:00
Gregory Nutt b0f80cc8db Move mq_open.c, mq_close.c, and mq_unlink.c from sched/mqueue to fs/mqueue 2014-09-29 13:35:32 -06:00
Gregory Nutt e3fa34681b Convert mqueue structure for use in VFS as inode data; rename mqueue_inode_s; remove links, reference counts and name from mqueue structure. These will be replaced by VFS data. Remove g_msgqueues and mq_findnamed.c; these will be replace with VFS logic 2014-09-29 13:19:11 -06:00
Gregory Nutt ad9b3f8ab8 wdog.h does not contain any application interface, only internal OS interface. Further, it is non-standard. Move wdog.h from include/ to include/nuttx. For the same reason, move the description of the watchdog timer interfaces from the Users Guide to the Porting Guide. 2014-08-21 11:16:55 -06:00
Gregory Nutt d798dd37a7 Replace os_internal.h with sched/sched.h in files that actually reference something in sched.h 2014-08-08 17:53:55 -06:00
Gregory Nutt d4b56eb3cc Move clock functions from sched/ to sched/clock 2014-08-08 14:43:02 -06:00
Gregory Nutt 08879ca34c Move POSIX message queue files from sched/ to sched/mqueue 2014-08-08 12:31:23 -06:00