diff options
| -rw-r--r-- | include/arch/tcb.h | 1 | ||||
| -rw-r--r-- | include/kmi/regions.h | 14 | ||||
| -rw-r--r-- | include/kmi/string.h | 4 | ||||
| -rw-r--r-- | include/kmi/uapi.h | 2 | ||||
| -rw-r--r-- | include/kmi/utils.h | 2 |
5 files changed, 18 insertions, 5 deletions
diff --git a/include/arch/tcb.h b/include/arch/tcb.h index f4726ad..4f75419 100644 --- a/include/arch/tcb.h +++ b/include/arch/tcb.h @@ -31,6 +31,7 @@ void tcb_assign(struct tcb *t); * Set up RPC stack in a way that is convenient for the underlying architecture. * * @param t Thread whose RPC stack should be set up. + * @return OK on success, non-zero otherwise. */ stat_t setup_rpc_stack(struct tcb *t); diff --git a/include/kmi/regions.h b/include/kmi/regions.h index 5faec0d..ebaa07a 100644 --- a/include/kmi/regions.h +++ b/include/kmi/regions.h @@ -155,6 +155,20 @@ vm_t alloc_shared_region(struct mem_region_root *r, size_t size, size_t *actual_size, vmflags_t flags, id_t pid); +/** + * Allocate a shred memory region at a fixed virtual address and associate it with + * some other process. + * + * Will allocate region of at least \c size bytes, with best possible location. + * + * @param r Memory region root. + * @param start Start of region to allocate. + * @param size Size of region to allocate. + * @param actual_size Size of region that was allocated. + * @param flags Memory flags. + * @param pid Process to associate with region. + * @return Address of allocated region on success, otherwise \c NULL. + */ vm_t alloc_shared_fixed_region(struct mem_region_root *r, vm_t start, size_t size, size_t *actual_size, vmflags_t flags, id_t pid); diff --git a/include/kmi/string.h b/include/kmi/string.h index f72299b..fda1304 100644 --- a/include/kmi/string.h +++ b/include/kmi/string.h @@ -182,12 +182,12 @@ void *memchr(const void *ptr, int val, size_t num); /** * Copy memory byte for byte. - * \c dst may not overlap \c src. + * \p dst may not overlap \p src. * * @param dst Destination of copy. * @param src Source of copy. * @param num Number of bytes to copy. - * @return \c dst. + * @return \p dst. */ void *memcpy(void * restrict dst, const void * restrict src, size_t num); diff --git a/include/kmi/uapi.h b/include/kmi/uapi.h index b0740a9..94ac6a7 100644 --- a/include/kmi/uapi.h +++ b/include/kmi/uapi.h @@ -826,8 +826,6 @@ SYSCALL_DECLARE1(free_irq, id); /** * Request that a thread exits, i.e. removes itself from the thread list and * frees all kernel data associated with thread. - * Note that similarly to \ref kill(), some shared resources may cause the - * thread to stay around until their reference counts go to zero. * * @param t Current tcb. * @param tid Thread to swap to once the current thread no longer exists. 0 for diff --git a/include/kmi/utils.h b/include/kmi/utils.h index a37f4bb..30b08be 100644 --- a/include/kmi/utils.h +++ b/include/kmi/utils.h @@ -18,7 +18,7 @@ * @return \c a if \c a >= 0, \c -a otherwise. * \sideeffects */ -#define ABS(a) (a < 0 ? -a : a) +#define ABS(a) ((a) < 0 ? -(a) : (a)) /** * Get the larger of two values. |
