lamina_codegen/x86_64/constants.rs
1//! x86_64 platform-specific constants.
2
3/// macOS syscall numbers (with 0x2000000 offset)
4pub mod macos {
5 /// write syscall on macOS
6 pub const SYS_WRITE: i64 = 0x2000004;
7}
8
9/// Linux syscall numbers
10pub mod linux {
11 /// write syscall on Linux
12 pub const SYS_WRITE: i64 = 1;
13}
14
15/// Standard file descriptors
16pub mod fd {
17 /// Standard output
18 pub const STDOUT: i64 = 1;
19 /// Standard input
20 pub const STDIN: i64 = 0;
21 /// Standard error
22 pub const STDERR: i64 = 2;
23}
24
25/// Windows x64 calling convention constants
26pub mod windows {
27 /// Shadow space size (32 bytes) required before function calls
28 pub const SHADOW_SPACE_SIZE: i32 = 32;
29}
30
31/// Stack alignment constants
32pub mod stack {
33 /// Minimum stack alignment (16 bytes)
34 pub const ALIGNMENT: usize = 16;
35 /// Size of a stack slot (8 bytes)
36 pub const SLOT_SIZE: usize = 8;
37}