mirror of
https://github.com/openharmony/kernel_linux_common_modules.git
synced 2026-08-27 19:49:56 -04:00
@@ -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"
|
||||
}
|
||||
@@ -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>");
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user