/* Why isn't this a) automatic, b) written in 'C'? */
.balign 8
_GLOBAL(sys_call_table32)
- .llong .sys_ni_syscall /* 0 - old setup syscall */
+ .llong .sys_restart_syscall /* 0 */
.llong .sys_exit
.llong .sys_fork
.llong .sys_read
.balign 8
_GLOBAL(sys_call_table)
- .llong .sys_ni_syscall /* 0 - old setup syscall */
+ .llong .sys_restart_syscall /* 0 */
.llong .sys_exit
.llong .sys_fork
.llong .sys_read
if (regs->trap == 0x0C00 /* System Call! */
&& ((int)regs->result == -ERESTARTNOHAND ||
+ (int)regs->result == -ERESTART_RESTARTBLOCK ||
((int)regs->result == -ERESTARTSYS &&
- !(ka->sa.sa_flags & SA_RESTART))))
+ !(ka->sa.sa_flags & SA_RESTART)))) {
+ if ((int)regs->result == -ERESTART_RESTARTBLOCK)
+ current_thread_info()->restart_block.fn
+ = do_no_restart_syscall;
regs->result = -EINTR;
+ }
/* Set up Signal Frame */
if (ka->sa.sa_flags & SA_SIGINFO) {
handle_signal(signr, &info, oldset, regs, &newsp, frame);
}
- if (regs->trap == 0x0C00 /* System Call! */ &&
- ((int)regs->result == -ERESTARTNOHAND ||
- (int)regs->result == -ERESTARTSYS ||
- (int)regs->result == -ERESTARTNOINTR)) {
- regs->gpr[3] = regs->orig_gpr3;
- regs->nip -= 4; /* Back up & retry system call */
- regs->result = 0;
+ if (regs->trap == 0x0C00) { /* System Call! */
+ if ((int)regs->result == -ERESTARTNOHAND ||
+ (int)regs->result == -ERESTARTSYS ||
+ (int)regs->result == -ERESTARTNOINTR) {
+ regs->gpr[3] = regs->orig_gpr3;
+ regs->nip -= 4; /* Back up & retry system call */
+ regs->result = 0;
+ } else if ((int)regs->result == -ERESTART_RESTARTBLOCK) {
+ regs->gpr[0] = __NR_restart_syscall;
+ regs->nip -= 4;
+ regs->result = 0;
+ }
}
if (newsp == frame)
if (regs->trap == 0x0C00 /* System Call! */
&& ((int)regs->result == -ERESTARTNOHAND ||
+ (int)regs->result == -ERESTART_RESTARTBLOCK ||
((int)regs->result == -ERESTARTSYS &&
- !(ka->sa.sa_flags & SA_RESTART))))
+ !(ka->sa.sa_flags & SA_RESTART)))) {
+ if ((int)regs->result == -ERESTART_RESTARTBLOCK)
+ current_thread_info()->restart_block.fn
+ = do_no_restart_syscall;
regs->result = -EINTR;
+ }
/*
* Set up the signal frame
handle_signal32(signr, &info, oldset, regs, &newsp, frame);
}
- if (regs->trap == 0x0C00 /* System Call! */ &&
- ((int)regs->result == -ERESTARTNOHAND ||
- (int)regs->result == -ERESTARTSYS ||
- (int)regs->result == -ERESTARTNOINTR)) {
- regs->gpr[3] = regs->orig_gpr3;
- regs->nip -= 4; /* Back up & retry system call */
- regs->result = 0;
+ if (regs->trap == 0x0C00) { /* System Call! */
+ if ((int)regs->result == -ERESTARTNOHAND ||
+ (int)regs->result == -ERESTARTSYS ||
+ (int)regs->result == -ERESTARTNOINTR) {
+ regs->gpr[3] = regs->orig_gpr3;
+ regs->nip -= 4; /* Back up & retry system call */
+ regs->result = 0;
+ } else if ((int)regs->result == -ERESTART_RESTARTBLOCK) {
+ regs->gpr[0] = __NR_restart_syscall;
+ regs->nip -= 4;
+ regs->result = 0;
+ }
}
if (newsp == frame)
#undef EDEADLOCK
#define EDEADLOCK 58 /* File locking deadlock error */
-/* Should never be seen by user programs */
-#define ERESTARTSYS 512
-#define ERESTARTNOINTR 513
-#define ERESTARTNOHAND 514 /* restart if no handler.. */
-#define ENOIOCTLCMD 515 /* No ioctl command */
-
-#define _LAST_ERRNO 515
+#define _LAST_ERRNO 516
#endif
unsigned long flags; /* low level flags */
int cpu; /* cpu we're on */
int preempt_count; /* not used at present */
+ struct restart_block restart_block;
};
/*
.flags = 0, \
.cpu = 0, \
.preempt_count = 1, \
+ .restart_block = { \
+ .fn = do_no_restart_syscall, \
+ }, \
}
#define init_thread_info (init_thread_union.thread_info)
* 2 of the License, or (at your option) any later version.
*/
+#define __NR_restart_syscall 0
#define __NR_exit 1
#define __NR_fork 2
#define __NR_read 3