1. 18 Nov, 2016 37 commits
  2. 17 Nov, 2016 3 commits
    • Benjamin Walsh's avatar
      kernel/arm: fix race condition when setting _Swap() return value · f1c880aa
      Benjamin Walsh authored
      There was a possible race condition when setting the return value of a
      thread that is pending, from an ISR.
      
      A kernel function causes a thread to pend, with the following series of
      steps:
      
      - disable interrupts
      - move current thread to wait_q
      - call _Swap
      
      Depending if running on M3/4 or M0+, _Swap will either issue a svc #0,
      or pend PendSV directly. The same problem exists in both cases.
      
      M3/4:
      __svc will:
      - enable interrupts
      - trigger __pendsv
      
      M0+:
      _Swap() will enable interrupts.
      
      __pendsv will:
      - save register context including PSP into the thread struct
      
      If an interrupt occurs between interrupts being enabled them and
      __pendsv saving PSP, and the ISR sets the pending thread's return value,
      this will happen:
      
      - sees the thread in a wait_q
      - removes it
      - makes it ready
      - calls _set_thread_return_value
      - _set_thread_return_value looks at the thread's saved PSP to poke
        the value
      
      In this scenario, PSP hasn't yet been updated by __pendsv so...
      f1c880aa
    • Sergio Rodriguez's avatar
      samples: aio comparators: Use expected pointer type in printf · 653328c6
      Sergio Rodriguez authored
      
      The data structure member being used  is character array,
      dereferencig this array gives **char instead of the expected
      *char type.
      
      This issue was reported by Coverity
      
      Coverity-CID: 152030
      Coverity-CID: 152033
      
      Change-Id: Ied67e4b2d47017e6ad5e40b9b6fca1b496c483ed
      Signed-off-by: default avatarSergio Rodriguez <sergio.sf.rodriguez@intel.com>
      653328c6
    • Sergio Rodriguez's avatar
      drivers: gpio: Remove contradictory if statement evaluation · d88617db
      Sergio Rodriguez authored
      
      This fixes an always false evaluation of the gpio I/O direction
      
      This issue was reported by Coverity (CID 150821).
      
      Change-Id: I6c0e9fe405cbd3e35454a81754fa0b1c721691f0
      Signed-off-by: default avatarSergio Rodriguez <sergio.sf.rodriguez@intel.com>
      d88617db