1. 23 Aug, 2016 2 commits
  2. 22 Aug, 2016 7 commits
  3. 28 Jun, 2016 1 commit
  4. 16 Jun, 2016 5 commits
    • David Gibson's avatar
      altstack: Don't log internal calls in test cases · c21a1eff
      David Gibson authored
      altstack/test/run.c uses some hairy macros to intercept the standard
      library functions that altstack uses.  This has two purposes: 1) to
      conditionally cause those functions to fail, and thereby test altstack's
      error paths, and 2) log which of the library functions was called in each
      testcase.
      
      The second function isn't actually useful - for the purposes of testing the
      module, we want to check the actual behaviour, not what calls it made in
      what order to accomplish it.  Explicitly checking the calls makes it much
      harder to change altstack's implementation without breaking the tests.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      c21a1eff
    • David Gibson's avatar
      altstack: Don't use 0 pointer literals · 9683a45f
      David Gibson authored
      In a number of places the altstack module uses a literal '0' for pointer
      values.  That's correct C, but doesn't make it obvious on a quick read
      whether values are integers or pointers.  This patch changes those cases
      to use the NULL define instead.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      9683a45f
    • David Gibson's avatar
      altstack: Use ptrint instead of bare casts · 029a45b8
      David Gibson authored
      Functions invoked with altstack take a void * parameter.  However, the
      test program wants to pass an integer, and so uses the trick of casting
      the integer values to (void *) and back again.
      
      The ptrint() module handles exactly this case in a more portable and
      (somewhat) typesafe way, so use that instead.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      029a45b8
    • David Gibson's avatar
      altstack: Restore alternate signal stack state · 15c555b3
      David Gibson authored
      altstack relies on catching a SIGSEGV caused when overrunning the stack.
      This means that the SEGV handler itself can't use the already overflowed
      stack, and so we use sigaltstack() to assign the signal handler a different
      stack.  On completion, altstack() clears the alternate signal stack.
      
      However, it's possible that the calling program could be using
      sigaltstack() for its own reasons, so it's more correct to restore the
      sigaltstack() state to that from the beginning of the altstack() call.
      This patch implements this behaviour.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      15c555b3
    • David Gibson's avatar
      altstack: Consolidate thread-local variables · 2da0271f
      David Gibson authored
      altstack uses a number of __thread variables to track internal state.  This
      allows altstack to be thread-safe, although it's still not re-entrant.
      This patch gathers all these variables into a single per-thread state
      structure.  This makes it easy to see at a glance what the whole of the
      required state is, and thereby easier to reason about correctness of
      changes to the implementation.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      2da0271f
  5. 06 Jun, 2016 3 commits
  6. 05 Jun, 2016 2 commits
  7. 03 Jun, 2016 1 commit
  8. 02 Jun, 2016 6 commits
  9. 31 May, 2016 3 commits
  10. 09 May, 2016 4 commits
  11. 06 May, 2016 1 commit
  12. 03 May, 2016 2 commits
  13. 29 Apr, 2016 3 commits
    • David Gibson's avatar
      Correctly include dependencies for nested modules · 64b9c666
      David Gibson authored
      Currently we pull auto-generated dependencies into the Makefile with
      include ccan/*/*.d.  That will omit any .d files from nested modules,
      meaning things might not be correctly rebuilt there.
      
      Correct this by using the list of modules instead of a 1-level wildcard.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      64b9c666
    • David Gibson's avatar
      Exclude system headers from .d files · 34f380e5
      David Gibson authored
      We currently generated .d dependency files with the -MD option to cc.  That
      includes system header files in the dependencies, which isn't often useful
      and makes the .d more complicated than necessary.
      
      This changes to -MMD which excludes system headers.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      34f380e5
    • David Gibson's avatar
      Clean up use of 'rm' in Makefiles · f1f32a2f
      David Gibson authored
      Most of the ccan Makefiles use $(RM) to remove files.  However, 'rm' is
      traditionally considered one of the few shell tools which can be used in
      Makefiles without indirecting via a variable.
      
      rm is also typically invoked with -f in Makefiles, so that it doesn't cause
      errors if the files don't exist (because they haven't been built).  A
      number of instances in ccan were missing this.
      
      This corrects these warts.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      f1f32a2f