Commit e52038cb authored by Richard Henderson's avatar Richard Henderson

[ALPHA] Add restart_syscall support.

parent 942abc30
......@@ -587,6 +587,10 @@ syscall_restart(unsigned long r0, unsigned long r19,
regs->r19 = r19;
regs->pc -= 4;
break;
case ERESTART_RESTARTBLOCK:
current_thread_info()->restart_block.fn = do_no_restart_syscall;
regs->r0 = EINTR;
break;
}
}
......@@ -628,13 +632,22 @@ do_signal(sigset_t *oldset, struct pt_regs * regs, struct switch_stack * sw,
return 1;
}
if (r0 &&
(regs->r0 == ERESTARTNOHAND ||
regs->r0 == ERESTARTSYS ||
regs->r0 == ERESTARTNOINTR)) {
regs->r0 = r0; /* reset v0 and a3 and replay syscall */
regs->r19 = r19;
regs->pc -= 4;
if (r0) {
switch (regs->r0) {
case ERESTARTNOHAND:
case ERESTARTSYS:
case ERESTARTNOINTR:
/* Reset v0 and a3 and replay syscall. */
regs->r0 = r0;
regs->r19 = r19;
regs->pc -= 4;
break;
case ERESTART_RESTARTBLOCK:
/* Force v0 to the restart syscall and reply. */
regs->r0 = __NR_restart_syscall;
regs->pc -= 4;
break;
}
}
if (single_stepping)
ptrace_set_bpt(current); /* re-set breakpoint */
......
......@@ -431,6 +431,7 @@ sys_call_table:
.quad sys_epoll_wait
.quad sys_remap_file_pages /* 410 */
.quad sys_set_tid_address
.quad sys_restart_syscall
.size sys_call_table, . - sys_call_table
.type sys_call_table, @object
......
#ifndef _ALPHA_CURRENT_H
#define _ALPHA_CURRENT_H
#include <asm/thread_info.h>
#include <linux/thread_info.h>
#define get_current() (current_thread_info()->task + 0)
#define current get_current()
......
......@@ -25,6 +25,8 @@ struct thread_info {
int bpt_nsaved;
unsigned long bpt_addr[2]; /* breakpoint handling */
unsigned int bpt_insn[2];
struct restart_block restart_block;
};
/*
......@@ -35,6 +37,9 @@ struct thread_info {
task: &tsk, \
exec_domain: &default_exec_domain, \
addr_limit: KERNEL_DS, \
.restart_block = { \
.fn = do_no_restart_syscall, \
}, \
}
#define init_thread_info (init_thread_union.thread_info)
......
......@@ -349,7 +349,8 @@
#define __NR_sys_epoll_wait 409
#define __NR_remap_file_pages 410
#define __NR_set_tid_address 411
#define NR_SYSCALLS 412
#define __NR_restart_syscall 412
#define NR_SYSCALLS 413
#if defined(__GNUC__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment