add files
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Sat, 7 Feb 2009 17:40:28 +0000 (12:40 -0500)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Sat, 7 Feb 2009 17:40:28 +0000 (12:40 -0500)
libmarkers/Makefile [new file with mode: 0644]
libmarkers/compiler.h [new file with mode: 0644]
libmarkers/kernelcompat.h [new file with mode: 0644]

diff --git a/libmarkers/Makefile b/libmarkers/Makefile
new file mode 100644 (file)
index 0000000..15fecf1
--- /dev/null
@@ -0,0 +1,4 @@
+all: libmarkers.so
+
+libmarkers.so: marker.c *.c *.h
+       gcc -g -fPIC -I../share -I../libtracing -shared -o libmarkers.so marker.c
diff --git a/libmarkers/compiler.h b/libmarkers/compiler.h
new file mode 100644 (file)
index 0000000..dd8c75a
--- /dev/null
@@ -0,0 +1,6 @@
+#define __printf(a,b)                  __attribute__((format(printf,a,b)))
+
+#define likely(x)      __builtin_expect(!!(x), 1)
+#define unlikely(x)    __builtin_expect(!!(x), 0)
+
+#define notrace __attribute__((no_instrument_function))
diff --git a/libmarkers/kernelcompat.h b/libmarkers/kernelcompat.h
new file mode 100644 (file)
index 0000000..b6615ee
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef KERNELCOMPAT_H
+#define KERNELCOMPAT_H
+
+#include <string.h>
+
+#define container_of(ptr, type, member) ({                      \
+        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
+        (type *)( (char *)__mptr - offsetof(type,member) );})
+
+#define KERN_DEBUG
+#define KERN_NOTICE
+
+static inline void *ERR_PTR(long error)
+{
+        return (void *) error;
+}
+
+
+#include <stdint.h>
+
+typedef uint16_t u16;
+typedef uint32_t u32;
+
+
+#include <pthread.h>
+
+#define DEFINE_MUTEX(m) pthread_mutex_t (m) = PTHREAD_MUTEX_INITIALIZER;
+
+#define mutex_lock(m) pthread_mutex_lock(m)
+
+#define mutex_unlock(m) pthread_mutex_unlock(m)
+
+
+#include <stdlib.h>
+
+#define kmalloc(s, t) malloc(s)
+#define kzalloc(s, t) malloc(s)
+#define kfree(p) free((void *)p)
+#define kstrdup(s, t) strdup(s)
+
+
+#include <stdio.h>
+#define printk(fmt, args...) printf(fmt, ## args)
+
+
+
+#define smp_rmb()
+#define smp_wmb()
+
+
+#define read_barrier_depends()
+#define smp_read_barrier_depends()
+
+
+#define rcu_assign_pointer(a, b)
+#endif /* KERNELCOMPAT_H */
This page took 0.026372 seconds and 4 git commands to generate.