work
This commit is contained in:
+23
-3
@@ -28,7 +28,27 @@ impl Arch for X86_64 {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct CallConv {
|
||||
volatile: Vec<Reg>,
|
||||
nonvolatile: Vec<Reg>,
|
||||
pub enum CallConv {
|
||||
SystemV,
|
||||
}
|
||||
|
||||
impl CallConv {
|
||||
pub fn param(&self) -> &[Reg] {
|
||||
use regs::*;
|
||||
match self {
|
||||
Self::SystemV => &[rdi, rsi, rdx, rcx, r8, r9],
|
||||
}
|
||||
}
|
||||
pub fn scratch(&self) -> &[Reg] {
|
||||
use regs::*;
|
||||
match self {
|
||||
Self::SystemV => &[rax, rdi, rsi, rdx, rcx, r8, r9, r10, r11],
|
||||
}
|
||||
}
|
||||
pub fn ret(&self) -> &[Reg] {
|
||||
use regs::*;
|
||||
match self {
|
||||
Self::SystemV => &[rax, rdx],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user