rt: Add {get,record}_sp_limit on Win64
Uses ArbitraryUserPointer area at gs:0x28.
This commit is contained in:
parent
5118ef6ff0
commit
a35bfa2e9b
1 changed files with 8 additions and 0 deletions
|
|
@ -43,6 +43,10 @@ extern "C" CDECL ALWAYS_INLINE uintptr_t get_sp_limit() {
|
|||
asm volatile (
|
||||
"movq %%fs:24, %0"
|
||||
: "=r"(limit));
|
||||
#elif defined(_WIN64)
|
||||
asm volatile (
|
||||
"movq %%gs:0x28, %0"
|
||||
: "=r"(limit));
|
||||
#endif
|
||||
|
||||
return limit;
|
||||
|
|
@ -65,6 +69,10 @@ extern "C" CDECL ALWAYS_INLINE void record_sp_limit(void *limit) {
|
|||
asm volatile (
|
||||
"movq %0, %%fs:24"
|
||||
:: "r"(limit));
|
||||
#elif defined(_WIN64)
|
||||
asm volatile (
|
||||
"movq %0, %%gs:0x28"
|
||||
:: "r"(limit));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue