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
9ample::r#struct!(
10    pub struct Arch {}
11);
12
13impl core::ops::Sub for Pointer {
14    type Output = usize;
15    fn sub(self, rhs: Self) -> Self::Output {
16        self.0 as usize - rhs.0 as usize // diferença em bytes
17    }
18}
19
20impl core::ops::Add<usize> for Pointer {
21    type Output = Pointer;
22    fn add(self, offset: usize) -> Self::Output {
23        Pointer(unsafe { self.0.add(offset) })
24    }
25}