aboutsummaryrefslogtreecommitdiff
path: root/include/apos
diff options
context:
space:
mode:
Diffstat (limited to 'include/apos')
-rw-r--r--include/apos/atomic.h3
-rw-r--r--include/apos/mem.h14
-rw-r--r--include/apos/utils.h8
3 files changed, 15 insertions, 10 deletions
diff --git a/include/apos/atomic.h b/include/apos/atomic.h
index 4026b1f..a4292d6 100644
--- a/include/apos/atomic.h
+++ b/include/apos/atomic.h
@@ -113,7 +113,8 @@ typedef _Atomic __UINTMAX_TYPE__ atomic_uintmax_t;
#define atomic_load_explicit(obj, mode) N_ATOMIC(load)(obj, mode)
-#define atomic_load(obj) atomic_load_explicit(obj, ATOMIC_SEQ_CST)
+#define atomic_load(obj) atomic_load_explicit(obj, \
+ ATOMIC_SEQ_CST)
#define atomic_exchange_explicit(obj, val, mode) \
N_ATOMIC(exchange)(obj, val, mode)
diff --git a/include/apos/mem.h b/include/apos/mem.h
index bbe7532..7d24e0e 100644
--- a/include/apos/mem.h
+++ b/include/apos/mem.h
@@ -13,14 +13,16 @@
#define pnum_to_index(pnum, order) \
(((pnum) >> __o_offset(order)) & (__o_width(order) - 1))
-#define pm_to_index(paddr, order) (pnum_to_index(pm_to_pnum(paddr), (order)))
+#define pm_to_index(paddr, \
+ order) (pnum_to_index(pm_to_pnum(paddr), (order)))
#define pm_to_pnum(paddr) ((paddr) >> __mm_page_shift)
#define pnum_to_paddr(pnum) ((pnum) << __mm_page_shift)
#define move_forward(var, num) (((var) += (num)) - (num))
#define move_paddr(paddr, base, offset) ((((pm_t)(paddr)) - (base)) + (offset))
-#define num_elems(num) (((num) + MM_OINFO_WIDTH - 1) / MM_OINFO_WIDTH)
+#define num_elems(num) (((num) + MM_OINFO_WIDTH - 1) / \
+ MM_OINFO_WIDTH)
#define num_indexes(num) ((num) / MM_OINFO_WIDTH)
#define index_elems(num) ((num) / MM_OINFO_WIDTH)
#define state_elems(num) (sizeof(mm_info_t) * (num_elems(num)))
@@ -35,13 +37,15 @@
#define __o_container(idx) ((idx) / MM_OINFO_WIDTH)
#define __o_bit(idx) ((idx) & (MM_OINFO_WIDTH - 1))
-#define __va(x) (void *)(((uintptr_t)(x)) + VM_DMAP - RAM_BASE)
-#define __pa(x) (void *)(((uintptr_t)(x)) - VM_DMAP + RAM_BASE)
+#define __va(x) (void *)(((uintptr_t)(x)) + VM_DMAP - \
+ RAM_BASE)
+#define __pa(x) (void *)(((uintptr_t)(x)) - VM_DMAP + \
+ RAM_BASE)
#define __page(x) ((x) / BASE_PAGE_SIZE)
#define __addr(x) ((x)*BASE_PAGE_SIZE)
#define __pages(x) \
(is_aligned((x), BASE_PAGE_SIZE) ? __page((x)) : \
- __page((x) + BASE_PAGE_SIZE))
+ __page((x) + BASE_PAGE_SIZE))
#define __bytes(x) (__addr(x))
/* if memory region is used or not */
diff --git a/include/apos/utils.h b/include/apos/utils.h
index 1f1ade9..03bb801 100644
--- a/include/apos/utils.h
+++ b/include/apos/utils.h
@@ -20,7 +20,7 @@
(MIN3(a, b, c) <= MIN3(b, c, d) ? MIN3(a, b, c) : MIN3(b, c, d))
/* etc... */
-#define GLUE2(x, y) x ## y
+#define GLUE2(x, y) x##y
#define GLUE(x, y) GLUE2(x, y)
#define QUOTE2(x) #x
@@ -71,7 +71,7 @@
: align_up_ull)((x), (y))
#define DEFINE_ALIGN_UP(name, type) \
- static inline type align_up_ ## name(type val, type a) \
+ static inline type align_up_##name(type val, type a) \
{ \
if (!a) { \
return val; \
@@ -114,7 +114,7 @@ DEFINE_ALIGN_UP(ull, unsigned long long);
: align_down_ull)((x), (y))
#define DEFINE_ALIGN_DOWN(name, type) \
- static inline type align_down_ ## name(type val, type a) \
+ static inline type align_down_##name(type val, type a) \
{ \
if (!a) { \
return val; \
@@ -151,7 +151,7 @@ DEFINE_ALIGN_DOWN(ull, unsigned long long);
: is_aligned_ll)((x), (y))
#define DEFINE_ALIGNED(name, type) \
- static inline bool is_aligned_ ## name(type val, type a) \
+ static inline bool is_aligned_##name(type val, type a) \
{ \
if (!a) { \
return true; \