Implement ArGetStackPointer() routine
This commit is contained in:
parent
83c692bfcb
commit
71d0608643
|
@ -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).
|
||||
*
|
||||
|
|
|
@ -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("mov %%esp, %%eax\n"
|
||||
"ret\n"
|
||||
:
|
||||
:
|
||||
:);
|
||||
}
|
||||
|
||||
/**
|
||||
* Halts the central processing unit (CPU).
|
||||
*
|
||||
|
|
|
@ -21,6 +21,11 @@ XTCDECL
|
|||
BOOLEAN
|
||||
ArCpuId(IN OUT PCPUID_REGISTERS Registers);
|
||||
|
||||
XTASSEMBLY
|
||||
XTCDECL
|
||||
ULONG_PTR
|
||||
ArGetStackPointer();
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
ArHalt();
|
||||
|
|
|
@ -21,6 +21,11 @@ XTCDECL
|
|||
BOOLEAN
|
||||
ArCpuId(IN OUT PCPUID_REGISTERS Registers);
|
||||
|
||||
XTASSEMBLY
|
||||
XTCDECL
|
||||
ULONG_PTR
|
||||
ArGetStackPointer();
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
ArHalt();
|
||||
|
|
Loading…
Reference in New Issue
Block a user