-
Notifications
You must be signed in to change notification settings - Fork 18
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
4 changed files
with
50 additions
and
1 deletion.
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
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
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
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,45 @@ | ||
use std::sync::Arc; | ||
|
||
use crate::{ | ||
errno::Errno, | ||
fs::{make_dev, Cdev, CdevSw, DriverFlags, MakeDev, Mode, OpenFlags}, | ||
process::VThread, | ||
ucred::{Gid, Uid}, | ||
}; | ||
|
||
#[derive(Debug)] | ||
pub struct SblManager {} | ||
|
||
impl SblManager { | ||
pub fn new() -> Arc<Self> { | ||
let sbl = Arc::new(Self {}); | ||
|
||
let sbl_srv_cdevsw = Arc::new(CdevSw::new( | ||
DriverFlags::D_INIT, | ||
Some(Self::sbl_srv_open), | ||
None, | ||
)); | ||
|
||
let _ = make_dev( | ||
&sbl_srv_cdevsw, | ||
0, | ||
"sbl_srv", | ||
Uid::ROOT, | ||
Gid::ROOT, | ||
Mode::new(0o600).unwrap(), | ||
None, | ||
MakeDev::MAKEDEV_ETERNAL, | ||
); | ||
|
||
sbl | ||
} | ||
|
||
fn sbl_srv_open( | ||
_: &Arc<Cdev>, | ||
_: OpenFlags, | ||
_: i32, | ||
_: Option<&VThread>, | ||
) -> Result<(), Box<dyn Errno>> { | ||
todo!() | ||
} | ||
} |