20 #include "pedigree/kernel/processor/StackFrame.h" 21 #include "pedigree/kernel/Log.h" 22 #include "pedigree/kernel/processor/state.h" 23 #include "pedigree/kernel/processor/types.h" 43 #if defined(OMIT_FRAMEPOINTER) 44 uint64_t *pPtr =
reinterpret_cast<uint64_t *
>(
45 m_State.rbp + (n - 6 - 1) *
sizeof(uint64_t));
48 reinterpret_cast<uint64_t *
>(
m_State.rbp + (n - 6) *
sizeof(uint64_t));
55 void X64StackFrame::construct(
56 ProcessorState &state, uintptr_t returnAddress,
unsigned int nParams, ...)
60 uintptr_t stack = state.getStackPointer();
63 WARNING(
"StackFrame: given stack was not ABI-compliant, fixing.");
68 uintptr_t *pStack =
reinterpret_cast<uintptr_t *
>(stack);
73 ssize_t nToPush =
static_cast<ssize_t
>(nParams) -
81 uintptr_t *pStackLowWaterMark = pStack;
83 *pStack++ = returnAddress;
86 va_start(list, nParams);
88 for (
size_t i = 0; i < nParams; i++)
90 uintptr_t arg = va_arg(list, uintptr_t);
119 state.setStackPointer(reinterpret_cast<uintptr_t>(pStackLowWaterMark));
const ProcessorState & m_State
virtual uintptr_t getParameter(size_t n)