if (PT_REGS_SYSCALL (regs)) {
/* If so, check system call restarting.. */
switch (regs->gpr[GPR_RVAL]) {
- case -ERESTARTNOHAND:
+ case -ERESTART_RESTARTBLOCK:
+ current_thread_info()->restart_block.fn =
+ do_no_restart_syscall;
+ /* fall through */
+ case -ERESTARTNOHAND:
+ regs->gpr[GPR_RVAL] = -EINTR;
+ break;
+
+ case -ERESTARTSYS:
+ if (!(ka->sa.sa_flags & SA_RESTART)) {
regs->gpr[GPR_RVAL] = -EINTR;
break;
-
- case -ERESTARTSYS:
- if (!(ka->sa.sa_flags & SA_RESTART)) {
- regs->gpr[GPR_RVAL] = -EINTR;
- break;
- }
+ }
/* fallthrough */
- case -ERESTARTNOINTR:
- regs->gpr[12] = PT_REGS_SYSCALL (regs);
- regs->pc -= 4; /* Size of `trap 0' insn. */
+ case -ERESTARTNOINTR:
+ regs->gpr[12] = PT_REGS_SYSCALL (regs);
+ regs->pc -= 4; /* Size of `trap 0' insn. */
}
PT_REGS_SET_SYSCALL (regs, 0);
/* Did we come from a system call? */
if (PT_REGS_SYSCALL (regs)) {
+ int rval = (int)regs->gpr[GPR_RVAL];
/* Restart the system call - no handlers present */
- if (regs->gpr[GPR_RVAL] == (v850_reg_t)-ERESTARTNOHAND ||
- regs->gpr[GPR_RVAL] == (v850_reg_t)-ERESTARTSYS ||
- regs->gpr[GPR_RVAL] == (v850_reg_t)-ERESTARTNOINTR)
+ if (rval == -ERESTARTNOHAND
+ || rval == -ERESTARTSYS
+ || rval == -ERESTARTNOINTR)
{
regs->gpr[12] = PT_REGS_SYSCALL (regs);
regs->pc -= 4; /* Size of `trap 0' insn. */
}
+ else if (rval == -ERESTART_RESTARTBLOCK) {
+ regs->gpr[12] = __NR_restart_syscall;
+ regs->pc -= 4; /* Size of `trap 0' insn. */
+ }
}
return 0;
}
#ifndef __V850_CURRENT_H__
#define __V850_CURRENT_H__
+#ifndef __ASSEMBLY__ /* <linux/thread_info.h> is not asm-safe. */
+#include <linux/thread_info.h>
+#endif
+
#include <asm/macrology.h>
-#include <asm/thread_info.h>
/* Register used to hold the current task pointer while in the kernel.
#define __V850_PROCESSOR_H__
#include <linux/config.h>
+#ifndef __ASSEMBLY__ /* <linux/thread_info.h> is not asm-safe. */
+#include <linux/thread_info.h>
+#endif
#include <asm/ptrace.h>
-#include <asm/thread_info.h>
#include <asm/entry.h>
/* Some code expects `segment' stuff to be defined here. */
unsigned long flags; /* low level flags */
int cpu; /* cpu we're on */
int preempt_count;
+ struct restart_block restart_block;
};
-#define INIT_THREAD_INFO(tsk) \
-{ \
- .task = &tsk, \
- .exec_domain = &default_exec_domain, \
- .flags = 0, \
- .cpu = 0, \
- .preempt_count = 1 \
+#define INIT_THREAD_INFO(tsk) \
+{ \
+ .task = &tsk, \
+ .exec_domain = &default_exec_domain, \
+ .flags = 0, \
+ .cpu = 0, \
+ .preempt_count = 1, \
+ .restart_block = { \
+ .fn = do_no_restart_syscall, \
+ }, \
}
#define init_thread_info (init_thread_union.thread_info)
#define TI_FLAGS 8
#define TI_CPU 12
#define TI_PREEMPT 16
-#define TI_SOFTIRQ 20
-#define TI_HARDIRQ 24
#define PREEMPT_ACTIVE 0x4000000