-
Notifications
You must be signed in to change notification settings - Fork 677
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
Conrad Kramer
committed
Dec 10, 2016
1 parent
cfcd249
commit bfb9150
Showing
12 changed files
with
206 additions
and
136 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
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,36 @@ | ||
mod consts { | ||
pub const VOID: u32 = 0x20000000; | ||
pub const OUT: u32 = 0x40000000; | ||
pub const IN: u32 = 0x80000000; | ||
pub const INOUT: u32 = (IN|OUT); | ||
pub const IOCPARM_MASK: u32 = 0x1fff; | ||
} | ||
|
||
pub use self::consts::*; | ||
|
||
#[macro_export] | ||
macro_rules! ioc { | ||
($inout:expr, $group:expr, $num:expr, $len:expr) => ( | ||
$inout | (($len as u32 & $crate::sys::ioctl::IOCPARM_MASK) << 16) | (($group as u32) << 8) | ($num as u32) | ||
) | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! io { | ||
($g:expr, $n:expr) => (ioc!($crate::sys::ioctl::VOID, $g, $n, 0)) | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! ior { | ||
($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::OUT, $g, $n, $len)) | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! iow { | ||
($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::IN, $g, $n, $len)) | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! iorw { | ||
($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::INOUT, $g, $n, $len)) | ||
} |
Empty file.
Empty file.
Empty file.
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
Empty file.
Empty file.
Empty file.
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
Oops, something went wrong.