chore: migrate src to solutions
This commit is contained in:
167 files changed
+17
-17
No files matched your search
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"/buildroot/output/build/linux-5.15.148/include",
|
||||
"/buildroot/output/build/linux-5.15.148/arch/arm64/include",
|
||||
"/buildroot/output/build/linux-5.15.148/arch/arm64/include/generated"
|
||||
],
|
||||
"defines": [],
|
||||
"compilerPath": "/usr/bin/clang",
|
||||
"cStandard": "c99",
|
||||
"cppStandard": "c++14",
|
||||
"intelliSenseMode": "linux-clang-arm64"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
export PATH := /buildroot/output/host/usr/sbin$\
|
||||
:/buildroot/output/host/usr/bin/$\
|
||||
:/buildroot/output/host/sbin$\
|
||||
:/buildroot/output/host/bin/$\
|
||||
:$(PATH)
|
||||
|
||||
# Part executed when called from kernel build system:
|
||||
ifneq ($(KERNELRELEASE),)
|
||||
obj-m += mymodule.o ## name of the generated module
|
||||
|
||||
mymodule-objs := skeleton.o ## list of objects needed for that module
|
||||
CFLAGS_skeleton.o := -DDEBUG
|
||||
|
||||
# Part executed when called from standard make in module source directory:
|
||||
else
|
||||
include ../../kernel_settings
|
||||
PWD := $(shell pwd)
|
||||
|
||||
all:
|
||||
$(MAKE) -C $(KDIR) M=$(PWD) ARCH=$(CPU) CROSS_COMPILE=$(TOOLS) modules
|
||||
|
||||
clean:
|
||||
$(MAKE) -C $(KDIR) M=$(PWD) clean
|
||||
echo $(PATH)
|
||||
|
||||
install:
|
||||
$(MAKE) -C $(KDIR) M=$(PWD) INSTALL_MOD_PATH=$(MODPATH) modules_install
|
||||
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// skeleton.c
|
||||
#include <linux/module.h> // needed by all modules
|
||||
#include <linux/init.h> // needed for macros
|
||||
#include <linux/kernel.h> // needed for debugging
|
||||
|
||||
#include <linux/moduleparam.h> // needed for module parameters
|
||||
|
||||
static char* text = "dummy text";
|
||||
module_param(text, charp, 0664);
|
||||
static int elements = 1;
|
||||
module_param(elements, int, 0);
|
||||
|
||||
static int __init skeleton_init(void)
|
||||
{
|
||||
pr_info ("Linux module 01 skeleton loaded\n");
|
||||
pr_debug (" text: %s\n elements: %d\n", text, elements);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit skeleton_exit(void)
|
||||
{
|
||||
pr_info ("Linux module skeleton unloaded\n");
|
||||
}
|
||||
|
||||
module_init (skeleton_init);
|
||||
module_exit (skeleton_exit);
|
||||
|
||||
MODULE_AUTHOR ("Daniel Gachet <daniel.gachet@hefr.ch>");
|
||||
MODULE_DESCRIPTION ("Module skeleton");
|
||||
MODULE_LICENSE ("GPL");
|
||||
|
||||
Reference in new issue
Block a user