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
Gregory Nutt
4638a97f97
task_start() no longer depends on CONFIG_MAX_TASK_ARGS
2014-11-12 18:54:35 -06:00
Gregory Nutt
ffbd6cf10a
task_setup() no longer depends on CONFIG_MAX_TASK_ARGS
2014-11-12 18:49:58 -06:00
Gregory Nutt
fcffafee30
Remove CONFIG_MAX_TASK_ARGS from all Kconfigs and defconfigs
2014-11-12 18:02:19 -06:00
Gregory Nutt
2caeead612
Fix an important bug in the watchdog creation logic
2014-11-10 18:15:26 -06:00
Gregory Nutt
fcc2a1bb4b
Fix incorrect comment
2014-11-07 15:54:24 -06:00
Gregory Nutt
2da26f7884
More fixes to tickless operation, alarm/mode code. From Brandon Warhurst
2014-10-23 07:13:57 -06:00
Gregory Nutt
a7a5c8cff3
Fixes to tickless operation code. From Brandon Warhurst
2014-10-23 06:41:31 -06:00
Gregory Nutt
928b0bda3d
Default for CONFIG_SCHED_HPWORK should be no
2014-10-14 16:56:37 -06:00
Gregory Nutt
179fabb019
Add description of work queues to the porting guide. Update comments
2014-10-14 10:21:18 -06:00
Gregory Nutt
c9563da832
Missing workqueue logic
2014-10-12 17:19:51 -06:00
Gregory Nutt
e702d9396b
Fix one missed name change from last big commit
2014-10-12 07:09:57 -06:00
Gregory Nutt
c9d7472d68
Change naming of HP work queue configuration varaibles to be symmetric with LP work queue naming
2014-10-11 17:03:44 -06:00
Gregory Nutt
1a27a4d4c0
Eliminate warnings
2014-10-11 17:02:35 -06:00
Gregory Nutt
b78fe7c270
Rename CONFIG_SCHED_USRWORK to CONFIG_LIB_USRWORK
2014-10-11 15:59:40 -06:00
Gregory Nutt
9292e3d9de
Decouple the user-space work queue from the kernel space work queues
2014-10-11 15:50:22 -06:00
Gregory Nutt
bb1d91bd83
Make building of low-priority work queue independent of also building the high-priority work queue
2014-10-11 14:43:24 -06:00
Gregory Nutt
c0b703ac73
Fix some missing conditional compilation that caused build failures in some configurations
2014-10-11 08:50:00 -06:00
Gregory Nutt
d2424ac65c
Fix a couple of problems introduced in the last commmits
2014-10-11 08:29:26 -06:00
Gregory Nutt
0218f01f12
If there mutliple low-priority worker threads, only one needs to perform garbage collection
2014-10-11 07:09:21 -06:00
Gregory Nutt
234f73cb09
Add logic for priority inheritance with multiple worker threads. How should this work? Tentatively, the all get reprioritized together. It would be best to just reprioritize the single thread doing the high priority work, but we don't know which that will be in advance
2014-10-10 17:47:39 -06:00
Gregory Nutt
4a4b3ac537
Add support for multiple low-priority worker threads
2014-10-10 16:24:50 -06:00
Gregory Nutt
438e3e1a90
Fix a few bugs introduced in the last checkin
2014-10-10 15:06:13 -06:00
Gregory Nutt
cf59a195ba
User-mode work queue logic should not disable interrupts
2014-10-10 14:52:04 -06:00
Gregory Nutt
16a3e83258
Add support for delays of different durations in work queue processing
2014-10-10 13:21:37 -06:00
Gregory Nutt
75e7a4dbfc
Minor changes to work queue timing logic
2014-10-10 12:27:11 -06:00
Gregory Nutt
b2cebaa9d4
Modularize starting of worker threads to better isolate individual initialization characteristics
2014-10-10 09:38:28 -06:00
Gregory Nutt
2015fd76e2
Fix some conditional logic in last work queue repartitioning change
2014-10-10 08:47:41 -06:00
Gregory Nutt
1afc9773ac
Decoupling work queue data structures. This is part of the preparation to support multiple low-priority worker threads
2014-10-10 08:35:58 -06:00
Gregory Nutt
6220256a09
Repartition work queue code. Move kernel-specific parts from libc/wqueue to sched/wqueue
2014-10-10 06:22:51 -06:00
Gregory Nutt
7f36c4e97b
Update some Kconfig comments; Add a upper limit on the lower priority worker thread for priority inheritance
2014-10-07 17:11:26 -06:00
Gregory Nutt
322f9f401c
Simplify how C source files are selected in the build
2014-10-07 07:42:36 -06:00
Gregory Nutt
d7843c8e24
Add support for priority inheritance on the low priority worker queue
2014-10-07 07:41:52 -06:00
Gregory Nutt
38ddbc774f
Cosmetic change to comments
2014-10-06 18:03:01 -06:00
Gregory Nutt
37cf4135c4
fs_initialize() is no longer weak
2014-10-06 11:45:35 -06:00
Gregory Nutt
d914f3ceec
Major structure of file system functions to better support asynchronous I/O. Respository should not be trusted until I have a chance to verify everything
2014-10-06 10:53:25 -06:00
Gregory Nutt
87eb1d47ed
Fix some recently introduced typos, build problems, and warnings
2014-10-05 16:58:52 -06:00
Gregory Nutt
652d3ed29d
Rename CONFIG_LIBC_AIO to CONFIG_FS_AIO since it is now an OS property
2014-10-05 15:44:43 -06:00
Gregory Nutt
31cdcde73a
Add definitions for SIGPOLL
2014-10-05 06:02:37 -06:00
Gregory Nutt
da29907ac9
Update TODO list + cosmetic changes to clock_systimer.c
2014-10-03 11:21:35 -06:00
Gregory Nutt
8d43a6bdcd
Fix build error with CONFIG_SYSTEM_TIME64
2014-10-03 10:20:46 -06:00
Gregory Nutt
71b574f26c
Repartition some message queue logic: sched/mqueue should have all mqueue knowledge; fs/mqueue should deal only with inodes
2014-09-30 08:03:39 -06:00
Gregory Nutt
fcfe877e96
Cosmetic update to comments
2014-09-29 16:22:21 -06:00
Gregory Nutt
1f2cc9f4fe
Complete re-implementation of mq_close
2014-09-29 15:33:34 -06:00
Gregory Nutt
584d0fe4ad
Complete re-implementation of mq_open()
2014-09-29 14:59:31 -06:00
Gregory Nutt
9e975a217d
Separate mqueue allocation logic from mq_open() and put it in sched/mqueue/mq_msgqalloc.c
2014-09-29 14:09:31 -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
542e706d7d
Fix a perverse case where vfork() is called from a pthread. Still not recommended
2014-09-29 12:21:34 -06:00
Gregory Nutt
1dc9768c1a
Fix vfork(). Now that arguments are kept on the stack, the way that arguments are passed from parent to child in vfork() must change. This bug has always been present, but was not visible with the old strdup() way of passing arguments
2014-09-29 10:45:44 -06:00
Gregory Nutt
9a3f18db37
Fix missing header file for bug introduced yesterday
2014-09-29 07:48:45 -06:00
Gregory Nutt
8c958be5ab
Semaphore initialization is now only required if priority inheritance is initialized
2014-09-29 06:50:48 -06:00
Gregory Nutt
650a0d0615
Completes VFS-based named semaphore implemetation. Still a little buggy
2014-09-28 15:58:56 -06:00
Gregory Nutt
30694f064c
Add VFS-based sem_open() implementation
2014-09-28 14:35:17 -06:00
Gregory Nutt
a41c1de32c
Add basic data structures that will allow us to move named semaphore support out of the OS and into the VFS (not complete).
2014-09-28 10:15:33 -06:00
Gregory Nutt
b33c2d9cef
Move include/nuttx/mm.h to include/nuttx/mm/mm.h
2014-09-24 07:29:09 -06:00
Gregory Nutt
1863370672
Move include/nuttx/shm.h to include/nuttx/mm/shm.h
2014-09-24 07:05:02 -06:00
Gregory Nutt
835c91b03a
Add support for a per-process virtual page allocator. This is a new member of the task_group_s structure. The allocaor must be initialized when a new user process is started and uninitialize when the process group is finally destroyed. It is used by shmat() and shmdt() to pick the virtual address onto which to map the shared physical memory.
2014-09-23 16:04:39 -06:00
Gregory Nutt
e326fcfef3
Fix some inconsistent field name in struct task_group_s: addrenv should be tg_addrenv.
2014-09-23 16:01:44 -06:00
Gregory Nutt
a73a3ef99f
Add shared memory initializatin logic
2014-09-23 08:46:31 -06:00
Gregory Nutt
5d9276ed71
More changes so that the KNSH build survives the changes needed for the ELF build
2014-09-16 15:55:21 -06:00
Gregory Nutt
1ef758d67f
A couple more changes for clean ELF build
2014-09-16 15:40:48 -06:00
Gregory Nutt
925fc9ad81
First round of changes to get the ELF configuration building again
2014-09-16 15:37:05 -06:00
Gregory Nutt
701719b2ca
Don't release user stack in kernel build. Already destroyed with all of the address environment
2014-09-15 12:45:41 -06:00
Gregory Nutt
a5e30ac4a1
execv() is a basic system interface. It should not be in libc/ but rather in sched/task. Its symboltable helper logic also belongs in the kernel but belings in binfmt/ with the other symbol table logic
2014-09-15 10:16:20 -06:00
Gregory Nutt
da7a440b35
execv() is a basic system interface. It should not be in libc/ but rather in sched/task. Its symboltable helper logic also belongs in the kernel but belings in binfmt/ with the other symbol table logic
2014-09-15 10:15:19 -06:00
Gregory Nutt
3649dab9bd
Initial integration of kernel stack (does not work)
2014-09-14 11:19:34 -06:00
Gregory Nutt
e12213592b
Don't build task_create() or task_spawn() interfaces if there is an addres environment
2014-09-14 08:22:21 -06:00
Gregory Nutt
eae146d641
Kernel proxy thread should be a kernel thread, not a user task
2014-09-14 08:20:40 -06:00
Gregory Nutt
ba7d5acf94
Fix a couple more places where the wrong allocator is being used
2014-09-11 15:56:04 -06:00
Gregory Nutt
fc35e35165
When a privileged thread exits, we have to use the kernel alloctor to free memory; when an unprivileged thread exits, we don't have to do anything... heap memory will be cleaned up when the address environment is torn down
2014-09-11 09:00:10 -06:00
Gregory Nutt
44499ed46c
Rename some functions and reshuffling some paramters
2014-09-11 08:37:06 -06:00