2 * linux/arch/arm/kernel/ptrace.c
5 * edited by Linus Torvalds
6 * ARM modifications Copyright (C) 2000 Russell King
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 #include <linux/kernel.h>
13 #include <linux/sched.h>
15 #include <linux/smp.h>
16 #include <linux/ptrace.h>
17 #include <linux/user.h>
18 #include <linux/security.h>
19 #include <linux/init.h>
20 #include <linux/signal.h>
21 #include <linux/uaccess.h>
22 #include <linux/perf_event.h>
23 #include <linux/hw_breakpoint.h>
24 #include <linux/regset.h>
26 #include <asm/pgtable.h>
27 #include <asm/system.h>
28 #include <asm/traps.h>
33 * does not yet catch signals sent when the child dies.
34 * in exit.c or in signal.c.
39 * Breakpoint SWI instruction: SWI &9F0001
41 #define BREAKINST_ARM 0xef9f0001
42 #define BREAKINST_THUMB 0xdf00 /* fill this in later */
45 * New breakpoints - use an undefined instruction. The ARM architecture
46 * reference manual guarantees that the following instruction space
47 * will produce an undefined instruction exception on all CPUs:
49 * ARM: xxxx 0111 1111 xxxx xxxx xxxx 1111 xxxx
50 * Thumb: 1101 1110 xxxx xxxx
52 #define BREAKINST_ARM 0xe7f001f0
53 #define BREAKINST_THUMB 0xde01
56 struct pt_regs_offset
{
61 #define REG_OFFSET_NAME(r) \
62 {.name = #r, .offset = offsetof(struct pt_regs, ARM_##r)}
63 #define REG_OFFSET_END {.name = NULL, .offset = 0}
65 static const struct pt_regs_offset regoffset_table
[] = {
82 REG_OFFSET_NAME(cpsr
),
83 REG_OFFSET_NAME(ORIG_r0
),
88 * regs_query_register_offset() - query register offset from its name
89 * @name: the name of a register
91 * regs_query_register_offset() returns the offset of a register in struct
92 * pt_regs from its name. If the name is invalid, this returns -EINVAL;
94 int regs_query_register_offset(const char *name
)
96 const struct pt_regs_offset
*roff
;
97 for (roff
= regoffset_table
; roff
->name
!= NULL
; roff
++)
98 if (!strcmp(roff
->name
, name
))
104 * regs_query_register_name() - query register name from its offset
105 * @offset: the offset of a register in struct pt_regs.
107 * regs_query_register_name() returns the name of a register from its
108 * offset in struct pt_regs. If the @offset is invalid, this returns NULL;
110 const char *regs_query_register_name(unsigned int offset
)
112 const struct pt_regs_offset
*roff
;
113 for (roff
= regoffset_table
; roff
->name
!= NULL
; roff
++)
114 if (roff
->offset
== offset
)
120 * regs_within_kernel_stack() - check the address in the stack
121 * @regs: pt_regs which contains kernel stack pointer.
122 * @addr: address which is checked.
124 * regs_within_kernel_stack() checks @addr is within the kernel stack page(s).
125 * If @addr is within the kernel stack, it returns true. If not, returns false.
127 bool regs_within_kernel_stack(struct pt_regs
*regs
, unsigned long addr
)
129 return ((addr
& ~(THREAD_SIZE
- 1)) ==
130 (kernel_stack_pointer(regs
) & ~(THREAD_SIZE
- 1)));
134 * regs_get_kernel_stack_nth() - get Nth entry of the stack
135 * @regs: pt_regs which contains kernel stack pointer.
136 * @n: stack entry number.
138 * regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which
139 * is specified by @regs. If the @n th entry is NOT in the kernel stack,
142 unsigned long regs_get_kernel_stack_nth(struct pt_regs
*regs
, unsigned int n
)
144 unsigned long *addr
= (unsigned long *)kernel_stack_pointer(regs
);
146 if (regs_within_kernel_stack(regs
, (unsigned long)addr
))
153 * this routine will get a word off of the processes privileged stack.
154 * the offset is how far from the base addr as stored in the THREAD.
155 * this routine assumes that all the privileged stacks are in our
158 static inline long get_user_reg(struct task_struct
*task
, int offset
)
160 return task_pt_regs(task
)->uregs
[offset
];
164 * this routine will put a word on the processes privileged stack.
165 * the offset is how far from the base addr as stored in the THREAD.
166 * this routine assumes that all the privileged stacks are in our
170 put_user_reg(struct task_struct
*task
, int offset
, long data
)
172 struct pt_regs newregs
, *regs
= task_pt_regs(task
);
176 newregs
.uregs
[offset
] = data
;
178 if (valid_user_regs(&newregs
)) {
179 regs
->uregs
[offset
] = data
;
187 * Called by kernel/ptrace.c when detaching..
189 void ptrace_disable(struct task_struct
*child
)
195 * Handle hitting a breakpoint.
197 void ptrace_break(struct task_struct
*tsk
, struct pt_regs
*regs
)
201 info
.si_signo
= SIGTRAP
;
203 info
.si_code
= TRAP_BRKPT
;
204 info
.si_addr
= (void __user
*)instruction_pointer(regs
);
206 force_sig_info(SIGTRAP
, &info
, tsk
);
209 static int break_trap(struct pt_regs
*regs
, unsigned int instr
)
211 ptrace_break(current
, regs
);
215 static struct undef_hook arm_break_hook
= {
216 .instr_mask
= 0x0fffffff,
217 .instr_val
= 0x07f001f0,
218 .cpsr_mask
= PSR_T_BIT
,
223 static struct undef_hook thumb_break_hook
= {
224 .instr_mask
= 0xffff,
226 .cpsr_mask
= PSR_T_BIT
,
227 .cpsr_val
= PSR_T_BIT
,
231 static int thumb2_break_trap(struct pt_regs
*regs
, unsigned int instr
)
236 /* Check the second half of the instruction. */
237 pc
= (void __user
*)(instruction_pointer(regs
) + 2);
239 if (processor_mode(regs
) == SVC_MODE
) {
240 instr2
= *(u16
*) pc
;
242 get_user(instr2
, (u16 __user
*)pc
);
245 if (instr2
== 0xa000) {
246 ptrace_break(current
, regs
);
253 static struct undef_hook thumb2_break_hook
= {
254 .instr_mask
= 0xffff,
256 .cpsr_mask
= PSR_T_BIT
,
257 .cpsr_val
= PSR_T_BIT
,
258 .fn
= thumb2_break_trap
,
261 static int __init
ptrace_break_init(void)
263 register_undef_hook(&arm_break_hook
);
264 register_undef_hook(&thumb_break_hook
);
265 register_undef_hook(&thumb2_break_hook
);
269 core_initcall(ptrace_break_init
);
272 * Read the word at offset "off" into the "struct user". We
273 * actually access the pt_regs stored on the kernel stack.
275 static int ptrace_read_user(struct task_struct
*tsk
, unsigned long off
,
276 unsigned long __user
*ret
)
280 if (off
& 3 || off
>= sizeof(struct user
))
284 if (off
== PT_TEXT_ADDR
)
285 tmp
= tsk
->mm
->start_code
;
286 else if (off
== PT_DATA_ADDR
)
287 tmp
= tsk
->mm
->start_data
;
288 else if (off
== PT_TEXT_END_ADDR
)
289 tmp
= tsk
->mm
->end_code
;
290 else if (off
< sizeof(struct pt_regs
))
291 tmp
= get_user_reg(tsk
, off
>> 2);
293 return put_user(tmp
, ret
);
297 * Write the word at offset "off" into "struct user". We
298 * actually access the pt_regs stored on the kernel stack.
300 static int ptrace_write_user(struct task_struct
*tsk
, unsigned long off
,
303 if (off
& 3 || off
>= sizeof(struct user
))
306 if (off
>= sizeof(struct pt_regs
))
309 return put_user_reg(tsk
, off
>> 2, val
);
315 * Get the child iWMMXt state.
317 static int ptrace_getwmmxregs(struct task_struct
*tsk
, void __user
*ufp
)
319 struct thread_info
*thread
= task_thread_info(tsk
);
321 if (!test_ti_thread_flag(thread
, TIF_USING_IWMMXT
))
323 iwmmxt_task_disable(thread
); /* force it to ram */
324 return copy_to_user(ufp
, &thread
->fpstate
.iwmmxt
, IWMMXT_SIZE
)
329 * Set the child iWMMXt state.
331 static int ptrace_setwmmxregs(struct task_struct
*tsk
, void __user
*ufp
)
333 struct thread_info
*thread
= task_thread_info(tsk
);
335 if (!test_ti_thread_flag(thread
, TIF_USING_IWMMXT
))
337 iwmmxt_task_release(thread
); /* force a reload */
338 return copy_from_user(&thread
->fpstate
.iwmmxt
, ufp
, IWMMXT_SIZE
)
346 * Get the child Crunch state.
348 static int ptrace_getcrunchregs(struct task_struct
*tsk
, void __user
*ufp
)
350 struct thread_info
*thread
= task_thread_info(tsk
);
352 crunch_task_disable(thread
); /* force it to ram */
353 return copy_to_user(ufp
, &thread
->crunchstate
, CRUNCH_SIZE
)
358 * Set the child Crunch state.
360 static int ptrace_setcrunchregs(struct task_struct
*tsk
, void __user
*ufp
)
362 struct thread_info
*thread
= task_thread_info(tsk
);
364 crunch_task_release(thread
); /* force a reload */
365 return copy_from_user(&thread
->crunchstate
, ufp
, CRUNCH_SIZE
)
370 #ifdef CONFIG_HAVE_HW_BREAKPOINT
372 * Convert a virtual register number into an index for a thread_info
373 * breakpoint array. Breakpoints are identified using positive numbers
374 * whilst watchpoints are negative. The registers are laid out as pairs
375 * of (address, control), each pair mapping to a unique hw_breakpoint struct.
376 * Register 0 is reserved for describing resource information.
378 static int ptrace_hbp_num_to_idx(long num
)
381 num
= (ARM_MAX_BRP
<< 1) - num
;
382 return (num
- 1) >> 1;
386 * Returns the virtual register number for the address of the
387 * breakpoint at index idx.
389 static long ptrace_hbp_idx_to_num(int idx
)
391 long mid
= ARM_MAX_BRP
<< 1;
392 long num
= (idx
<< 1) + 1;
393 return num
> mid
? mid
- num
: num
;
397 * Handle hitting a HW-breakpoint.
399 static void ptrace_hbptriggered(struct perf_event
*bp
, int unused
,
400 struct perf_sample_data
*data
,
401 struct pt_regs
*regs
)
403 struct arch_hw_breakpoint
*bkpt
= counter_arch_bp(bp
);
408 for (i
= 0; i
< ARM_MAX_HBP_SLOTS
; ++i
)
409 if (current
->thread
.debug
.hbp
[i
] == bp
)
412 num
= (i
== ARM_MAX_HBP_SLOTS
) ? 0 : ptrace_hbp_idx_to_num(i
);
414 info
.si_signo
= SIGTRAP
;
415 info
.si_errno
= (int)num
;
416 info
.si_code
= TRAP_HWBKPT
;
417 info
.si_addr
= (void __user
*)(bkpt
->trigger
);
419 force_sig_info(SIGTRAP
, &info
, current
);
423 * Set ptrace breakpoint pointers to zero for this task.
424 * This is required in order to prevent child processes from unregistering
425 * breakpoints held by their parent.
427 void clear_ptrace_hw_breakpoint(struct task_struct
*tsk
)
429 memset(tsk
->thread
.debug
.hbp
, 0, sizeof(tsk
->thread
.debug
.hbp
));
433 * Unregister breakpoints from this task and reset the pointers in
436 void flush_ptrace_hw_breakpoint(struct task_struct
*tsk
)
439 struct thread_struct
*t
= &tsk
->thread
;
441 for (i
= 0; i
< ARM_MAX_HBP_SLOTS
; i
++) {
442 if (t
->debug
.hbp
[i
]) {
443 unregister_hw_breakpoint(t
->debug
.hbp
[i
]);
444 t
->debug
.hbp
[i
] = NULL
;
449 static u32
ptrace_get_hbp_resource_info(void)
451 u8 num_brps
, num_wrps
, debug_arch
, wp_len
;
454 num_brps
= hw_breakpoint_slots(TYPE_INST
);
455 num_wrps
= hw_breakpoint_slots(TYPE_DATA
);
456 debug_arch
= arch_get_debug_arch();
457 wp_len
= arch_get_max_wp_len();
470 static struct perf_event
*ptrace_hbp_create(struct task_struct
*tsk
, int type
)
472 struct perf_event_attr attr
;
474 ptrace_breakpoint_init(&attr
);
476 /* Initialise fields to sane defaults. */
478 attr
.bp_len
= HW_BREAKPOINT_LEN_4
;
482 return register_user_hw_breakpoint(&attr
, ptrace_hbptriggered
, tsk
);
485 static int ptrace_gethbpregs(struct task_struct
*tsk
, long num
,
486 unsigned long __user
*data
)
490 struct perf_event
*bp
;
491 struct arch_hw_breakpoint_ctrl arch_ctrl
;
494 reg
= ptrace_get_hbp_resource_info();
496 idx
= ptrace_hbp_num_to_idx(num
);
497 if (idx
< 0 || idx
>= ARM_MAX_HBP_SLOTS
) {
502 bp
= tsk
->thread
.debug
.hbp
[idx
];
508 arch_ctrl
= counter_arch_bp(bp
)->ctrl
;
511 * Fix up the len because we may have adjusted it
512 * to compensate for an unaligned address.
514 while (!(arch_ctrl
.len
& 0x1))
518 reg
= bp
->attr
.bp_addr
;
520 reg
= encode_ctrl_reg(arch_ctrl
);
524 if (put_user(reg
, data
))
531 static int ptrace_sethbpregs(struct task_struct
*tsk
, long num
,
532 unsigned long __user
*data
)
534 int idx
, gen_len
, gen_type
, implied_type
, ret
= 0;
536 struct perf_event
*bp
;
537 struct arch_hw_breakpoint_ctrl ctrl
;
538 struct perf_event_attr attr
;
543 implied_type
= HW_BREAKPOINT_RW
;
545 implied_type
= HW_BREAKPOINT_X
;
547 idx
= ptrace_hbp_num_to_idx(num
);
548 if (idx
< 0 || idx
>= ARM_MAX_HBP_SLOTS
) {
553 if (get_user(user_val
, data
)) {
558 bp
= tsk
->thread
.debug
.hbp
[idx
];
560 bp
= ptrace_hbp_create(tsk
, implied_type
);
565 tsk
->thread
.debug
.hbp
[idx
] = bp
;
572 attr
.bp_addr
= user_val
;
575 decode_ctrl_reg(user_val
, &ctrl
);
576 ret
= arch_bp_generic_fields(ctrl
, &gen_len
, &gen_type
);
580 if ((gen_type
& implied_type
) != gen_type
) {
585 attr
.bp_len
= gen_len
;
586 attr
.bp_type
= gen_type
;
587 attr
.disabled
= !ctrl
.enabled
;
590 ret
= modify_user_hw_breakpoint(bp
, &attr
);
596 /* regset get/set implementations */
598 static int gpr_get(struct task_struct
*target
,
599 const struct user_regset
*regset
,
600 unsigned int pos
, unsigned int count
,
601 void *kbuf
, void __user
*ubuf
)
603 struct pt_regs
*regs
= task_pt_regs(target
);
605 return user_regset_copyout(&pos
, &count
, &kbuf
, &ubuf
,
610 static int gpr_set(struct task_struct
*target
,
611 const struct user_regset
*regset
,
612 unsigned int pos
, unsigned int count
,
613 const void *kbuf
, const void __user
*ubuf
)
616 struct pt_regs newregs
;
618 ret
= user_regset_copyin(&pos
, &count
, &kbuf
, &ubuf
,
624 if (!valid_user_regs(&newregs
))
627 *task_pt_regs(target
) = newregs
;
631 static int fpa_get(struct task_struct
*target
,
632 const struct user_regset
*regset
,
633 unsigned int pos
, unsigned int count
,
634 void *kbuf
, void __user
*ubuf
)
636 return user_regset_copyout(&pos
, &count
, &kbuf
, &ubuf
,
637 &task_thread_info(target
)->fpstate
,
638 0, sizeof(struct user_fp
));
641 static int fpa_set(struct task_struct
*target
,
642 const struct user_regset
*regset
,
643 unsigned int pos
, unsigned int count
,
644 const void *kbuf
, const void __user
*ubuf
)
646 struct thread_info
*thread
= task_thread_info(target
);
648 thread
->used_cp
[1] = thread
->used_cp
[2] = 1;
650 return user_regset_copyin(&pos
, &count
, &kbuf
, &ubuf
,
652 0, sizeof(struct user_fp
));
657 * VFP register get/set implementations.
659 * With respect to the kernel, struct user_fp is divided into three chunks:
660 * 16 or 32 real VFP registers (d0-d15 or d0-31)
661 * These are transferred to/from the real registers in the task's
662 * vfp_hard_struct. The number of registers depends on the kernel
665 * 16 or 0 fake VFP registers (d16-d31 or empty)
666 * i.e., the user_vfp structure has space for 32 registers even if
667 * the kernel doesn't have them all.
669 * vfp_get() reads this chunk as zero where applicable
670 * vfp_set() ignores this chunk
672 * 1 word for the FPSCR
674 * The bounds-checking logic built into user_regset_copyout and friends
675 * means that we can make a simple sequence of calls to map the relevant data
676 * to/from the specified slice of the user regset structure.
678 static int vfp_get(struct task_struct
*target
,
679 const struct user_regset
*regset
,
680 unsigned int pos
, unsigned int count
,
681 void *kbuf
, void __user
*ubuf
)
684 struct thread_info
*thread
= task_thread_info(target
);
685 struct vfp_hard_struct
const *vfp
= &thread
->vfpstate
.hard
;
686 const size_t user_fpregs_offset
= offsetof(struct user_vfp
, fpregs
);
687 const size_t user_fpscr_offset
= offsetof(struct user_vfp
, fpscr
);
689 vfp_sync_hwstate(thread
);
691 ret
= user_regset_copyout(&pos
, &count
, &kbuf
, &ubuf
,
694 user_fpregs_offset
+ sizeof(vfp
->fpregs
));
698 ret
= user_regset_copyout_zero(&pos
, &count
, &kbuf
, &ubuf
,
699 user_fpregs_offset
+ sizeof(vfp
->fpregs
),
704 return user_regset_copyout(&pos
, &count
, &kbuf
, &ubuf
,
707 user_fpscr_offset
+ sizeof(vfp
->fpscr
));
711 * For vfp_set() a read-modify-write is done on the VFP registers,
712 * in order to avoid writing back a half-modified set of registers on
715 static int vfp_set(struct task_struct
*target
,
716 const struct user_regset
*regset
,
717 unsigned int pos
, unsigned int count
,
718 const void *kbuf
, const void __user
*ubuf
)
721 struct thread_info
*thread
= task_thread_info(target
);
722 struct vfp_hard_struct new_vfp
= thread
->vfpstate
.hard
;
723 const size_t user_fpregs_offset
= offsetof(struct user_vfp
, fpregs
);
724 const size_t user_fpscr_offset
= offsetof(struct user_vfp
, fpscr
);
726 ret
= user_regset_copyin(&pos
, &count
, &kbuf
, &ubuf
,
729 user_fpregs_offset
+ sizeof(new_vfp
.fpregs
));
733 ret
= user_regset_copyin_ignore(&pos
, &count
, &kbuf
, &ubuf
,
734 user_fpregs_offset
+ sizeof(new_vfp
.fpregs
),
739 ret
= user_regset_copyin(&pos
, &count
, &kbuf
, &ubuf
,
742 user_fpscr_offset
+ sizeof(new_vfp
.fpscr
));
746 vfp_sync_hwstate(thread
);
747 thread
->vfpstate
.hard
= new_vfp
;
748 vfp_flush_hwstate(thread
);
752 #endif /* CONFIG_VFP */
762 static const struct user_regset arm_regsets
[] = {
764 .core_note_type
= NT_PRSTATUS
,
767 .align
= sizeof(u32
),
773 * For the FPA regs in fpstate, the real fields are a mixture
774 * of sizes, so pretend that the registers are word-sized:
776 .core_note_type
= NT_PRFPREG
,
777 .n
= sizeof(struct user_fp
) / sizeof(u32
),
779 .align
= sizeof(u32
),
786 * Pretend that the VFP regs are word-sized, since the FPSCR is
787 * a single word dangling at the end of struct user_vfp:
789 .core_note_type
= NT_ARM_VFP
,
790 .n
= ARM_VFPREGS_SIZE
/ sizeof(u32
),
792 .align
= sizeof(u32
),
796 #endif /* CONFIG_VFP */
799 static const struct user_regset_view user_arm_view
= {
800 .name
= "arm", .e_machine
= ELF_ARCH
, .ei_osabi
= ELF_OSABI
,
801 .regsets
= arm_regsets
, .n
= ARRAY_SIZE(arm_regsets
)
804 const struct user_regset_view
*task_user_regset_view(struct task_struct
*task
)
806 return &user_arm_view
;
809 long arch_ptrace(struct task_struct
*child
, long request
,
810 unsigned long addr
, unsigned long data
)
813 unsigned long __user
*datap
= (unsigned long __user
*) data
;
817 ret
= ptrace_read_user(child
, addr
, datap
);
821 ret
= ptrace_write_user(child
, addr
, data
);
825 ret
= copy_regset_to_user(child
,
826 &user_arm_view
, REGSET_GPR
,
827 0, sizeof(struct pt_regs
),
832 ret
= copy_regset_from_user(child
,
833 &user_arm_view
, REGSET_GPR
,
834 0, sizeof(struct pt_regs
),
838 case PTRACE_GETFPREGS
:
839 ret
= copy_regset_to_user(child
,
840 &user_arm_view
, REGSET_FPR
,
841 0, sizeof(union fp_state
),
845 case PTRACE_SETFPREGS
:
846 ret
= copy_regset_from_user(child
,
847 &user_arm_view
, REGSET_FPR
,
848 0, sizeof(union fp_state
),
853 case PTRACE_GETWMMXREGS
:
854 ret
= ptrace_getwmmxregs(child
, datap
);
857 case PTRACE_SETWMMXREGS
:
858 ret
= ptrace_setwmmxregs(child
, datap
);
862 case PTRACE_GET_THREAD_AREA
:
863 ret
= put_user(task_thread_info(child
)->tp_value
,
867 case PTRACE_SET_SYSCALL
:
868 task_thread_info(child
)->syscall
= data
;
873 case PTRACE_GETCRUNCHREGS
:
874 ret
= ptrace_getcrunchregs(child
, datap
);
877 case PTRACE_SETCRUNCHREGS
:
878 ret
= ptrace_setcrunchregs(child
, datap
);
883 case PTRACE_GETVFPREGS
:
884 ret
= copy_regset_to_user(child
,
885 &user_arm_view
, REGSET_VFP
,
890 case PTRACE_SETVFPREGS
:
891 ret
= copy_regset_from_user(child
,
892 &user_arm_view
, REGSET_VFP
,
898 #ifdef CONFIG_HAVE_HW_BREAKPOINT
899 case PTRACE_GETHBPREGS
:
900 if (ptrace_get_breakpoints(child
) < 0)
903 ret
= ptrace_gethbpregs(child
, addr
,
904 (unsigned long __user
*)data
);
905 ptrace_put_breakpoints(child
);
907 case PTRACE_SETHBPREGS
:
908 if (ptrace_get_breakpoints(child
) < 0)
911 ret
= ptrace_sethbpregs(child
, addr
,
912 (unsigned long __user
*)data
);
913 ptrace_put_breakpoints(child
);
918 ret
= ptrace_request(child
, request
, addr
, data
);
925 asmlinkage
int syscall_trace(int why
, struct pt_regs
*regs
, int scno
)
929 if (!test_thread_flag(TIF_SYSCALL_TRACE
))
931 if (!(current
->ptrace
& PT_PTRACED
))
935 * Save IP. IP is used to denote syscall entry/exit:
936 * IP = 0 -> entry, = 1 -> exit
941 current_thread_info()->syscall
= scno
;
943 /* the 0x80 provides a way for the tracing parent to distinguish
944 between a syscall stop and SIGTRAP delivery */
945 ptrace_notify(SIGTRAP
| ((current
->ptrace
& PT_TRACESYSGOOD
)
948 * this isn't the same as continuing with a signal, but it will do
949 * for normal use. strace only continues with a signal if the
950 * stopping signal is not SIGTRAP. -brl
952 if (current
->exit_code
) {
953 send_sig(current
->exit_code
, current
, 1);
954 current
->exit_code
= 0;
958 return current_thread_info()->syscall
;