summaryrefslogtreecommitdiff
path: root/arch/x86/um/shared/sysdep/stub_64.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/um/shared/sysdep/stub_64.h')
-rw-r--r--arch/x86/um/shared/sysdep/stub_64.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/um/shared/sysdep/stub_64.h b/arch/x86/um/shared/sysdep/stub_64.h
index 6e2626b77a2e..e9c4b2b38803 100644
--- a/arch/x86/um/shared/sysdep/stub_64.h
+++ b/arch/x86/um/shared/sysdep/stub_64.h
@@ -108,4 +108,16 @@ static inline void remap_stack_and_trap(void)
__syscall_clobber, "r10", "r8", "r9");
}
+static __always_inline void *get_stub_page(void)
+{
+ unsigned long ret;
+
+ asm volatile (
+ "movq %%rsp,%0 ;"
+ "andq %1,%0"
+ : "=a" (ret)
+ : "g" (~(UM_KERN_PAGE_SIZE - 1)));
+
+ return (void *)ret;
+}
#endif