Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 6th, 2018 88 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #[derive(Debug, Copy, Clone)]
  2. pub struct Cr3(u64);
  3.  
  4. impl Cr3 {
  5.     #[inline(always)]
  6.     pub fn read_register() -> Cr3 {
  7.         let cr3: Cr3;
  8.         unsafe {asm!("mov %cr3, %rax" :  "=rax"(cr3) ::: );}
  9.         cr3
  10.     }
  11.     #[inline(always)]
  12.     pub unsafe fn save(&self) {
  13.         asm!("mov %rax, %cr3" :: "rax"(self.0) :: );
  14.     }
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Pastebin PRO 'CHRISTMAS SPECIAL'!
Get 60% OFF Pastebin PRO accounts!
 
Top