• Home
  • Raw
  • Download

Lines Matching refs:GuestAddress

13 pub struct GuestAddress(pub u64);  struct
15 impl GuestAddress { implementation
26 pub fn offset_from(self, base: GuestAddress) -> u64 { in offset_from()
37 pub fn checked_add(self, other: u64) -> Option<GuestAddress> { in checked_add() argument
38 self.0.checked_add(other).map(GuestAddress) in checked_add()
43 pub fn unchecked_add(self, offset: u64) -> GuestAddress { in unchecked_add() argument
44 GuestAddress(self.0 + offset) in unchecked_add()
48 pub fn checked_sub(self, other: u64) -> Option<GuestAddress> { in checked_sub() argument
49 self.0.checked_sub(other).map(GuestAddress) in checked_sub()
53 pub fn mask(self, mask: u64) -> GuestAddress { in mask() argument
54 GuestAddress(self.0 & mask as u64) in mask()
58 impl BitAnd<u64> for GuestAddress { implementation
59 type Output = GuestAddress;
61 fn bitand(self, other: u64) -> GuestAddress { in bitand() argument
62 GuestAddress(self.0 & other as u64) in bitand()
66 impl BitOr<u64> for GuestAddress { implementation
67 type Output = GuestAddress;
69 fn bitor(self, other: u64) -> GuestAddress { in bitor() argument
70 GuestAddress(self.0 | other as u64) in bitor()
74 impl PartialEq for GuestAddress { implementation
75 fn eq(&self, other: &GuestAddress) -> bool { in eq()
79 impl Eq for GuestAddress {} implementation
81 impl Ord for GuestAddress { implementation
82 fn cmp(&self, other: &GuestAddress) -> Ordering { in cmp()
87 impl PartialOrd for GuestAddress { implementation
88 fn partial_cmp(&self, other: &GuestAddress) -> Option<Ordering> { in partial_cmp()
93 impl Display for GuestAddress { implementation
105 let a = GuestAddress(0x300); in equals()
106 let b = GuestAddress(0x300); in equals()
107 let c = GuestAddress(0x301); in equals()
116 let a = GuestAddress(0x300); in cmp()
117 let b = GuestAddress(0x301); in cmp()
125 let a = GuestAddress(0x5050); in mask()
126 assert_eq!(GuestAddress(0x5000), a & 0xff00u64); in mask()
127 assert_eq!(GuestAddress(0x5055), a | 0x0005u64); in mask()
132 let a = GuestAddress(0x50); in add_sub()
133 let b = GuestAddress(0x60); in add_sub()
134 assert_eq!(Some(GuestAddress(0xb0)), a.checked_add(0x60)); in add_sub()
140 let a = GuestAddress(0xffffffffffffff55); in checked_add_overflow()
141 assert_eq!(Some(GuestAddress(0xffffffffffffff57)), a.checked_add(2)); in checked_add_overflow()