userspace/target/architecture/
x86_64.rs1#![no_std]
2#![allow(incomplete_features)]
3#![feature(generic_const_exprs)]
4#![feature(generic_const_items)]
5
6pub mod callable;
7pub mod result;
8pub mod syscall;
9pub mod page {
12 pub const SIZE: usize = 0x1000;
13}
14
15pub use result::{Error, Ok, Result};
16
17pub type PointerType = *const u64;
18
19ample::tuple!(
20 #[derive(Debug, Clone, Copy)]
21 pub struct Pointer(0: pub PointerType)
22);
23
24impl Pointer {
25 pub fn current() -> Self {
26 let p: PointerType;
27 unsafe { core::arch::asm!("mov {}, rsp", out(reg) p) };
28 Pointer(p)
29 }
30
31 pub fn as_ptr(self) -> PointerType {
32 self.0
33 }
34}