kpatch/kpatch-files/kpatch-patch-hook.c
Seth Jennings 6ab1273021 major rewrite to per-section function/data model
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-02-11 10:25:48 -06:00

25 lines
534 B
C

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/printk.h>
#include "../kpatch-kmod/kpatch.h"
extern char __kpatch_patches, __kpatch_patches_end;
static int __init patch_init(void)
{
printk("patch loading\n");
return kpatch_register(THIS_MODULE, &__kpatch_patches,
&__kpatch_patches_end);
}
static void __exit patch_exit(void)
{
printk("patch unloading\n");
kpatch_unregister(THIS_MODULE);
}
module_init(patch_init);
module_exit(patch_exit);
MODULE_LICENSE("GPL");