20 #include "pedigree/kernel/processor/state.h" 21 #include "pedigree/kernel/processor/types.h" 23 static const char *X64InterruptStateRegisterName[18] = {
24 "rax",
"rbx",
"rcx",
"rdx",
"rdi",
"rsi",
"rbp",
"r8",
"r9",
25 "r10",
"r11",
"r12",
"r13",
"r14",
"r15",
"rsp",
"rip",
"rflags"};
27 static const char *X64SyscallStateRegisterName[16] = {
28 "rax",
"rbx",
"rdx",
"rdi",
"rsi",
"rbp",
"r8",
"r9",
29 "r10",
"r12",
"r13",
"r14",
"r15",
"rsp",
"rip",
"rflags"};
116 return X64InterruptStateRegisterName[index];
161 return X64SyscallStateRegisterName[index];
168 uintptr_t *pStack =
reinterpret_cast<uintptr_t *
>(state.
getStackPointer());
170 *--pStack = (userMode) ? 0x23 : 0x10;
171 *--pStack = state.
rsp;
173 *--pStack = (userMode) ? 0x1b : 0x08;
174 *--pStack = state.
rip;
177 *--pStack = state.
rax;
178 *--pStack = state.
rbx;
179 *--pStack = state.
rcx;
180 *--pStack = state.
rdx;
181 *--pStack = state.
rdi;
182 *--pStack = state.
rsi;
183 *--pStack = state.
rbp;
184 *--pStack = state.
r8;
185 *--pStack = state.
r9;
186 *--pStack = state.
r10;
187 *--pStack = state.
r11;
188 *--pStack = state.
r12;
189 *--pStack = state.
r13;
190 *--pStack = state.
r14;
191 *--pStack = state.
r15;
processor_register_t getRegister(size_t index) const
void setRegister(size_t index, uintptr_t value)
processor_register_t getRegister(size_t index) const
static X64InterruptState * construct(class X64ProcessorState &state, bool userMode)
size_t getRegisterCount() const
size_t getRegisterCount() const
const char * getRegisterName(size_t index) const
const char * getRegisterName(size_t index) const
uintptr_t getStackPointer() const
uintptr_t getStackPointer() const