userspace/target/
architecture.rs

1#[cfg(target_arch = "x86_64")]
2pub mod x86_64;
3#[cfg(target_arch = "x86_64")]
4pub use x86_64::*;
5
6pub mod macros;
7pub mod traits;
8
9pub struct Arch;
10
11impl core::ops::Sub for Pointer {
12    type Output = usize;
13    fn sub(self, rhs: Self) -> Self::Output {
14        self.0 as usize - rhs.0 as usize // diferença em bytes
15    }
16}
17
18impl core::ops::Add<usize> for Pointer {
19    type Output = Pointer;
20    fn add(self, offset: usize) -> Self::Output {
21        Pointer(unsafe { self.0.add(offset) })
22    }
23}