+#define __KERNEL__
+
#include <assert.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <linux/compiler.h>
+
#define min(a,b) (((a)<(b))?a:b)
#define max(a,b) (((a)>(b))?a:b)
#define BUG_ON(a) assert(!(a))
+// Useful outsize __KERNEL__. Not used here because inline is already redefined.
#define force_inline inline __attribute__((always_inline))
/* Calculate the offset needed to align the type */
-static force_inline unsigned int ltt_align(size_t align_drift,
+static inline unsigned int ltt_align(size_t align_drift,
size_t size_of_type)
{
size_t alignment = min(sizeof(void*), size_of_type);
};
-static force_inline size_t lttng_get_size_mystruct2(
+static inline size_t lttng_get_size_mystruct2(
struct lttng_mystruct2 * obj)
{
size_t size=0, locsize;
return sizeof(struct lttng_mystruct2);
}
-static force_inline size_t lttng_get_alignment_mystruct2(
+static inline size_t lttng_get_alignment_mystruct2(
struct lttng_mystruct2 *obj)
{
size_t align=0, localign;
return align;
}
-static force_inline void lttng_write_mystruct2(
+static inline void lttng_write_mystruct2(
void **to_base,
size_t *to,
void **from,
#define LTTNG_ARRAY_SIZE_mystruct_myarray 10
typedef uint64_t lttng_array_mystruct_myarray[LTTNG_ARRAY_SIZE_mystruct_myarray];
-static force_inline size_t lttng_get_size_array_mystruct_myarray(
+static inline size_t lttng_get_size_array_mystruct_myarray(
lttng_array_mystruct_myarray obj)
{
size_t size=0, locsize;
return size;
}
-static force_inline size_t lttng_get_alignment_array_mystruct_myarray(
+static inline size_t lttng_get_alignment_array_mystruct_myarray(
lttng_array_mystruct_myarray obj)
{
size_t align=0, localign;
}
-static force_inline void lttng_write_array_mystruct_myarray(
+static inline void lttng_write_array_mystruct_myarray(
void **to_base,
size_t *to,
void **from,
};
-static force_inline size_t lttng_get_size_sequence_mystruct_mysequence(
+static inline size_t lttng_get_size_sequence_mystruct_mysequence(
lttng_sequence_mystruct_mysequence *obj)
{
size_t size=0, locsize;
return size;
}
-static force_inline size_t lttng_get_alignment_sequence_mystruct_mysequence(
+static inline size_t lttng_get_alignment_sequence_mystruct_mysequence(
lttng_sequence_mystruct_mysequence *obj)
{
size_t align=0, localign;
}
-static force_inline void lttng_write_sequence_mystruct_mysequence(
+static inline void lttng_write_sequence_mystruct_mysequence(
void **to_base,
size_t *to,
void **from,
};
-static force_inline size_t lttng_get_size_mystruct_myunion(
+static inline size_t lttng_get_size_mystruct_myunion(
union lttng_mystruct_myunion *obj)
{
size_t size=0, locsize;
}
-static force_inline size_t lttng_get_alignment_mystruct_myunion(
+static inline size_t lttng_get_alignment_mystruct_myunion(
union lttng_mystruct_myunion *obj)
{
size_t align=0, localign;
}
-static force_inline void lttng_write_mystruct_myunion(
+static inline void lttng_write_mystruct_myunion(
void **to_base,
size_t *to,
void **from,
union lttng_mystruct_myunion myunion;
};
-static force_inline size_t lttng_get_size_mystruct(
+static inline size_t lttng_get_size_mystruct(
struct lttng_mystruct *obj)
{
size_t size=0, locsize, localign;
}
-static force_inline size_t lttng_get_alignment_mystruct(
+static inline size_t lttng_get_alignment_mystruct(
struct lttng_mystruct *obj)
{
size_t align=0, localign;
return align;
}
-static force_inline void lttng_write_mystruct(
+static inline void lttng_write_mystruct(
void **to_base,
size_t *to,
void **from,