#pragma once #include namespace x86 { struct cpu_state { /* pusha */ uint32_t edi, esi; // destination index, source index uint32_t ebp, esp; // base pointer, stack pointer uint32_t ebx, edx, ecx, eax; // general registers uint32_t irq; uint32_t error; /* stack frame, pushed by cpu */ uint32_t eip; uint32_t cs; uint32_t eflags; uint32_t __esp; uint32_t ss; } __attribute__((packed)); } // namespace x86 typedef x86::cpu_state cpu_state_t;