Nobutaka Toyoshima
150036eb8b
sched: Fix tg_flags check with GROUP_FLAG_NOCLDWAIT
...
Jira: PDFW15IS-208
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2017-04-14 14:50:44 +09:00
Juha Niskanen (Haltian)
b4747286b1
Add logic to disable cancellation points within the OS. This is useful when an internal OS function that is NOT a cancellation point calls an OS function which is a cancellation point. In that case, irrecoverable states may occur if the cancellation is within the OS.
2017-04-11 11:03:25 -06:00
Gregory Nutt
c08ba10d32
include/: Add some definitions needed by apps/wireless/wapi
2017-04-10 14:56:23 -06:00
Gregory Nutt
c36bf090f0
pthread: Minor logic fix in pthread_mutex_consistent. Updat some comments.
2017-04-10 10:10:41 -06:00
Gregory Nutt
948332ca34
pthreads: Backed most of last pthread changes. Found the 'real' root poblem. A one like error in pthread_mutex.c.
2017-04-10 09:51:03 -06:00
Gregory Nutt
b51b72b2db
pthreads: Re-order some operations so that mutexes are placed in the inconsistent state BEFORE the clean-up callbacks are called.
2017-04-10 08:11:16 -06:00
Jussi Kivilinna
dffb8a67e3
Add entropy pool and strong random number generator
...
Entropy pool gathers environmental noise from device drivers, user-space, etc., and returns good random numbers, suitable for cryptographic use. Based on entropy pool design from *BSDs and uses BLAKE2Xs algorithm for CSPRNG output.
Patch also adds /dev/urandom support for using entropy pool RNG and new 'getrandom' system call for getting randomness without file-descriptor usage (thus avoiding file-descriptor exhaustion attacks). The 'getrandom' interface is similar as 'getentropy' and 'getrandom' available on OpenBSD and Linux respectively.
2017-03-30 07:38:37 -06:00
Gregory Nutt
eb344d7260
Fix an assertion noted by Jussi Kivilinna.
...
This was a consequence of the recent robust mutex changes. If robust mutexes are selected, then each mutex that a thread takes is retained in a list in threads TCB. If the thread exits and that list is not empty, then we know that the thread exitted while holding mutexes. And, in that case, each will be marked as inconsistent and the any waiter for the thread is awakened.
For the case of pthread_mutex_trywait(), the mutex was not being added to the list! while not usually a fatal error, this was caught by an assertion when pthread_mutex_unlock() was called: It tried to remove the mutex from the TCB list and it was not there when, of course, it shoule be.
The fix was to add pthread_mutex_trytake() which does sem_trywait() and if successful, does correctly add the mutext to the TCB list. This should eliminated the assertion.
2017-03-29 07:50:40 -06:00
Gregory Nutt
941360bf12
Correct some spacing
2017-03-27 10:49:41 -06:00
Gregory Nutt
b07d3fc305
Rename CONFIG_MUTEX_TYPES to CONFIG_PTHREAD_MUTEX_TYPES
2017-03-27 09:08:14 -06:00
Gregory Nutt
f2f798cb29
pthread mutexes: Finish logic to support configuration mutex robustness.
2017-03-27 08:50:45 -06:00
Gregory Nutt
666208cf23
pthread mutexes: Add option to support both unsafe and robust mutexes via pthread_mutexattr_get/setrobust().
2017-03-26 18:37:24 -06:00
Gregory Nutt
8b3c554e45
pthreads: Add a configuration option to disable robust mutexes and revert to the traditional unsafe mutexes.
2017-03-26 17:37:28 -06:00
Gregory Nutt
86ab384d77
Forget to add some files in previous commits
2017-03-26 15:46:19 -06:00
Gregory Nutt
8b23c16b90
pthreads: pthread_mutex_consistent() needs to clear flags.
2017-03-26 14:44:57 -06:00
Gregory Nutt
34c5e1c18f
Minor cleanup from recent changes.
2017-03-26 14:04:07 -06:00
Gregory Nutt
5a69453e16
pthreads: Add some assertions.
2017-03-26 13:54:43 -06:00
Gregory Nutt
fe03ef02c4
when pthread exits or is cancelled, mutexes held by thread are marked inconsistent and the highest priority thread waiting for the mutex is awakened.
2017-03-26 13:37:05 -06:00
Gregory Nutt
6e623ce06f
pthreads: Partial implementation of final part of robust mutexes: Keep list of all mutexes held by a thread in a list in the TCB.
2017-03-26 12:46:57 -06:00
Gregory Nutt
2c37d369ab
pthread: Fix return value of pthread_give/takesemaphore(). Add option to pthread_takesemaphore to ignore EINTR or not.
2017-03-26 11:22:17 -06:00
Gregory Nutt
363403fb1f
pthreads: Add more robustness characteristics: pthread_mutex_lock() and trylock() will now return EOWNERDEAD if the mutex is locked by a thread that no longer exists. Add pthread_mutex_consistent() to recover from this situation.
2017-03-26 10:35:23 -06:00
Gregory Nutt
5fb85451cb
Update some comments
2017-03-22 08:08:43 -06:00
Gregory Nutt
f5a957158d
Review of last PR: Setting CONFIG_SMP_NCPUS=1 should only be permitted in a debug configuration.
2017-03-22 06:29:38 -06:00
Masayuki Ishikawa
a1f0802855
Kconfig: Change the minimum SMP_NCPUS to 1
2017-03-22 10:04:37 +09:00
Gregory Nutt
6893843cc5
sched/semaphore: Fix a warning aout an unused variable when priority inheritance is enabled.
2017-03-21 13:47:56 -06:00
Gregory Nutt
e8e3c2f362
sched/semaphore: Convert strange use of DEBUGASSERT to DEBUGPANIC.
2017-03-21 13:34:17 -06:00
David Sidrane
d76157db7b
sem_holder:Clean up from Review
...
Spelling and backward DEBUGASSERT along with one gem
if (sem->holder[0].htcb != NULL || sem->holder[**1**].htcb != NULL)
2017-03-21 08:03:06 -10:00
David Sidrane
7601a27cee
sem_holder:The logic for the list version is unchanged
2017-03-16 14:16:18 -10:00
David Sidrane
3cc2a4f7c9
sem_holder: Fixes improper restoration of base_priority
...
in the case of CONFIG_SEM_PREALLOCHOLDERS=0
The call to sem_restorebaseprio_task context switches in the
sem_foreachholder(sem, sem_restoreholderprioB, stcb); call
prior to releasing the holder. So the running task is left
as a holder as is the started task. Leaving both slots filled
Thus failing to perforem the boost/or restoration on the
correct tcb.
This PR fixes this by releasing the running task slot prior
to reprioritization that can lead to the context switch.
To faclitate this, the interface to sem_restorebaseprio
needed to take the tcb from the holder prior to the
holder being freed. In the failure case where sched_verifytcb
fails it added the overhead of looking up the holder.
There is also the adfitinal thunking on the foreach to
get from holer to holder->tcb.
An alternate approach could be to leve the interface the same
and allocate a holder on the stack of sem_restoreholderprioB
copy the sem's holder to it, free it as is done in this pr
and and then pass that address sem_restoreholderprio as the
holder. It could then get the holder's tcb but we would
keep the same sem_findholder in sched_verifytcb.
2017-03-15 17:12:45 -10:00
David Sidrane
55fb9645a7
Guard from pend_reprios overlow
2017-03-15 07:42:55 -10:00
David Sidrane
caf8bac7fb
missing semi
2017-03-13 22:54:13 +00:00
David Sidrane
d66fd9f965
semaphore:sem_boostholderprio prevent overrun of pend_reprios
...
The second case rtcb->sched_priority <= htcb->sched_priority
did not check if there is sufficient space in the pend_reprios
array.
2017-03-13 12:34:39 -10:00
David Sidrane
3c00651cfe
semaphore:sem_holder sem_findholder missing inintalization of pholder
...
sem_findholder would fail and code optimization coverd this up.
2017-03-13 11:56:31 -10:00
David Sidrane
4d760c5ea4
semaphore:sem_holder add DEBUGASSERT s
2017-03-13 10:46:26 -10:00
Gregory Nutt
399f306744
A few cosmetic changes
2017-03-11 08:58:42 -06:00
David Sidrane
6cc8f9100b
Priority Inversion fixes:typo
2017-03-10 06:37:46 -10:00
Gregory Nutt
360539afac
Priority inheritance: When CONFIG_SEM_PREALLOCHOLDERS==0, there is only a single, hard-allocated holder structure. This is problem because in sem_wait() the holder is released, but needs to remain in the holder container until sem_restorebaseprio() is called. The call to sem_restorebaseprio() must be one of the last things the sem_wait() does because it can cause the task to be suspended. If in sem_wait(), a new task gets the semaphore count then it will fail to allocate the holder and will not participate in priority inheritance. This fix is to add two hard-allocated holders in the sem_t structure: One of the old holder and one for the new holder.
2017-03-10 09:30:15 -06:00
Gregory Nutt
a93e46d00c
Cosmetic
2017-03-10 08:54:50 -06:00
Gregory Nutt
c976a66f8d
net/drivers/skeleton.c: Back out serialization changes of the last commit. They are not necessary in the skeleton.c example because the calls to net_lock() at the beginning of each worker function will enforce serialization.
2017-03-04 11:33:36 -06:00
Gregory Nutt
b55a98e900
Olimex-STM32-P407: Enable task names
2017-03-04 08:49:24 -06:00
Gregory Nutt
47ebe1e320
Update some comments
2017-03-03 12:48:58 -06:00
Gregory Nutt
e1218c4b4b
Smaller vector tables: Add irq_mapped_t.
2017-03-03 10:20:40 -06:00
Gregory Nutt
04c9ccdd2d
Update TODO list and some Kconfig comments.
2017-03-03 09:20:25 -06:00
Gregory Nutt
c2b620b4f8
Implements support for smaller interrupt tables as described at http://www.nuttx.org/doku.php?id=wiki:howtos:smallvectors . This is largely the work of Mark Schulte. However, I have made several changes to match with the Wiki document. If you like the change, thanks go to Marc. For any errors you can blame me.
2017-03-03 09:20:25 -06:00
Masayuki Ishikawa
d78113e4ad
Revert "CONFIG_START_YEAR/MONTH/DAY not required if an RTC is used"
...
This reverts commit 4035ed8c6c
.
2017-03-03 10:42:10 +09:00
Masayuki Ishikawa
54b1f5ce2a
Merged in masayuki2009/nuttx.nuttx/remove_unused_variable (pull request #233 )
...
Remove unused variable
Approved-by: Gregory Nutt
2017-03-02 12:39:32 +00:00
Gregory Nutt
094795e0ed
Review parameter usage in sigtimedwait(); update some comments.
2017-03-02 06:39:05 -06:00
Masayuki Ishikawa
237e041fba
Remove an unused variable when calling sigwaitinfo()
2017-03-02 13:14:00 +09:00
Masayuki Ishikawa
4043239cfc
Remove an unused variable when calling sigtimedwait()
2017-03-02 13:13:53 +09:00
Gregory Nutt
02b1e1ec1a
Fixes for coding standard: '*' needs to 'snuggle' with following variable name
2017-02-28 18:22:57 -06:00