regs.h (764B)
1 #ifndef KIT_ARCH_X64_REGS_H 2 #define KIT_ARCH_X64_REGS_H 3 4 #include <stdint.h> 5 6 const char* x64_register_name(uint32_t dwarf_idx); 7 int x64_register_index(const char* name, uint32_t* idx_out); 8 int x64_register_hw_index(const char* name, uint32_t* idx_out); 9 /* Map an x86-64 hardware GPR index (0..15, the ModR/M/REX encoding) to its 10 * System V DWARF register number. The two namespaces differ for rcx/rdx/rsi/ 11 * rdi/rsp/rbp (e.g. rbp is HW 5 but DWARF 6); r8..r15 and rax/rbx are identity. 12 * Indices >= 16 (e.g. the literal rip column) pass through unchanged. */ 13 uint32_t x64_dwarf_from_hw_gpr(uint32_t hw); 14 uint32_t x64_register_iter_size(void); 15 int x64_register_iter_get(uint32_t i, uint32_t* dwarf_out, 16 const char** name_out); 17 18 #endif