This repository was archived by the owner on Mar 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 13 files changed +20
-36
lines changed
Expand file tree Collapse file tree 13 files changed +20
-36
lines changed Original file line number Diff line number Diff line change 1- extern crate bindgen;
2- extern crate cc;
3- extern crate shlex;
1+ use bindgen;
2+ use cc;
3+ use shlex;
44
55use std:: env;
66use std:: path:: PathBuf ;
Original file line number Diff line number Diff line change 11#![ no_std]
22#![ feature( alloc, const_str_as_bytes) ]
33
4- extern crate alloc;
54use alloc:: borrow:: ToOwned ;
65use alloc:: string:: String ;
76
8- # [ macro_use ]
9- extern crate linux_kernel_module;
7+ use linux_kernel_module ;
8+ use linux_kernel_module:: println ;
109
1110struct HelloWorldModule {
1211 message : String ,
@@ -28,7 +27,7 @@ impl Drop for HelloWorldModule {
2827 }
2928}
3029
31- kernel_module ! (
30+ linux_kernel_module :: kernel_module!(
3231 HelloWorldModule ,
3332 author: "Alex Gaynor and Geoffrey Thomas" ,
3433 description: "An extremely simple kernel module" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ use core::default::Default;
33use core:: marker;
44use core:: mem;
55
6+ use bitflags;
7+
68use crate :: bindings;
79use crate :: c_types;
810use crate :: error;
@@ -24,7 +26,7 @@ pub trait FileSystem {
2426 const FLAGS : FileSystemFlags ;
2527}
2628
27- bitflags ! {
29+ bitflags:: bitflags ! {
2830 pub struct FileSystemFlags : c_types:: c_int {
2931 const FS_REQUIRES_DEV = bindings:: FS_REQUIRES_DEV as c_types:: c_int;
3032 const FS_BINARY_MOUNTDATA = bindings:: FS_BINARY_MOUNTDATA as c_types:: c_int;
@@ -34,12 +36,6 @@ bitflags! {
3436 }
3537}
3638
37- impl FileSystemFlags {
38- pub const fn const_empty ( ) -> FileSystemFlags {
39- FileSystemFlags { bits : 0 }
40- }
41- }
42-
4339extern "C" fn fill_super_callback < T : FileSystem > (
4440 _sb : * mut bindings:: super_block ,
4541 _data : * mut c_types:: c_void ,
Original file line number Diff line number Diff line change 11#![ no_std]
2- #![ feature( allocator_api, const_fn , alloc_error_handler) ]
2+ #![ feature( allocator_api, alloc_error_handler) ]
33
4- #[ macro_use]
54extern crate alloc;
6- #[ macro_use]
7- extern crate bitflags;
85
96use core:: panic:: PanicInfo ;
107
@@ -14,7 +11,6 @@ mod c_types;
1411pub mod chrdev;
1512mod error;
1613pub mod filesystem;
17- #[ macro_use]
1814pub mod printk;
1915pub mod sysctl;
2016mod types;
@@ -53,7 +49,7 @@ macro_rules! kernel_module {
5349 }
5450
5551 $(
56- kernel_module!( @attribute $name, $value) ;
52+ $crate :: kernel_module!( @attribute $name, $value) ;
5753 ) *
5854 } ;
5955
Original file line number Diff line number Diff line change 11use alloc:: boxed:: Box ;
2+ use alloc:: vec;
23use core:: mem;
34use core:: ptr;
45use core:: sync:: atomic;
Original file line number Diff line number Diff line change 1+ use alloc:: vec;
12use alloc:: vec:: Vec ;
23use core:: u32;
34
Original file line number Diff line number Diff line change 11#![ no_std]
22#![ feature( const_str_as_bytes) ]
33
4- #[ macro_use]
5- extern crate linux_kernel_module;
4+ use linux_kernel_module;
65
76struct ChrdevTestModule {
87 _dev : linux_kernel_module:: chrdev:: DeviceNumberRegion ,
@@ -19,7 +18,7 @@ impl linux_kernel_module::KernelModule for ChrdevTestModule {
1918 }
2019}
2120
22- kernel_module ! (
21+ linux_kernel_module :: kernel_module!(
2322 ChrdevTestModule ,
2423 author: "Alex Gaynor and Geoffrey Thomas" ,
2524 description: "A module for testing character devices" ,
Original file line number Diff line number Diff line change 1- extern crate kernel_module_tests;
2-
31use kernel_module_tests:: with_kernel_module;
42use std:: fs;
53
Original file line number Diff line number Diff line change 11#![ no_std]
22#![ feature( const_str_as_bytes) ]
33
4- #[ macro_use]
5- extern crate linux_kernel_module;
4+ use linux_kernel_module:: { self , println} ;
65
76struct PrintkTestModule ;
87
@@ -16,7 +15,7 @@ impl linux_kernel_module::KernelModule for PrintkTestModule {
1615 }
1716}
1817
19- kernel_module ! (
18+ linux_kernel_module :: kernel_module!(
2019 PrintkTestModule ,
2120 author: "Alex Gaynor and Geoffrey Thomas" ,
2221 description: "A module for testing println!()" ,
Original file line number Diff line number Diff line change 1- extern crate kernel_module_tests;
2-
31use std:: process:: Command ;
42
53use kernel_module_tests:: with_kernel_module;
You can’t perform that action at this time.
0 commit comments