# MARKUS MAIWALD (ARCHITECT) | VOXIS FORGE (AI)
# RUMPK HAL // X86_64 CONSTANTS

# x86_64 Context Frame (System V ABI)
# 6 callee-saved: rbx, rbp, r12, r13, r14, r15
# Each 8 bytes = 48 bytes for regs
# + 8 bytes for return address (RIP)
# Total: 56 bytes, but we round to 64 for alignment
const CONTEXT_SIZE* = 56

# Stack layout after pushes in switch.S:
#   [rsp + 0]  = r15
#   [rsp + 8]  = r14
#   [rsp + 16] = r13
#   [rsp + 24] = r12
#   [rsp + 32] = rbx
#   [rsp + 40] = rbp
#   [rsp + 48] = rip (return address, pushed by call or manually)

const RIP_OFFSET* = 6 # RIP at index 6 for init (48 / 8)
