diff options
Diffstat (limited to 'testsuite/module-playground')
49 files changed, 639 insertions, 0 deletions
diff --git a/testsuite/module-playground/.gitignore b/testsuite/module-playground/.gitignore new file mode 100644 index 0000000..6d9c7b1 --- /dev/null +++ b/testsuite/module-playground/.gitignore @@ -0,0 +1,16 @@ +*.ko +!mod-simple-*.ko +!cache/*.ko +.cache.mk +*.mod.c +.tmp_versions +*.mod +*.a +*.cmd +*.o.d + +modules.order +Module.symvers +mod-simple-x86_64.c +mod-simple-i386.c +mod-simple-sparc64.c diff --git a/testsuite/module-playground/Makefile b/testsuite/module-playground/Makefile new file mode 100644 index 0000000..a7ab09b --- /dev/null +++ b/testsuite/module-playground/Makefile @@ -0,0 +1,83 @@ +ifneq ($(KERNELRELEASE),) +# kbuild part of makefile + +ifneq ($(KMOD_TESTSUITE_ARCH_BUILD),1) +obj-m := mod-simple.o + +# mod-foo depends on foo-x, and foo-x modules don't depend +# on anyone +obj-m += mod-foo-a.o +obj-m += mod-foo-b.o +obj-m += mod-foo-c.o +obj-m += mod-foo.o + +# mod-loop: create loops in dependencies: +# 1) mod-loop-a -> mod-loop-b -> mod-loop-c -> mod-loop-a +# |-> mod-loop-f |-> mod-loop-f +# \-> mod-loop-g \-> mod-loop-g +# 2) mod-loop-d -> mod-loop-e -> mod-loop-d +# 3.1) mod-loop-h -> mod-loop-i -> mod-loop-j -> mod-loop-h +# 3.2) mod-loop-h -> mod-loop-i -> mod-loop-j -> mod-loop-k -> mod-loop-h + +obj-m += mod-loop-a.o +obj-m += mod-loop-b.o +obj-m += mod-loop-c.o +obj-m += mod-loop-d.o +obj-m += mod-loop-e.o +obj-m += mod-loop-f.o +obj-m += mod-loop-g.o +obj-m += mod-loop-h.o +obj-m += mod-loop-i.o +obj-m += mod-loop-j.o +obj-m += mod-loop-k.o + +# mod-fake-*: fake the respective modules in kernel with these aliases. Aliases +# list was taken from 3.5.4 +obj-m += mod-fake-hpsa.o +obj-m += mod-fake-scsi-mod.o +obj-m += mod-fake-cciss.o + +else +# only build ARCH-specific module +ifeq ($(ARCH),) + $(error ARCH must be set to a valid architecture) +endif +obj-m := mod-simple-$(ARCH).o +endif + +else +# normal makefile +KDIR ?= $(module_prefix)/lib/modules/`uname -r`/build +KVER ?= `uname -r` +ifeq ($(FAKE_BUILD),) + FAKE_BUILD=0 +endif + +ARCH_SPECIFIC_MODULES := mod-simple-x86_64.ko mod-simple-i386.ko mod-simple-sparc64.ko +MY_MODULES := $(filter-out $(ARCH_SPECIFIC_MODULES),$(wildcard *.ko)) + +default: modules arch-modules + +mod-simple-%.ko: mod-simple-%.c Makefile.arch + $(eval arch=$(patsubst mod-simple-%.ko,%,$@)) + $(MAKE) KDIR=$(KDIR_$(arch)) ARCH=$(arch) CROSS_COMPILE=$(CROSS_COMPILE_$(arch)) -f Makefile.arch + +ifeq ($(FAKE_BUILD),0) +modules: + $(MAKE) -C $(KDIR) M=$$PWD +else +modules: + @echo " CP cache/*.ko" + @cp cache/*.ko . +endif + +arch-modules: $(ARCH_SPECIFIC_MODULES) + +clean: + test -z "$(MY_MODULES)" || rm -rf $(MY_MODULES) || true + rm -rf .tmp_versions || true + rm -rf .*.cmd *.mod.c || true + rm -rf *.o || true + rm -rf Module.symvers modules.order + +endif diff --git a/testsuite/module-playground/Makefile.arch b/testsuite/module-playground/Makefile.arch new file mode 100644 index 0000000..47bd9cb --- /dev/null +++ b/testsuite/module-playground/Makefile.arch @@ -0,0 +1,14 @@ +ifeq ($(ARCH),) + $(error ARCH must be set to a valid architecture) +endif + +default: + @cmp --quiet mod-simple.c mod-simple-$(ARCH).c || ( \ + ln -sf mod-simple.c mod-simple-$(ARCH).c; \ + /bin/false \ + ) + $(MAKE) -C $(KDIR_$(ARCH)) CROSS_COMPILE=$(CROSS_COMPILE_$(ARCH)) M=$$PWD KMOD_TESTSUITE_ARCH_BUILD=1 + +clean: + $(MAKE) -C $(KDIR_$(ARCH)) CROSS_COMPILE=$(CROSS_COMPILE_$(ARCH)) M=$$PWD KMOD_TESTSUITE_ARCH_BUILD=1 clean + rm -f mod-simple-$(ARCH).c diff --git a/testsuite/module-playground/README b/testsuite/module-playground/README new file mode 100644 index 0000000..76c6e8d --- /dev/null +++ b/testsuite/module-playground/README @@ -0,0 +1,26 @@ +Pre-compiled modules +==================== + +Some modules are pre-compiled due to needing cross-compilers present on the +build/dev machine which is inconvenient. Makefile is ready to compile them again +in case they are missing: + +1) Prepare the linux kernel trees to build external modules, i.e.: + + kernel $ make ARCH=<arch> CROSS_COMPILER=<cross-compiler-prefix> defconfig + kernel $ make ARCH=<arch> CROSS_COMPILER=<cross-compiler-prefix> modules_prepare + + For each architecture. See the Makefile to check which are the supported architectures. + +2) Export the variables below to point to the right place: + + KDIR_<arch>: for each architecture it needs to point to a + kernel tree configured as in (1) + + CROSS_COMPILER_<arch: for each architecture it needs to point to the + correct toolchain prefix. Leave it blank if a + cross-compiler is not needed (example: you are + building a 32b module with a multilib compiler). + + +3) Remove every %-<arch>.ko. After this the build system will recreate them. diff --git a/testsuite/module-playground/cache/mod-fake-cciss.ko b/testsuite/module-playground/cache/mod-fake-cciss.ko Binary files differnew file mode 100644 index 0000000..f61409a --- /dev/null +++ b/testsuite/module-playground/cache/mod-fake-cciss.ko diff --git a/testsuite/module-playground/cache/mod-fake-hpsa.ko b/testsuite/module-playground/cache/mod-fake-hpsa.ko Binary files differnew file mode 100644 index 0000000..3d33ba7 --- /dev/null +++ b/testsuite/module-playground/cache/mod-fake-hpsa.ko diff --git a/testsuite/module-playground/cache/mod-fake-scsi-mod.ko b/testsuite/module-playground/cache/mod-fake-scsi-mod.ko Binary files differnew file mode 100644 index 0000000..c0eb974 --- /dev/null +++ b/testsuite/module-playground/cache/mod-fake-scsi-mod.ko diff --git a/testsuite/module-playground/cache/mod-foo-a.ko b/testsuite/module-playground/cache/mod-foo-a.ko Binary files differnew file mode 100644 index 0000000..f2d406e --- /dev/null +++ b/testsuite/module-playground/cache/mod-foo-a.ko diff --git a/testsuite/module-playground/cache/mod-foo-b.ko b/testsuite/module-playground/cache/mod-foo-b.ko Binary files differnew file mode 100644 index 0000000..53bf3a9 --- /dev/null +++ b/testsuite/module-playground/cache/mod-foo-b.ko diff --git a/testsuite/module-playground/cache/mod-foo-c.ko b/testsuite/module-playground/cache/mod-foo-c.ko Binary files differnew file mode 100644 index 0000000..083e801 --- /dev/null +++ b/testsuite/module-playground/cache/mod-foo-c.ko diff --git a/testsuite/module-playground/cache/mod-foo.ko b/testsuite/module-playground/cache/mod-foo.ko Binary files differnew file mode 100644 index 0000000..0961478 --- /dev/null +++ b/testsuite/module-playground/cache/mod-foo.ko diff --git a/testsuite/module-playground/cache/mod-loop-a.ko b/testsuite/module-playground/cache/mod-loop-a.ko Binary files differnew file mode 100644 index 0000000..51533d8 --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-a.ko diff --git a/testsuite/module-playground/cache/mod-loop-b.ko b/testsuite/module-playground/cache/mod-loop-b.ko Binary files differnew file mode 100644 index 0000000..5e20348 --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-b.ko diff --git a/testsuite/module-playground/cache/mod-loop-c.ko b/testsuite/module-playground/cache/mod-loop-c.ko Binary files differnew file mode 100644 index 0000000..6a02b04 --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-c.ko diff --git a/testsuite/module-playground/cache/mod-loop-d.ko b/testsuite/module-playground/cache/mod-loop-d.ko Binary files differnew file mode 100644 index 0000000..3ab3348 --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-d.ko diff --git a/testsuite/module-playground/cache/mod-loop-e.ko b/testsuite/module-playground/cache/mod-loop-e.ko Binary files differnew file mode 100644 index 0000000..efe93ff --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-e.ko diff --git a/testsuite/module-playground/cache/mod-loop-f.ko b/testsuite/module-playground/cache/mod-loop-f.ko Binary files differnew file mode 100644 index 0000000..c0e15cb --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-f.ko diff --git a/testsuite/module-playground/cache/mod-loop-g.ko b/testsuite/module-playground/cache/mod-loop-g.ko Binary files differnew file mode 100644 index 0000000..46f3c43 --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-g.ko diff --git a/testsuite/module-playground/cache/mod-loop-h.ko b/testsuite/module-playground/cache/mod-loop-h.ko Binary files differnew file mode 100644 index 0000000..cbd81e5 --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-h.ko diff --git a/testsuite/module-playground/cache/mod-loop-i.ko b/testsuite/module-playground/cache/mod-loop-i.ko Binary files differnew file mode 100644 index 0000000..045bc4f --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-i.ko diff --git a/testsuite/module-playground/cache/mod-loop-j.ko b/testsuite/module-playground/cache/mod-loop-j.ko Binary files differnew file mode 100644 index 0000000..067aa4b --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-j.ko diff --git a/testsuite/module-playground/cache/mod-loop-k.ko b/testsuite/module-playground/cache/mod-loop-k.ko Binary files differnew file mode 100644 index 0000000..2cc16d1 --- /dev/null +++ b/testsuite/module-playground/cache/mod-loop-k.ko diff --git a/testsuite/module-playground/cache/mod-simple.ko b/testsuite/module-playground/cache/mod-simple.ko Binary files differnew file mode 100644 index 0000000..2c5ffcf --- /dev/null +++ b/testsuite/module-playground/cache/mod-simple.ko diff --git a/testsuite/module-playground/dummy.pkcs7 b/testsuite/module-playground/dummy.pkcs7 Binary files differnew file mode 100644 index 0000000..bcdb902 --- /dev/null +++ b/testsuite/module-playground/dummy.pkcs7 diff --git a/testsuite/module-playground/dummy.sha1 b/testsuite/module-playground/dummy.sha1 Binary files differnew file mode 100644 index 0000000..bab65d3 --- /dev/null +++ b/testsuite/module-playground/dummy.sha1 diff --git a/testsuite/module-playground/dummy.sha256 b/testsuite/module-playground/dummy.sha256 Binary files differnew file mode 100644 index 0000000..fe16b01 --- /dev/null +++ b/testsuite/module-playground/dummy.sha256 diff --git a/testsuite/module-playground/mod-fake-cciss.c b/testsuite/module-playground/mod-fake-cciss.c new file mode 100644 index 0000000..9c46801 --- /dev/null +++ b/testsuite/module-playground/mod-fake-cciss.c @@ -0,0 +1,37 @@ +#include <linux/init.h> +#include <linux/module.h> + +static int __init test_module_init(void) +{ + return 0; +} + +static void test_module_exit(void) +{ +} +module_init(test_module_init); +module_exit(test_module_exit); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); + +MODULE_ALIAS("pci:v00000E11d0000B060sv00000E11sd00004070bc*sc*i*"); +MODULE_ALIAS("pci:v00000E11d0000B178sv00000E11sd00004080bc*sc*i*"); +MODULE_ALIAS("pci:v00000E11d0000B178sv00000E11sd00004082bc*sc*i*"); +MODULE_ALIAS("pci:v00000E11d0000B178sv00000E11sd00004083bc*sc*i*"); +MODULE_ALIAS("pci:v00000E11d00000046sv00000E11sd00004091bc*sc*i*"); +MODULE_ALIAS("pci:v00000E11d00000046sv00000E11sd0000409Abc*sc*i*"); +MODULE_ALIAS("pci:v00000E11d00000046sv00000E11sd0000409Bbc*sc*i*"); +MODULE_ALIAS("pci:v00000E11d00000046sv00000E11sd0000409Cbc*sc*i*"); +MODULE_ALIAS("pci:v00000E11d00000046sv00000E11sd0000409Dbc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003220sv0000103Csd00003225bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003230sv0000103Csd00003223bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003230sv0000103Csd00003234bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003230sv0000103Csd00003235bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003238sv0000103Csd00003211bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003238sv0000103Csd00003212bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003238sv0000103Csd00003213bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003238sv0000103Csd00003214bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003238sv0000103Csd00003215bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003230sv0000103Csd00003237bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd00003230sv0000103Csd0000323Dbc*sc*i*"); diff --git a/testsuite/module-playground/mod-fake-hpsa.c b/testsuite/module-playground/mod-fake-hpsa.c new file mode 100644 index 0000000..99dc729 --- /dev/null +++ b/testsuite/module-playground/mod-fake-hpsa.c @@ -0,0 +1,36 @@ +#include <linux/init.h> +#include <linux/module.h> + +extern void dummy_export(void); + +static int __init test_module_init(void) +{ + dummy_export(); + return 0; +} + +static void test_module_exit(void) +{ +} +module_init(test_module_init); +module_exit(test_module_exit); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); + +MODULE_ALIAS("pci:v0000103Cd0000323Asv0000103Csd00003241bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Asv0000103Csd00003243bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Asv0000103Csd00003245bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Asv0000103Csd00003247bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Asv0000103Csd00003249bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Asv0000103Csd0000324Abc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Asv0000103Csd0000324Bbc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Asv0000103Csd00003233bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Bsv0000103Csd00003350bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Bsv0000103Csd00003351bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Bsv0000103Csd00003352bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Bsv0000103Csd00003353bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Bsv0000103Csd00003354bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Bsv0000103Csd00003355bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd0000323Bsv0000103Csd00003356bc*sc*i*"); +MODULE_ALIAS("pci:v0000103Cd*sv*sd*bc01sc04i*"); diff --git a/testsuite/module-playground/mod-fake-scsi-mod.c b/testsuite/module-playground/mod-fake-scsi-mod.c new file mode 100644 index 0000000..916a04d --- /dev/null +++ b/testsuite/module-playground/mod-fake-scsi-mod.c @@ -0,0 +1,21 @@ +#include <linux/init.h> +#include <linux/module.h> + +static int __init test_module_init(void) +{ + return 0; +} + +static void test_module_exit(void) +{ +} +module_init(test_module_init); +module_exit(test_module_exit); + +void dummy_export(void) +{ +} +EXPORT_SYMBOL(dummy_export); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-foo-a.c b/testsuite/module-playground/mod-foo-a.c new file mode 100644 index 0000000..bc65f66 --- /dev/null +++ b/testsuite/module-playground/mod-foo-a.c @@ -0,0 +1,20 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +static int __init foo_init(void) +{ + return 0; +} +module_init(foo_init); + +void print_fooA(void) +{ + pr_warn("fooA\n"); +} +EXPORT_SYMBOL(print_fooA); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-foo-b.c b/testsuite/module-playground/mod-foo-b.c new file mode 100644 index 0000000..09079f6 --- /dev/null +++ b/testsuite/module-playground/mod-foo-b.c @@ -0,0 +1,20 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +static int __init foo_init(void) +{ + return 0; +} +module_init(foo_init); + +void print_fooB(void) +{ + pr_warn("fooB\n"); +} +EXPORT_SYMBOL(print_fooB); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-foo-c.c b/testsuite/module-playground/mod-foo-c.c new file mode 100644 index 0000000..3afd35d --- /dev/null +++ b/testsuite/module-playground/mod-foo-c.c @@ -0,0 +1,20 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +static int __init foo_init(void) +{ + return 0; +} +module_init(foo_init); + +void print_fooC(void) +{ + pr_warn("fooC\n"); +} +EXPORT_SYMBOL(print_fooC); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-foo.c b/testsuite/module-playground/mod-foo.c new file mode 100644 index 0000000..8105608 --- /dev/null +++ b/testsuite/module-playground/mod-foo.c @@ -0,0 +1,23 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +void print_fooA(void); +void print_fooB(void); +void print_fooC(void); + +static int __init foo_init(void) +{ + print_fooA(); + print_fooB(); + print_fooC(); + + return 0; +} + +module_init(foo_init); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-a.c b/testsuite/module-playground/mod-loop-a.c new file mode 100644 index 0000000..e5adb49 --- /dev/null +++ b/testsuite/module-playground/mod-loop-a.c @@ -0,0 +1,27 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printA(); + printB(); + printF(); + printG(); + + return 0; +} +module_init(test_module_init); + +void printA(void) +{ + pr_warn("Hello, world A\n"); +} +EXPORT_SYMBOL(printA); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-b.c b/testsuite/module-playground/mod-loop-b.c new file mode 100644 index 0000000..26232ea --- /dev/null +++ b/testsuite/module-playground/mod-loop-b.c @@ -0,0 +1,27 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printB(); + printC(); + printF(); + printG(); + + return 0; +} +module_init(test_module_init); + +void printB(void) +{ + pr_warn("Hello, world B\n"); +} +EXPORT_SYMBOL(printB); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-c.c b/testsuite/module-playground/mod-loop-c.c new file mode 100644 index 0000000..0b90f7f --- /dev/null +++ b/testsuite/module-playground/mod-loop-c.c @@ -0,0 +1,25 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printC(); + printA(); + + return 0; +} +module_init(test_module_init); + +void printC(void) +{ + pr_warn("Hello, world C\n"); +} +EXPORT_SYMBOL(printC); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-d.c b/testsuite/module-playground/mod-loop-d.c new file mode 100644 index 0000000..9b52305 --- /dev/null +++ b/testsuite/module-playground/mod-loop-d.c @@ -0,0 +1,25 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printD(); + printE(); + + return 0; +} +module_init(test_module_init); + +void printD(void) +{ + pr_warn("Hello, world D\n"); +} +EXPORT_SYMBOL(printD); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-e.c b/testsuite/module-playground/mod-loop-e.c new file mode 100644 index 0000000..a65acb2 --- /dev/null +++ b/testsuite/module-playground/mod-loop-e.c @@ -0,0 +1,25 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printE(); + printD(); + + return 0; +} +module_init(test_module_init); + +void printE(void) +{ + pr_warn("Hello, world E\n"); +} +EXPORT_SYMBOL(printE); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-f.c b/testsuite/module-playground/mod-loop-f.c new file mode 100644 index 0000000..0abb161 --- /dev/null +++ b/testsuite/module-playground/mod-loop-f.c @@ -0,0 +1,24 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printF(); + + return 0; +} +module_init(test_module_init); + +void printF(void) +{ + pr_warn("Hello, world F\n"); +} +EXPORT_SYMBOL(printF); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-g.c b/testsuite/module-playground/mod-loop-g.c new file mode 100644 index 0000000..0965d76 --- /dev/null +++ b/testsuite/module-playground/mod-loop-g.c @@ -0,0 +1,24 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printG(); + + return 0; +} +module_init(test_module_init); + +void printG(void) +{ + pr_warn("Hello, world G\n"); +} +EXPORT_SYMBOL(printG); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-h.c b/testsuite/module-playground/mod-loop-h.c new file mode 100644 index 0000000..6f457e2 --- /dev/null +++ b/testsuite/module-playground/mod-loop-h.c @@ -0,0 +1,25 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printH(); + printI(); + + return 0; +} +module_init(test_module_init); + +void printH(void) +{ + pr_warn("Hello, world H\n"); +} +EXPORT_SYMBOL(printH); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-i.c b/testsuite/module-playground/mod-loop-i.c new file mode 100644 index 0000000..6456217 --- /dev/null +++ b/testsuite/module-playground/mod-loop-i.c @@ -0,0 +1,25 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printI(); + printJ(); + + return 0; +} +module_init(test_module_init); + +void printI(void) +{ + pr_warn("Hello, world I\n"); +} +EXPORT_SYMBOL(printI); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-j.c b/testsuite/module-playground/mod-loop-j.c new file mode 100644 index 0000000..facc81f --- /dev/null +++ b/testsuite/module-playground/mod-loop-j.c @@ -0,0 +1,26 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printJ(); + printH(); + printK(); + + return 0; +} +module_init(test_module_init); + +void printJ(void) +{ + pr_warn("Hello, world J\n"); +} +EXPORT_SYMBOL(printJ); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop-k.c b/testsuite/module-playground/mod-loop-k.c new file mode 100644 index 0000000..49386cc --- /dev/null +++ b/testsuite/module-playground/mod-loop-k.c @@ -0,0 +1,25 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/printk.h> + +#include "mod-loop.h" + +static int __init test_module_init(void) +{ + printK(); + printH(); + + return 0; +} +module_init(test_module_init); + +void printK(void) +{ + pr_warn("Hello, world K\n"); +} +EXPORT_SYMBOL(printK); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("LGPL"); diff --git a/testsuite/module-playground/mod-loop.h b/testsuite/module-playground/mod-loop.h new file mode 100644 index 0000000..b9f5e82 --- /dev/null +++ b/testsuite/module-playground/mod-loop.h @@ -0,0 +1,13 @@ +#pragma once + +void printA(void); +void printB(void); +void printC(void); +void printD(void); +void printE(void); +void printF(void); +void printG(void); +void printH(void); +void printI(void); +void printJ(void); +void printK(void); diff --git a/testsuite/module-playground/mod-simple-i386.ko b/testsuite/module-playground/mod-simple-i386.ko Binary files differnew file mode 100644 index 0000000..9bce6e0 --- /dev/null +++ b/testsuite/module-playground/mod-simple-i386.ko diff --git a/testsuite/module-playground/mod-simple-sparc64.ko b/testsuite/module-playground/mod-simple-sparc64.ko Binary files differnew file mode 100644 index 0000000..17242c8 --- /dev/null +++ b/testsuite/module-playground/mod-simple-sparc64.ko diff --git a/testsuite/module-playground/mod-simple-x86_64.ko b/testsuite/module-playground/mod-simple-x86_64.ko Binary files differnew file mode 100644 index 0000000..0159b99 --- /dev/null +++ b/testsuite/module-playground/mod-simple-x86_64.ko diff --git a/testsuite/module-playground/mod-simple.c b/testsuite/module-playground/mod-simple.c new file mode 100644 index 0000000..503e4d8 --- /dev/null +++ b/testsuite/module-playground/mod-simple.c @@ -0,0 +1,32 @@ +#include <linux/debugfs.h> +#include <linux/init.h> +#include <linux/module.h> + +static struct dentry *debugfs_dir; + +static int test_show(struct seq_file *s, void *data) +{ + seq_puts(s, "test"); + return 0; +} + +DEFINE_SHOW_ATTRIBUTE(test); + +static int __init test_module_init(void) +{ + debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL); + debugfs_create_file("test", 0444, debugfs_dir, NULL, &test_fops); + + return 0; +} + +static void test_module_exit(void) +{ + debugfs_remove_recursive(debugfs_dir); +} + +module_init(test_module_init); +module_exit(test_module_exit); + +MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>"); +MODULE_LICENSE("GPL"); |