diff options
Diffstat (limited to 'mirai/crimson/types/frame.zig')
| -rw-r--r-- | mirai/crimson/types/frame.zig | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/mirai/crimson/types/frame.zig b/mirai/crimson/types/frame.zig index 5960654..20f89fb 100644 --- a/mirai/crimson/types/frame.zig +++ b/mirai/crimson/types/frame.zig @@ -1,11 +1,24 @@ //! Interrupt Stack Frame pub const Frame = extern struct { - error_code: u64, rip: u64, cs: u64, rflags: u64, rsp: u64, ss: u64, - pub fn is_user_mode(self: *const Frame) bool { return (self.cs & 0x3) == 3; } - pub fn is_kernel_mode(self: *const Frame) bool { return (self.cs & 0x3) == 0; } + error_code: u64, + rip: u64, + cs: u64, + rflags: u64, + rsp: u64, + ss: u64, + pub fn is_user_mode(self: *const Frame) bool { + return (self.cs & 0x3) == 3; + } + pub fn is_kernel_mode(self: *const Frame) bool { + return (self.cs & 0x3) == 0; + } }; pub const FrameNoError = extern struct { - rip: u64, cs: u64, rflags: u64, rsp: u64, ss: u64, + rip: u64, + cs: u64, + rflags: u64, + rsp: u64, + ss: u64, }; |
