Commit Graph

683 Commits

Author SHA1 Message Date
Max Neklyudov 61af0d511f Use up_timer_gettime for CLOCK_MONOTONIC in tickless mode. From Max Neklyudov. 2015-06-22 06:37:26 -06:00
Juha Niskanen e1846dff82 sched/pthread: Implement pthread_mutex_trylock() for recursive mutexes 2015-06-16 08:32:20 -06:00
Juha Niskanen d16053c33c sched/pthread: Use -1 instead of 0 as PID for unclaimed mutexes 2015-06-16 08:27:38 -06:00
Gregory Nutt d8db596b3b POSIX message queues: Move mq_setattr() and mq_getattr() from nuttx/libc/mqueue to nuttx/sched/mqueue. Also add sysyscall support for mq_setattr() and mq_getattr(). This is necessary in protected and kernel builds because in those cases the message queue structure is protect and cannot be accessed directly from user mode code. Noted by Jouko Holopainen. 2015-06-03 09:24:17 -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 4adda9d428 Fix numerous typos in configuration variable names. Tracked down by Alan Carvalho de Assis 2015-05-23 17:08:35 -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 16276a4793 Change the order of some operations to prevent a debug assertion from firing. 2015-05-18 06:34:54 -06:00
Gregory Nutt cc77a28f40 If HAVE_GROUP_MEMBERS is not defined, then pthread_kill() really is the same as kill() 2015-05-13 20:34:21 -06:00
Gregory Nutt 4417728955 Re-implemened pthread_kill(). It as just a simple wrapper around kill() but since the correct dispatching of singles for multi-threaded task groups has been implemented, calling kill() does no work. The corrected implementation of pthread_kill() will direct the signal specifically to the specific pthread and no other. 2015-05-13 14:43:43 -06:00
Gregory Nutt 8cb4e78a1a Complete implementation of the IPv6 routing logic. From Max Neklyudov. 2015-05-13 07:22:02 -06:00
Gregory Nutt 071658bb6d Another missing semicolon 2015-04-23 07:18:59 -06:00
Gregory Nutt 093a144934 sem_wait(): Missing comma on debug statement caused compile error with DEBUG on. Why hasn't that been noted before? 2015-04-23 07:15:55 -06:00
Gregory Nutt f161a1d0f7 atexit: Fix reference to undefined variable in certain configurations. From Juha Niskanen 2015-04-14 07:31:35 -06:00
Gregory Nutt b4423c1eed Make some file section headers more consistent with standard 2015-04-08 06:47:36 -06:00
Gregory Nutt af6d9e2684 sched: Do not use uninitialized boolean in waitpid(). From Juha Niskanen 2015-03-12 07:45:10 -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 12d61531aa Move board_ prototypes from arch.h to board.h 2015-02-27 20:02:03 -06:00
Gregory Nutt 127951e029 Fix places where the errno value was being overwritten by subsequent actions so that the returned errno value was incorrect. From Max Neklyudov. 2015-02-25 07:45:04 -06:00
Gregory Nutt c99d927527 When an RTC is used, clock_systimespec() must subtract the basetime from the RTC time 2015-02-25 07:24:03 -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 8840102554 Networking: Divide net_intiialize() into net_setup() and net_initialize() to solve a chicken-and-egg problem. net_setup() must be caleld before up_initialize() is called so that networking data structures are ready to register new network devices.
net_initialize() now does only timer related operations and is called AFTER up_initialize() where the timers are configured.  This is really.
2015-02-14 06:36:53 -06:00
Gregory Nutt a1d3faaa8a Update ChangeLog 2015-02-13 18:39:43 -06:00
Gregory Nutt bc273596bb Back out commit d998cbdfa6c10dbd8074dd43c39c23a006505987 2015-02-13 18:32:15 -06:00
Gregory Nutt 0fcd620404 Move the initialization of the networking subsystem to AFTER up_initialize is called. Fromo Macs Neklyudov. 2015-02-13 13:41:21 -06:00
Gregory Nutt 3724a5e98e RTC: Remove all backdoor interfaces from rtc.h 2015-02-13 08:41:34 -06:00
Gregory Nutt d9f960e97b Fix a problem in clock_systimer64 that occurs when (1) the 64-bit system time is enabled, and (2) the value of CONFIG_USEC_PER_TICK is less than 1 millisconds (such as when using the tickless mode of operation). In that case, the convertion of time to 64-bit millisecond value in clock_systmer64() causes some bad times to be returned. Time was converted to milliseconds, then to configured ticks. Precision was lost in the millisecond convertion.
The fix is to first convert time to a 64-bit microsecond value, then to the configured tick value.

