Skip to content

Commit 71cab72

Browse files
committed
hogefunc added
1 parent fca2673 commit 71cab72

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

multifile/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
obj-m += startstop.o
2-
startstop-objs := start.o stop.o
2+
startstop-objs := hogefunc.o start.o stop.o
33

44
all:
55
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

multifile/hogefunc.c

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <linux/module.h>
2+
#include <linux/kernel.h>
3+
4+
void print_hello(void)
5+
{
6+
printk(KERN_INFO "Hello World!!!!!!!\n");
7+
}

multifile/hogefunc.h

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void print_hello(void);

multifile/start.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#include <linux/module.h>
22
#include <linux/kernel.h>
33

4+
#include "hogefunc.h"
45

56
int init_module(void)
67
{
7-
printk(KERN_INFO "Hello world!\n");
8+
print_hello();
89
return 0;
910
}

0 commit comments

Comments
 (0)