1. 10 Jan, 2016 1 commit
    • Charlie Jacobsen's avatar
      static-cptr-cache: Changes cptr cache defs to use statically alloc'd bmaps. · 48ee0d11
      Charlie Jacobsen authored
      That is, the bitmaps are now arrays inside the cptr cache, rather
      than pointers. We need this for LCDs because the cptr cache needs
      to be up and running before we even initialize the page allocator
      and malloc.
      
      I need to tweak the code slightly next.
      
      Note: I considered using a packed struct for cptr's, with char
      fields. But I realized the allocation algorithm would become a little
      less efficient, due to extra required calculations. The advantage of
      the current algorithm is that, because the cnode table size is
      a power of 2 *and* the bits are packed (they would no longer be
      packed if we used chars, unless the cnode table size was 512), translating
      a bitmap index to a path in the cspace radix tree is really simple.
      If we switched to a struct with char's, such as:
      
          struct cptr {
             char level;
             char path[CAP_CSPACE_DEPTH];
             char slot;
          };
      
      we would need to do a handful of bit shifts and masks to set up
      these fields properly. (For the current algorithm, there's just
      one bitwise OR to set the level bits.)
      
      I also realized the bit-level ops we currently use are not that
      bad/obscure. We just sacrifice a slight amount of clarity.
      48ee0d11
  2. 09 Jan, 2016 2 commits
    • Charlie Jacobsen's avatar
      Adds free to kernel version. · 96adabf2
      Charlie Jacobsen authored
      free => kfree.
      96adabf2
    • Charlie Jacobsen's avatar
      Fixes two minor memory leaks. · 8c5a1b80
      Charlie Jacobsen authored
      1 - Need to free name strings in cap types when we
          do cap_fini.
      
      I decided to ran valgrind to check for any others.
      
      2 - Need to free fake slab cache for user version.
      
      There are a handful of innocuous leaks in the
      multi_thrd_cap test app. There are also some innocuous
      leaks reported due to glib's use of memory pooling (it appears).
      8c5a1b80
  3. 18 Dec, 2015 1 commit
  4. 23 Nov, 2015 1 commit
  5. 20 Nov, 2015 1 commit
  6. 17 Nov, 2015 8 commits
  7. 16 Nov, 2015 2 commits
    • Josh Kunz's avatar
      Adds a reference from a cnode its cptr · 83e8ef65
      Josh Kunz authored
              Rationale: When the `revoke` handler is called for a particular
              cspace, cnode, and object, the cptr associated with that cnode
              needs to be free'd so it can be re-used by other objects (given
              there are a relatively small number of cptrs in a cspace).
              We can discover the cptr_cache associated with a cspace by
              looking at the `cspace->owner` field (which we point at our
              cache), but we can't figure out from the cnode alone which
              pointer in that cache points to the given cnode. This
              information is known when the cnode is created, so I added a
              field to the cnode that contains this information.
      83e8ef65
    • Josh Kunz's avatar
      Adds extra documentation to libcap.h · d36af6bc
      Josh Kunz authored
      d36af6bc
  8. 11 Nov, 2015 1 commit
    • Pankaj Kumar's avatar
      Add hook to lookup/verify cnode in cspace · c6d4015f
      Pankaj Kumar authored
      
      
      1. Added a function cap_cnode_verify for cnodes lookup in cspace.
         Earlier cap_cnode_get was called to verify the cnode. It imposed
         extra restrictions on the user of libcap to release cnode lock.
         Now, cap_cnode_verify will itself take care of cnode lock.
      2. Updated testcases to use cap_cnode_verify.
      Signed-off-by: Pankaj Kumar's avatarPankaj Kumar <pankajk@cs.utah.edu>
      c6d4015f
  9. 04 Nov, 2015 1 commit
  10. 03 Nov, 2015 1 commit
    • David Johnson's avatar
      Refactor libcap to allow both user lib and kernel module builds. · ab9ac0a0
      David Johnson authored
      Mostly, I kept the existing source skeletons in cap.c and
      cptr_cache.c (they've just moved to src/common), but all the
      user/kernel include differences are nicely factored out.  You
      might think my organization is a bit schizophrenic (a flattened
      include/ dir, and a hierarchical src/ dir), but I do that because
      I don't particularly care for libraries that install headers in
      $PREFIX/include/libfoo/{subdir1,subdir2,...}.  The idea with the
      src/ dir is that common cap/cptr logic goes in src/common, and
      any "platform" specialization (user lib vs kernel mod) goes in
      src/user or src/kernel .  The libcap.h and libcap_internal.h
      headers define some common types, macros, and functions, and expect
      the platform headers and source files to specialize them.
      
      I added a very basic notion of capability object types and tied it
      to revocation and deletion in the same way the original library did.
      
      For userspace, since I didn't have atomic ops, I just did basica...
      ab9ac0a0
  11. 30 Oct, 2015 1 commit
  12. 28 Oct, 2015 1 commit
  13. 14 Oct, 2015 1 commit
  14. 30 Sep, 2015 2 commits
  15. 11 Sep, 2015 1 commit