ko sample

Signed-off-by: zhujiaxin <zhujiaxin@huawei.com>
This commit is contained in:
zhujiaxin
2023-11-25 10:14:11 +08:00
parent f1c9ac1ca9
commit 464cb72f4b
6 changed files with 56 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
import("//build/templates/kernel/ohos_kernel_build.gni")
ohos_build_ko("ko_sample") {
sources = [ "//kernel/linux/common_modules/module_sample/ko_sample.c",
"//kernel/linux/common_modules/module_sample/sample_fun.c" ]
target_ko_name = "kosample"
device_name = device_name
device_arch = "arm64"
}
+23
View File
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: GPL-2.0
/*
* ko sample
*
*/
#include <linux/init.h>
#include <linux/module.h>
static int kosample_init(void)
{
pr_info("ko sample: %s\n", __func__);
return 0;
}
static void kosample_exit(void)
{
pr_info("ko sample: %s\n", __func__);
}
module_init(kosample_init);
module_exit(kosample_exit);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("zhujiaxin <zhujiaxin@huawei.com>");
+15
View File
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-2.0
/*
* ko sample
*
*/
#include <linux/init.h>
#include <linux/module.h>
int kosample_fun(void)
{
pr_info("ko sample call: %s\n", __func__);
return 0;
}