summaryrefslogtreecommitdiff
path: root/tools/include
diff options
context:
space:
mode:
authorWang Nan <wangnan0@huawei.com>2015-06-01 07:37:48 (GMT)
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-06-02 22:07:29 (GMT)
commit4fc62a89dc607cee4f75f6dbb102cd6215fd0d64 (patch)
tree04e1cdb06adf055f779bafef7ce44a59459b62b8 /tools/include
parent37fbe0a4a0a9afe3b0fe843a4775a85ccf430deb (diff)
downloadlinux-4fc62a89dc607cee4f75f6dbb102cd6215fd0d64.tar.xz
tools: Move tools/perf/util/include/linux/{list.h,poison.h} to tools/include
This patch moves list.h from tools/perf/util/include/linux/list.h to tools/include/linux/list.h to enable other libraries use macros in it, like libbpf which will be introduced by further patches. Since list.h depend on poison.h, poison.h is also moved. Both file use relative path, so one '..' is removed for each header to make them suit for new directory. MANIFEST is also updated for 'make perf-*-src-pkg'. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com> Cc: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: David Ahern <dsahern@gmail.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kaixu Xia <xiakaixu@huawei.com> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/1433144296-74992-3-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/linux/list.h29
-rw-r--r--tools/include/linux/poison.h1
2 files changed, 30 insertions, 0 deletions
diff --git a/tools/include/linux/list.h b/tools/include/linux/list.h
new file mode 100644
index 0000000..76b014c
--- /dev/null
+++ b/tools/include/linux/list.h
@@ -0,0 +1,29 @@
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+#include "../../../include/linux/list.h"
+
+#ifndef TOOLS_LIST_H
+#define TOOLS_LIST_H
+/**
+ * list_del_range - deletes range of entries from list.
+ * @begin: first element in the range to delete from the list.
+ * @end: last element in the range to delete from the list.
+ * Note: list_empty on the range of entries does not return true after this,
+ * the entries is in an undefined state.
+ */
+static inline void list_del_range(struct list_head *begin,
+ struct list_head *end)
+{
+ begin->prev->next = end->next;
+ end->next->prev = begin->prev;
+}
+
+/**
+ * list_for_each_from - iterate over a list from one of its nodes
+ * @pos: the &struct list_head to use as a loop cursor, from where to start
+ * @head: the head for your list.
+ */
+#define list_for_each_from(pos, head) \
+ for (; pos != (head); pos = pos->next)
+#endif
diff --git a/tools/include/linux/poison.h b/tools/include/linux/poison.h
new file mode 100644
index 0000000..0c27bdf
--- /dev/null
+++ b/tools/include/linux/poison.h
@@ -0,0 +1 @@
+#include "../../../include/linux/poison.h"