Skip to content
  1. Oct 07, 2017
  2. Oct 06, 2017
    • Gregory Nutt's avatar
    • Gregory Nutt's avatar
      3b67c067
    • Gregory Nutt's avatar
      drivers/serial/tcdrain: tcdrain() was recently added to the NuttX C library. ... · 5b04c25d
      Gregory Nutt authored
      drivers/serial/tcdrain:  tcdrain() was recently added to the NuttX C library.  But there is a problem.  The specification of tcdrain() requires that it be a cancellation point.  In order to do this, tcdrain was moved from the C library into the OS and the addition cancellation point hooks were added.  In non-FLAT builds, access via system calls is also now supported.
      5b04c25d
    • Gregory Nutt's avatar
      Adds new OS internal functions nxsig_sleep() and nxsig_usleep. These differ... · 936df1bc
      Gregory Nutt authored
      Adds new OS internal functions nxsig_sleep() and nxsig_usleep.  These differ from the standard sleep() and usleep() in that (1) they don't cause cancellation points, and (2) don't set the errno variable (if applicable).  All calls to sleep() and usleep() changed to calls to nxsig_sleep() and nxsig_usleep().
      
      Squashed commit of the following:
      
          Change all calls to usleep() in the OS proper to calls to nxsig_usleep()
      
          sched/signal:  Add a new OS internal function nxsig_usleep() that is functionally equivalent to usleep() but does not cause a cancellaption point and does not modify the errno variable.
      
          sched/signal:  Add a new OS internal function nxsig_sleep() that is functionally equivalent to sleep() but does not cause a cancellaption point.
      936df1bc
    • Gregory Nutt's avatar
      This commit adds internal versions of the signal interfaces: · fdd0dcc0
      Gregory Nutt authored
        sigtimedwait() -> nxsig_timedwait()
        sigwaitinfo()  -> nxsig_waitinfo()
        nanosleep()    -> nxsig_nanosleep()
      
      The internal OS versions differ from the standard application interfaces in that:
      
        - They do not create cancellation points, and
        - they do not modify the application's errno variable
      
      Squashed commit of the following:
      
          sched/signal:  Replace all usage of sigwaitinfo(), sigtimedwait(), and nanosleep() with the OS internal counterparts nxsig_waitinfo(), nxsig_timedwait(), and nxsig_nanosleep().
      
          sched/signal:  Add nxsig_nanosleep().  This is an internal OS version of nanosleep().  It differs in that it does not set the errno varaiable and does not create a cancellation point.
      
          sched/signal:  Add nxsig_timedwait() and nxsig_waitinfo().  These are internal OS versions of sigtimedwait() and sigwaitinfo().  They differ in that they do not set the errno varaiable and they do not create cancellation points.
      fdd0dcc0
    • Gregory Nutt's avatar
      fs/vfs and net/socket: fcntl() is not return success fail for F_SETFL. ... · aeb3944f
      Gregory Nutt authored
      fs/vfs and net/socket:  fcntl() is not return success fail for F_SETFL.  Reported by Jussi Kivilinna.
      aeb3944f
    • Jussi Kivilinna's avatar
  3. Oct 05, 2017
    • Gregory Nutt's avatar
      Revert "sem_wait.c edited online with Bitbucket. Fix some correct but useless code." · 21c97b16
      Gregory Nutt authored
      What was I thinking?  I missed that litle minus sign and the possibility that the errno might be some positive non-zero value.
      
      This reverts commit 43880878.
      21c97b16
    • Gregory Nutt's avatar
    • Gregory Nutt's avatar
      This change renames all internal, private NuttX signal-related functions to... · 8198ba6a
      Gregory Nutt authored
      This change renames all internal, private NuttX signal-related functions to use the prefix nxsig_ so that they cannot be confused with application interfaces that begin, primarily, with sig_
      
      This is analogous to similar renaming that was done previously for semaphores.
      
      Squashed commit of the following:
      
          sched/signal:  Fix a few compile warnings introduced by naming changes.
      
          sched/signal:  Rename all private, internal signl functions to use the nxsig_ prefix.
      
          sched/signal:  Rename sig_removependingsignal, sig_unmaskpendingsignal, and sig_mqnotempty to nxsig_remove_pendingsignal, nxsig_unmask_pendingsignal, and nxsig_mqnotempty to make it clear that these are OS internal interfaces.
      
          sched/signal:  Rename sig_findaction and sig_lowest to nxsig_find_action and nxsig_lowest to make it clear that these are OS internal interfaces.
      
          sched/signal:  Rename sig_allocatepingsigaction and sig_deliver to nxsig_alloc_pendingsigaction and nxsig_deliver to make it clear that these are OS internal interfaces.
      
          sched/signal:  Rename sig_cleanup, sig_release, sig_releasependingaction, and sig_releasependingsignal to nxsig_cleanup, nxsig_release, nxsig_release_pendingaction, and nxsig_release_pendingsignal to make it clear that these are OS internal interfaces.
      
          sched/signal:  Rename sig_tcbdispatch and sig_dispatch to nxsig_tcbdispatch and nxsig_dispatch to make it clear that these are OS internal interfaces.
      
          sched/signal:  Rename sig_releaseaction and sig_pendingset to nxsig_release_action and nxsig_pendingset to make it clear that these are OS internal interfaces.
      
          sched/signal:  Rename sig_initialize and sig_allocateactionblock to nxsig_initialize and nxsig_alloc_actionblock to make it clear that these are OS internal interfaces.
      8198ba6a
    • Gregory Nutt's avatar
      sched/semaphore: sem_trywait() modifies the errno value and, hence, should... · 7cc63f90
      Gregory Nutt authored
      sched/semaphore:  sem_trywait() modifies the errno value and, hence, should not be used within the OS.  Use nxsem_trywait() instead.
      7cc63f90
    • Gregory Nutt's avatar
      sched/semaphore: sem_timedwait() is a cancellation point and, hence, cannot... · 29b5b366
      Gregory Nutt authored
      sched/semaphore:  sem_timedwait() is a cancellation point and, hence, cannot be called from within the OS.  Created nxsem_timedwait() that is equivalent but does not modify the errno and does not cause cancellation.  All calls to sem_timedwait() change to calls to nxsem_timedwait() in the OS.
      29b5b366
  4. Oct 04, 2017
    • Gregory Nutt's avatar
      Squashed commit of the following: · 9568600a
      Gregory Nutt authored
          This commit backs out most of commit b4747286.  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.
      9568600a
  5. Oct 03, 2017
    • Gregory Nutt's avatar
      Squashed commit of the following: · 42a07966
      Gregory Nutt authored
          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
      42a07966
    • Gregory Nutt's avatar
      Squashed commit of the following: · 83cdb0c5
      Gregory Nutt authored
          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.
      83cdb0c5
    • Juha Niskanen's avatar
      Merged in juniskane/nuttx_stm32l4/stm32l4_rtc_pm_fixes_pr (pull request #502) · 2997a49e
      Juha Niskanen authored
      
      
      STM32L4 RTC, PM: small fixes to subseconds handling, ADC power-management hooks
      
      * STM32L4 ADC: add PM hooks from Motorola MDK
      
      * STM32L4 RTC: add up_rtc_getdatetime_with_subseconds
      
      * STM32 RTC: workaround for potential subseconds race condition
      
          In all recent STM32 chips reading either RTC_SSR or RTC_TR is supposed to lock
          the values in the higher-order calendar shadow registers until RTC_DR is read.
          However many old chips have in their errata this silicon bug (at least F401xB/C,
          F42xx, F43xx, L15xxE, L15xVD and likely others):
      
          "When reading the calendar registers with BYPSHAD=0, the RTC_TR and RTC_DR
          registers may not be locked after reading the RTC_SSR register. This happens
          if the read operation is initiated one APB clock period before the shadow
          registers are updated. This can result in a non-consistency of the three
          registers. Similarly, RTC_DR register can be updated after reading the RTC_TR
          register instead of being locked."
      
      * STM32L4 RTC: correct RTC_SSR and RTC_TR read ordering
      
          In all recent STM32 chips reading either RTC_SSR or RTC_TR is supposed to lock
          the values in the higher-order calendar shadow registers until RTC_DR is read.
          Change the register read ordering to match this and don't keep a workaround
          for a hypothetical race condition (not in any L4 errata, lets for once assume
          ST's silicon works as it is documented...)
      
      * STM32L4 PM: remove useless #ifdefs and old non-L4 STM32 code
      
      Approved-by: default avatarGregory Nutt <gnutt@nuttx.org>
      2997a49e
    • Gregory Nutt's avatar
    • Gregory Nutt's avatar
      syscall/: The non-standard interface exec() is now enshrined as a official... · 8e966546
      Gregory Nutt authored
      syscall/:  The non-standard interface exec() is now enshrined as a official NuttX API.  I really dislike doing this but I think that this is probably the only want to load programs in the protected mode.  It is currently used by some example code under apps/ that generate their own symbol tables for linking.  Other file execution APIs relay on a symbol table provided by the OS.  In the protected mode, the OS cannot provide any meaning symbol table for execution of code in the user-space blob so that is they exec() is really needed in that build case.  And, finally, the interface is completely useless and will not be supported in the KERNEL build mode where the contrary is true:  An application process cannot provide any meaning symbolic information for use in linking a different process.
      8e966546
  6. Oct 02, 2017
  7. Oct 01, 2017