driver-tutorial finished

This commit is contained in:
2025-02-25 08:19:58 +00:00
parent 8a8b8cf56a
commit 9eed2d489b
17 changed files with 2393 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
#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>
#ifdef CONFIG_UNWINDER_ORC
#include <asm/orc_header.h>
ORC_HEADER;
#endif
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 char ____versions[]
__used __section("__versions") =
"\x1c\x00\x00\x00\x2b\x2f\xec\xe3"
"alloc_chrdev_region\0"
"\x14\x00\x00\x00\x5f\x7c\x28\xd8"
"cdev_init\0\0\0"
"\x14\x00\x00\x00\xda\xfb\x89\x12"
"cdev_add\0\0\0\0"
"\x18\x00\x00\x00\x39\x63\xf4\xc6"
"init_timer_key\0\0"
"\x18\x00\x00\x00\x55\x48\x0e\xdc"
"timer_delete\0\0\0\0"
"\x14\x00\x00\x00\xa2\x7e\x12\x7c"
"cdev_del\0\0\0\0"
"\x24\x00\x00\x00\x33\xb3\x91\x60"
"unregister_chrdev_region\0\0\0\0"
"\x14\x00\x00\x00\xbb\x6d\xfb\xbd"
"__fentry__\0\0"
"\x10\x00\x00\x00\x7e\x3a\x2c\x12"
"_printk\0"
"\x1c\x00\x00\x00\xca\x39\x82\x5b"
"__x86_return_thunk\0\0"
"\x10\x00\x00\x00\xa6\x50\xba\x15"
"jiffies\0"
"\x14\x00\x00\x00\xb8\x83\x8c\xc3"
"mod_timer\0\0\0"
"\x18\x00\x00\x00\xf8\x1a\x94\x92"
"module_layout\0\0\0"
"\x00\x00\x00\x00\x00\x00\x00\x00";
MODULE_INFO(depends, "");
MODULE_INFO(srcversion, "7D7C66AAC1FA4296375BED7");