• 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
libcap_types.h 2.09 KB