20 #ifndef KERNEL_PROCESSOR_X64_STATE_H 21 #define KERNEL_PROCESSOR_X64_STATE_H 25 #include "pedigree/kernel/Log.h" 26 #include "pedigree/kernel/compiler.h" 27 #include "pedigree/kernel/processor/types.h" 72 processor_register_t
getRegister(
size_t index)
const;
101 inline void setFlags(uint64_t flags);
207 processor_register_t
getRegister(
size_t index)
const;
222 inline size_t getSyscallService()
const;
225 inline size_t getSyscallNumber()
const;
227 inline uintptr_t getSyscallParameter(
size_t n)
const;
228 inline void setSyscallReturnValue(uintptr_t val);
229 inline void setSyscallErrno(uintptr_t val);
232 inline void setFlags(uint64_t newFlags);
363 uint64_t r8, r9, r10, r11, r12, r13, r14, r15;
373 uint8_t x87FPU_MMX_XMM_MXCSR_State[512 + 16]
__attribute__((aligned(16)));
387 m_Rsp = stackPointer;
395 m_Rip = instructionPointer;
412 return (
m_Cs == 0x08);
434 m_Rsp = stackPointer;
442 m_RipRcx = instructionPointer;
459 return ((
m_Rax >> 16) & 0xFFFF);
463 return (
m_Rax & 0xFFFF);
497 WARNING(
"Bad syscall parameter requested: " <<
Dec << n);
501 void X64SyscallState::setSyscallReturnValue(uintptr_t val)
505 void X64SyscallState::setSyscallErrno(uintptr_t val)
509 uint64_t X64SyscallState::getFlags()
const 513 void X64SyscallState::setFlags(uint64_t newFlags)
515 m_RFlagsR11 = newFlags;
519 : r15(), r14(), r13(), r12(), r11(), r10(), r9(), r8(), rbp(), rsi(), rdi(),
520 rdx(), rcx(), rbx(), rax(), rip(), rflags(), rsp()
531 :
r15(x.m_R15),
r14(x.m_R14),
r13(x.m_R13),
r12(x.m_R12),
r11(x.m_R11),
532 r10(x.m_R10),
r9(x.m_R9),
r8(x.m_R8),
rbp(x.m_Rbp),
rsi(x.m_Rsi),
538 :
r15(x.m_R15),
r14(x.m_R14),
r13(x.m_R13),
r12(x.m_R12),
539 r11(x.m_RFlagsR11),
r10(x.m_R10),
r9(x.m_R9),
r8(x.m_R8),
rbp(x.m_Rbp),
540 rsi(x.m_Rsi),
rdi(x.m_Rdi),
rdx(x.m_Rdx),
rcx(x.m_RipRcx),
rbx(x.m_Rbx),
628 rip = instructionPointer;
X64ProcessorState & operator=(const X64ProcessorState &)
size_t getSyscallNumber() const
void setStackPointer(uintptr_t stackPointer)
uint64_t getFlags() const
processor_register_t getRegister(size_t index) const
uintptr_t getInstructionPointer() const
void setBasePointer(uintptr_t basePointer)
void setFlags(uint64_t flags)
size_t getInterruptNumber() const
uintptr_t getInstructionPointer() const
void setRegister(size_t index, uintptr_t value)
uintptr_t getBasePointer() const
static X64InterruptState * construct(class X64ProcessorState &state, bool userMode)
uintptr_t getInstructionPointer() const
void setInstructionPointer(uintptr_t instructionPointer)
uintptr_t getStackPointer() const
size_t getRegisterCount() const
size_t getRegisterSize(size_t index) const
X64InterruptState & operator=(const X64InterruptState &)
size_t getSyscallService() const
const char * getRegisterName(size_t index) const
uintptr_t getSyscallParameter(size_t n) const
size_t getRegisterSize(size_t index) const
void setBasePointer(uintptr_t basePointer)
void setInstructionPointer(uintptr_t instructionPointer)
uintptr_t getBasePointer() const
uintptr_t getBasePointer() const
uintptr_t getStackPointer() const
void setStackPointer(uintptr_t stackPointer)
void setBasePointer(uintptr_t basePointer)
uintptr_t getStackPointer() const
void setInstructionPointer(uintptr_t instructionPointer)
void setStackPointer(uintptr_t stackPointer)