- 16 Jan, 2016 4 commits
-
-
Charlie Jacobsen authored
Tests are not built by default now.
-
Charlie Jacobsen authored
Before, I just had some CPP checks that would stop the build if the cspace depth wasn't 4, etc. So it required some manual changes. Now it should be fully automated. There are three awk scripts that generate some C code / do some calculations, and the results are plugged into some headers (that are now templates and generated by configure). I did it this way because the CPP doesn't seem powerful enough to generate variable length definitions like this (without some serious CPP hacking). Easier to use awk and then AC_SUBST the results in. If we want to make the code even faster, we could precompute some other stuff like this as well. I tested the user build, and ran multi_thrd_cap with a cspace depth of 8, and cnode table size of 8. Looked ok.
-
Charlie Jacobsen authored
When we install libcap as a kernel module, in order for other kernel code (modules) to link with it, we need to mark public functions with EXPORT_SYMBOL.
-
Charlie Jacobsen authored
Adds KERNEL_HEADERS_INSTALL param so you can install the headers in a place of your choosing. (Otherwise, they're strewn across the source and build dirs - nice to coalesce into one spot.)
-
- 15 Jan, 2016 10 commits
-
-
Charlie Jacobsen authored
-
Charlie Jacobsen authored
-
Charlie Jacobsen authored
It's probably better to combine cap and cptr init/fini for now, so there aren't tons of init/fini functions to keep track of on the user's part. (Maybe we'll find a use case where we want them separate.)
-
Charlie Jacobsen authored
Re-organization basically complete.
-
Charlie Jacobsen authored
-
Charlie Jacobsen authored
I haven't tried running anything yet. Still need to update the build for the test apps.
-
Charlie Jacobsen authored
-
David Johnson authored
This is sick. I should have just reorg'd the headers. This should be baked out ASAP. It elides the core libcap_config.h conflicts to allow multi-package-config.h includes. autofoo doesn't help at all with this, but why should they? Shouldn't include config.h in public stuff. This is the same commit as I did for openmul. That one was defensible (way too much code to reorg the headers); this one, not so much... but I don't have time to reorganize the headers. Here's basically the same commit msg to explain things: Every time you think you've reached a new low with autotools, you're wrong. This is my way to get around the standard installable config.h problem. Basically, libcap wants you to include headers that require config.h, but of course things that use libcap have config.h of their own. So -- we take the hacky approach and remove the things that will obviously conflict and stick them in mul_config_internal.h . I'm sure my way of doing this will be missed if config.status include/libcap_config.h is ever run to regen libcap_config.h, but I can't solve that one right now.
-
David Johnson authored
Because installed versions of this library are used to build other packages, we cannot include internal headers in public headers.
-
David Johnson authored
This library has consumers that build against its installed version. For that, and for the other general problems that including config.h in public headers causes, just make config.h be prefixed so it is "unique" and install that one. It was either this, or hack the headers once again with some foo like that). But let's not do that now... the headers need a reorg before something like that happens.
-
- 14 Jan, 2016 7 commits
-
-
Charlie Jacobsen authored
Tested configure script, but not build yet.
-
Charlie Jacobsen authored
Test source code not updated yet.
-
Charlie Jacobsen authored
configure.ac has some garbage code in it to remind me to add the cspace config stuff.
-
Charlie Jacobsen authored
For both platform targets -- user and kernel.
-
Charlie Jacobsen authored
-
Charlie Jacobsen authored
I still need to update the automake files for the new layout, and tweak the kernel build so we can do out-of-tree (I figured out a trick/hack).
-
David Johnson authored
If libcap_types.h is a public header, it probably shouldn't include config.h, or if it does, we'll have to rename it to avoid conflicts, but this solves the build for now.
-
- 13 Jan, 2016 1 commit
-
-
Charlie Jacobsen authored
This commit just rearranges files, no files edited yet. Some automake files are not in place yet (and none of the existing ones have been updated for the new layout).
-
- 11 Jan, 2016 4 commits
-
-
Charlie Jacobsen authored
-
Charlie Jacobsen authored
Motivation: The libcap user may want to associate some contextual information for each capability (rather than with the object). For example, the LCD microkernel uses metadata to track whether a page referred to by a page capability has been mapped and where. This metadata field *is not* carried over to child capabilities during grant, and is NULL'd out when a capability is deleted from a cspace (so when the slot is used again, the field starts out as NULL). Internals note: The cnode will start out with NULL metadata as well when it is first used because we do a zalloc to create cnode tables.
-
Charlie Jacobsen authored
All looks OK now. Few other misc things: - config.h header goes with install - Some debug code in cap.c. - Wasn't handling return value of make cnode table in cap.c. For now, until we (possibly) move stuff around, I'm including the internal header in the public header so that I have access to the cap mutex type. I'm considering re-working things so that this won't be necessary in the future. Temporary hack for now.
-
Charlie Jacobsen authored
I'm seeing what appears to be race conditions in the tests, so we're not out of the woods yet. I think I just need to introduce a lock for the cptr cache. It wasn't originally designed to be thread safe since only one thread at a time was using it. But we need it now. There are a few other miscellaneous changes: - Moves cptr manipulation into public header. Doc cleanup. - cptr_init returns an integer now (non-zero signals failure). - Adds CAP_BUG macro. Library code invokes this to abort or signal a serious internal library error (e.g., unexpected switch case). kernel: CAP_BUG ==> BUG user: CAP_BUG ==> abort - Aside from the cptr cache code updates for the modified struct, separates cptr cache initialization into two parts: alloc and init. Motivation: Some users of libcap will have already allocated the cptr cache (e.g., declared it as a static global), and only need it initialized. So, to fully initialize a cptr cache, you now need to do, e.g., int ret; cptr_cache *cache; ret = cptr_cache_alloc(&cache); if (ret) ... handle error ... ret = cptr_cache_init(cache); if (ret) { cptr_cache_free(cache); ... handle error ... } - Updates test apps to use new cptr cache API (alloc then init). Adds some extra error handling/clean up code.
-
- 10 Jan, 2016 1 commit
-
-
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.
-
- 09 Jan, 2016 2 commits
-
-
Charlie Jacobsen authored
free => kfree.
-
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).
-
- 18 Dec, 2015 1 commit
-
-
Josh Kunz authored
Needed for CapNet's cn_objref_principal function that is needed for a correct implementation of rendezvous points.
-
- 23 Nov, 2015 1 commit
-
-
Josh Kunz authored
-
- 20 Nov, 2015 1 commit
-
-
Josh Kunz authored
-
- 17 Nov, 2015 8 commits
-
-
Josh Kunz authored
Currently sending 0 which is neither PTHREAD_PROCESS_PRIVATE or PTHREAD_PROCESS_SHARED, the two values mentioned in the man page.
-
David Johnson authored
-
Josh Kunz authored
-
Josh Kunz authored
-
Josh Kunz authored
-
Josh Kunz authored
There's still an expression is always true warning, but since it's from a #define, I figure it's best to just try and disable that warning at some point.
-
Josh Kunz authored
Add a compat header that implements the POSIX spinlock API using OSX's libkern/OSAtomic.h. OSX is supposedly POSIX compliant, but it appears to not implement spinlocks as part of it's pthread API. Only works with OS version after 10.4 which should be pretty much every OSX device out there.
-
Pankaj Kumar authored
Added cap_alloc_cspace/cap_free_cspace for cspace alloc/free operations in userspace testcases. Signed-off-by:
Pankaj Kumar <pankajk@cs.utah.edu>
-