Module: xenomai-3
Branch: next
Commit: 594a0adb34c3ac2fced973f202e4c39e33201c8c
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=594a0adb34c3ac2fced973f202e4c39e33201c8c

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Apr 23 10:28:49 2018 +0200

boilerplate: compiler: add more helpers and attribute tags

---

 include/boilerplate/compiler.h    |   18 ++++++++++++++++++
 lib/copperplate/heapobj-pshared.c |    6 ------
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/include/boilerplate/compiler.h b/include/boilerplate/compiler.h
index bcef7d4..f526eb2 100644
--- a/include/boilerplate/compiler.h
+++ b/include/boilerplate/compiler.h
@@ -46,6 +46,14 @@
 #define __weak         __attribute__((__weak__))
 #endif
 
+#ifndef __const
+#define __const                __attribute__((__const__))
+#endif
+
+#ifndef __pure
+#define __pure         __attribute__((__pure__))
+#endif
+
 #ifndef __maybe_unused
 #define __maybe_unused __attribute__((__unused__))
 #endif
@@ -58,6 +66,16 @@
 #define __deprecated   __attribute__((__deprecated__))
 #endif
 
+#ifndef __packed
+#define __packed       __attribute__((__packed__))
+#endif
+
+#ifndef __alloc_size
+#define __alloc_size(__args)   __attribute__((__alloc_size__(__args)))
+#endif
+
+#define __align_to(__size, __al)  (((__size) + (__al) - 1) & (~((__al) - 1)))
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/lib/copperplate/heapobj-pshared.c 
b/lib/copperplate/heapobj-pshared.c
index d4324df..e08b033 100644
--- a/lib/copperplate/heapobj-pshared.c
+++ b/lib/copperplate/heapobj-pshared.c
@@ -106,12 +106,6 @@ static struct heapobj main_pool;
 #define __shref(b, o)          ((void *)((caddr_t)(b) + (o)))
 #define __shref_check(b, o)    ((o) ? __shref(b, o) : NULL)
 
-static inline size_t __align_to(size_t size, size_t al)
-{
-       /* The alignment value must be a power of 2 */
-       return ((size+al-1)&(~(al-1)));
-}
-
 static inline size_t get_pagemap_size(size_t h,
                                      memoff_t *bmapoff, int *bmapwords)
 {


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to