Noted by David Sidrane.
2015-02-13 06:13:47 -06:00
Gregory Nutt 147042218b gettimeofday() and settimeofday(): Move gittimeofdady() from sched/clock to libc/time. All remove gettimeofday() from NuttX system calls. It is only a wrapper around clock_settime() and does not need a trap. gettimeofday() is no longer tried as a core OS interface.
gettimeofday has been decremented in POSIX 2008.  settimeofday() was never part of POSIX, but I decided to add it to libc as well just for symmetry.
2015-02-12 11:10:46 -06:00
Gregory Nutt 1d534ff896 Convert the 64-bit usec limit to a 32-bit tick limit 2015-02-03 07:18:17 -06:00
Gregory Nutt c5ab7c39d3 Eliminates a warning. From Macs N 2015-02-03 06:44:59 -06:00
Gregory Nutt a448e0f69f On my platform I have just 16-bit timer clocked at 32kHz. As result oneshot timer max delay is 2s. The patch adds limit of maximum ticks in sched_timer_start (nuttx/sched/sched/sched_timerexpiration.c). From Macs N. 2015-02-03 06:25:19 -06:00
Gregory Nutt e69003cbf7 clock_systimespec(): Fixes for compilation errors in certain configurations. From Macs N. 2015-01-30 08:19:40 -06:00
Gregory Nutt 6bc9a0c9c6 Fix backward calculation in the work queue timing. From Liio Chen via the PX4 repository 2015-01-27 06:17:02 -06:00
Gregory Nutt 826f5516ff Semaphores: sem_waitirq.c must be built when signals are disabled. That is because not handles not only the case of semaphore wait being awakened by a signal, but also the case with sem_timedwait.c when the semaphore wait is awakened by a timeout. 2014-12-28 15:03:12 -06:00
Gregory Nutt 78b755961f Semahores: Remove a warning with SIGNALS are disabled 2014-12-28 14:54:40 -06:00
Gregory Nutt 937f9f23f1 strncpy will not copy the terminating \0 into the destination if the source is larger than the size of the destination. Ensure that the last byte is always zero and let strncpy only copy CONFIG_TASK_NAME_SIZE bytes. The issue of unterminated names can be observed in ps when creating a pthread while CONFIG_TASK_NAME_SIZE is set to 8. 2014-12-17 12:24:02 -06:00
Gregory Nutt b3a1939020 Sempahores: Add logic to clean up after task_delete() or pthread_cancel() if the task happens to be waiting on a semaphore when it is cancelled 2014-12-13 12:02:25 -06:00
Gregory Nutt 1003ee3e9a Costmetic change to a comment 2014-12-13 10:41:57 -06:00
Gregory Nutt ff87e2e02a In message queue created return ENOSPC error if size exceeds the configured size of pre-allocatd messages; Use ENOSPC vs ENOMEM per OpenGroup.org. From Pierre-Noel Bouteville 2014-12-06 07:18:48 -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 2ab604f74f Fix more issues detected by cppcheck 2014-11-25 14:25:02 -06:00
Gregory Nutt 1aa528a572 More fixes to problems noted by cppcheck. Some are kind of risky; some are real bugs. 2014-11-25 14:10:35 -06:00
Gregory Nutt 6f94e5e4be Cosmetic chnages to comments 2014-11-20 07:10:48 -06:00
Gregory Nutt 8c28718bcb alling mq_timedreceived with immediate timeout was getting stuck and not
timeout. Immediate timeout is achieved by setting absolute timeout value to
past time, for example abstime={ .tv_sec=0, .tv_nsec=0 }. However absolute
time was converted to relative time using unsigned integer arithmetic and
resulted large ticks count by clock_abstime2ticks, instead of expected negative
ticks value.

Patch corrects clock_abstime2ticks to return negative ticks, if absolute time
is in the past.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@haltian.com>
2014-11-19 09:25:00 -06:00
Gregory Nutt 9e290c10b5 Fix some compile issues introduces with removal of CONFIG_MAX_TASK_ARGS 2014-11-14 09:53:11 -06:00
Gregory Nutt 838f2053e4 Fix some compile errors introduce in last commits 2014-11-13 07:44:45 -06:00
Gregory Nutt bc265d74e7 task_create: Don't even try if the accumulated size of the argument list is larger than the stack 2014-11-13 06:44:15 -06:00
Gregory Nutt bb9b0f572d vfork no longer depends on CONFIG_MAX_TASK_ARGS 2014-11-12 19:01:29 -06:00