aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/scatterlist/Makefile
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2017-09-06 15:55:06 +0100
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2017-09-07 10:54:40 +0100
commitc9636244f86ae80b66e8ffb05ff755d85edf1988 (patch)
tree9e48f5060e1391338943230d255743fb6950719a /tools/testing/scatterlist/Makefile
parentdrm/i915: Use __sg_alloc_table_from_pages for userptr allocations (diff)
downloadlinux-dev-c9636244f86ae80b66e8ffb05ff755d85edf1988.tar.xz
linux-dev-c9636244f86ae80b66e8ffb05ff755d85edf1988.zip
tools/testing/scatterlist: Test new __sg_alloc_table_from_pages
Exercise the new __sg_alloc_table_from_pages API (and through it also the old sg_alloc_table_from_pages), checking that the created table has the expected number of segments depending on the sequence of input pages and other conditions. v2: Move to data driven for readability. v3: Add some more testcases and -fsanitize=undefined. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: linux-kernel@vger.kernel.org Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20170906145506.14952-1-tvrtko.ursulin@linux.intel.com [tursulin: whitespace fixup]
Diffstat (limited to 'tools/testing/scatterlist/Makefile')
-rw-r--r--tools/testing/scatterlist/Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/testing/scatterlist/Makefile b/tools/testing/scatterlist/Makefile
new file mode 100644
index 000000000000..933c3a6e4d77
--- /dev/null
+++ b/tools/testing/scatterlist/Makefile
@@ -0,0 +1,30 @@
+CFLAGS += -I. -I../../include -g -O2 -Wall -fsanitize=address
+LDFLAGS += -fsanitize=address -fsanitize=undefined
+TARGETS = main
+OFILES = main.o scatterlist.o
+
+ifeq ($(BUILD), 32)
+ CFLAGS += -m32
+ LDFLAGS += -m32
+endif
+
+targets: include $(TARGETS)
+
+main: $(OFILES)
+
+clean:
+ $(RM) $(TARGETS) $(OFILES) scatterlist.c linux/scatterlist.h linux/highmem.h linux/kmemleak.h asm/io.h
+ @rmdir asm
+
+scatterlist.c: ../../../lib/scatterlist.c
+ @sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
+
+.PHONY: include
+
+include: ../../../include/linux/scatterlist.h
+ @mkdir -p linux
+ @mkdir -p asm
+ @touch asm/io.h
+ @touch linux/highmem.h
+ @touch linux/kmemleak.h
+ @cp $< linux/scatterlist.h