Implement ArGetStackPointer() routine

This commit is contained in:
2023-11-19 00:09:16 +01:00
parent 83c692bfcb
commit 71d0608643
4 changed files with 50 additions and 0 deletions

View File

@@ -67,6 +67,26 @@ ArCpuId(IN OUT PCPUID_REGISTERS Registers)
return TRUE;
}
/**
* Gets the address of the current stack register.
*
* @return This routine returns the current stack pointer.
*
* @since XT 1.0
*/
XTASSEMBLY
XTCDECL
ULONG_PTR
ArGetStackPointer()
{
/* Get current stack pointer */
asm volatile("movq %%rsp, %%rax\n"
"retq\n"
:
:
:);
}
/**
* Halts the central processing unit (CPU).
*