Rather than trying to get the syscall number directly from %rax on
x86_64, which is error prone due to compiler changes causing that
register to get clobbered, we use the syscall_get_nr() function to
get the same information.
Orabug:
21630345
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
};
-/*
- * The stack protector has a tendency to clobber %rax in the prologue.
- */
-__attribute__((__optimize__("no-stack-protector")))
asmlinkage long systrace_syscall(uintptr_t arg0, uintptr_t arg1, uintptr_t arg2,
uintptr_t arg3, uintptr_t arg4, uintptr_t arg5)
{
dtrace_id_t id;
dtrace_syscalls_t *sc;
- asm volatile("movq %%rax,%0" : "=m"(sysnum));
+ sysnum = syscall_get_nr(current, current_pt_regs());
sc = &systrace_info.sysent[sysnum];