Skip to content

Commit

Permalink
Alex's #2 review
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
ojeda committed Sep 7, 2020
1 parent 351ab09 commit d55f1d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions drivers/char/rust_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
name = "rust_example"
version = "0.1.0"
edition = "2018"
publish = false

[lib]
crate-type = ["staticlib"]
Expand Down
1 change: 1 addition & 0 deletions rust/kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name = "kernel"
version = "0.1.0"
authors = ["Rust for Linux Contributors"]
edition = "2018"
publish = false

[dependencies]
bitflags = "1"
Expand Down
7 changes: 5 additions & 2 deletions rust/kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ macro_rules! kernel_module {

// Built-in modules are initialized through an initcall pointer
//
// TODO: find a proper way to emulate the C macro, including
// dealing with `HAVE_ARCH_PREL32_RELOCATIONS`
// TODO: find a proper way to emulate the C macro (`module_init`),
// including dealing with `HAVE_ARCH_PREL32_RELOCATIONS`
#[cfg(not(module))]
#[link_section = ".initcall6.init"]
#[used]
pub static __initcall: extern "C" fn() -> $crate::c_types::c_int = init_module;

// TODO: pass the kernel module name here to generate a unique,
// helpful symbol name (the name would also useful for the `modinfo`
// issue below).
#[no_mangle]
pub extern "C" fn init_module() -> $crate::c_types::c_int {
match <$module as $crate::KernelModule>::init() {
Expand Down

0 comments on commit d55f1d9

Please sign in to comment.