forked from rcore-os/rust-for-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# 自定义一个linux内核函数, 并在rust模块中调用它. | ||
|
||
# step1 | ||
在linux include目录下创建一个头文件xx.h, 在里面写好自定义的一个函数, 打印一行log出来. | ||
|
||
# step2 | ||
在linux rust/bindings/bindings_helper.h中把step1中的头文件引用进来. 在rust/helpers.c中参考其中已有例子,生成rust_helper_为前缀的函数. | ||
|
||
# step3 | ||
在之前的helloworld模块中引入kernel::bindings::*; 通过bindings::函数名方式调用. | ||
|
||
|