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