/home/lihacker/develop/svn/ldd6410-read-only/training/kernel/drivers/export
< export_symb.c >
/*
* A simple kernel module to introduce export symbol
*
* The initial developer of the original code is Baohua Song
* <author@linuxdriver.cn>. All Rights Reserved.
*/
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
int add_integar(int a,int b)
{
return a+b;
}
int sub_integar(int a,int b)
{
return a-b;
}
EXPORT_SYMBOL(add_integar);
EXPORT_SYMBOL(sub_integar);
< Makefile >
KVERS = $(shell uname -r)
# Kernel modules
obj-m += export_symb.o
# Specify flags for the module compilation.
#EXTRA_CFLAGS=-g -O0
build: kernel_modules
kernel_modules:
make -C /lib/modules/$(KVERS)/build M=$(CURDIR) modules
clean:
make -C /lib/modules/$(KVERS)/build M=$(CURDIR) clean