mirror of
https://github.com/Hizenberg469/Linux-kernel-driver-tutorial.git
synced 2026-04-20 00:42:25 +03:00
Hello World for linux Kernel Module
This commit is contained in:
39
02_better_hello/hello.mod.c
Normal file
39
02_better_hello/hello.mod.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <linux/module.h>
|
||||
#define INCLUDE_VERMAGIC
|
||||
#include <linux/build-salt.h>
|
||||
#include <linux/elfnote-lto.h>
|
||||
#include <linux/export-internal.h>
|
||||
#include <linux/vermagic.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
BUILD_SALT;
|
||||
BUILD_LTO_INFO;
|
||||
|
||||
MODULE_INFO(vermagic, VERMAGIC_STRING);
|
||||
MODULE_INFO(name, KBUILD_MODNAME);
|
||||
|
||||
__visible struct module __this_module
|
||||
__section(".gnu.linkonce.this_module") = {
|
||||
.name = KBUILD_MODNAME,
|
||||
.init = init_module,
|
||||
#ifdef CONFIG_MODULE_UNLOAD
|
||||
.exit = cleanup_module,
|
||||
#endif
|
||||
.arch = MODULE_ARCH_INIT,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_RETPOLINE
|
||||
MODULE_INFO(retpoline, "Y");
|
||||
#endif
|
||||
|
||||
|
||||
static const struct modversion_info ____versions[]
|
||||
__used __section("__versions") = {
|
||||
{ 0xbdfb6dbb, "__fentry__" },
|
||||
{ 0x92997ed8, "_printk" },
|
||||
{ 0x5b8239ca, "__x86_return_thunk" },
|
||||
{ 0xc9d7e676, "module_layout" },
|
||||
};
|
||||
|
||||
MODULE_INFO(depends, "");
|
||||
|
||||
Reference in New Issue
Block a user