aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/ia32/sys_ia32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/ia32/sys_ia32.c')
-rw-r--r--arch/ia64/ia32/sys_ia32.c106
1 files changed, 6 insertions, 100 deletions
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index f4430bb4bbdc..5e92ae00bdbb 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -1098,21 +1098,6 @@ sys32_mremap (unsigned int addr, unsigned int old_len, unsigned int new_len,
1098 return ret; 1098 return ret;
1099} 1099}
1100 1100
1101asmlinkage long
1102sys32_pipe (int __user *fd)
1103{
1104 int retval;
1105 int fds[2];
1106
1107 retval = do_pipe_flags(fds, 0);
1108 if (retval)
1109 goto out;
1110 if (copy_to_user(fd, fds, sizeof(fds)))
1111 retval = -EFAULT;
1112 out:
1113 return retval;
1114}
1115
1116asmlinkage unsigned long 1101asmlinkage unsigned long
1117sys32_alarm (unsigned int seconds) 1102sys32_alarm (unsigned int seconds)
1118{ 1103{
@@ -1209,25 +1194,6 @@ sys32_waitpid (int pid, unsigned int *stat_addr, int options)
1209 return compat_sys_wait4(pid, stat_addr, options, NULL); 1194 return compat_sys_wait4(pid, stat_addr, options, NULL);
1210} 1195}
1211 1196
1212static unsigned int
1213ia32_peek (struct task_struct *child, unsigned long addr, unsigned int *val)
1214{
1215 size_t copied;
1216 unsigned int ret;
1217
1218 copied = access_process_vm(child, addr, val, sizeof(*val), 0);
1219 return (copied != sizeof(ret)) ? -EIO : 0;
1220}
1221
1222static unsigned int
1223ia32_poke (struct task_struct *child, unsigned long addr, unsigned int val)
1224{
1225
1226 if (access_process_vm(child, addr, &val, sizeof(val), 1) != sizeof(val))
1227 return -EIO;
1228 return 0;
1229}
1230
1231/* 1197/*
1232 * The order in which registers are stored in the ptrace regs structure 1198 * The order in which registers are stored in the ptrace regs structure
1233 */ 1199 */
@@ -1525,49 +1491,15 @@ restore_ia32_fpxstate (struct task_struct *tsk, struct ia32_user_fxsr_struct __u
1525 return 0; 1491 return 0;
1526} 1492}
1527 1493
1528asmlinkage long 1494long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
1529sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data) 1495 compat_ulong_t caddr, compat_ulong_t cdata)
1530{ 1496{
1531 struct task_struct *child; 1497 unsigned long addr = caddr;
1532 unsigned int value, tmp; 1498 unsigned long data = cdata;
1499 unsigned int tmp;
1533 long i, ret; 1500 long i, ret;
1534 1501
1535 lock_kernel();
1536 if (request == PTRACE_TRACEME) {
1537 ret = ptrace_traceme();
1538 goto out;
1539 }
1540
1541 child = ptrace_get_task_struct(pid);
1542 if (IS_ERR(child)) {
1543 ret = PTR_ERR(child);
1544 goto out;
1545 }
1546
1547 if (request == PTRACE_ATTACH) {
1548 ret = sys_ptrace(request, pid, addr, data);
1549 goto out_tsk;
1550 }
1551
1552 ret = ptrace_check_attach(child, request == PTRACE_KILL);
1553 if (ret < 0)
1554 goto out_tsk;
1555
1556 switch (request) { 1502 switch (request) {
1557 case PTRACE_PEEKTEXT:
1558 case PTRACE_PEEKDATA: /* read word at location addr */
1559 ret = ia32_peek(child, addr, &value);
1560 if (ret == 0)
1561 ret = put_user(value, (unsigned int __user *) compat_ptr(data));
1562 else
1563 ret = -EIO;
1564 goto out_tsk;
1565
1566 case PTRACE_POKETEXT:
1567 case PTRACE_POKEDATA: /* write the word at location addr */
1568 ret = ia32_poke(child, addr, data);
1569 goto out_tsk;
1570
1571 case PTRACE_PEEKUSR: /* read word at addr in USER area */ 1503 case PTRACE_PEEKUSR: /* read word at addr in USER area */
1572 ret = -EIO; 1504 ret = -EIO;
1573 if ((addr & 3) || addr > 17*sizeof(int)) 1505 if ((addr & 3) || addr > 17*sizeof(int))
@@ -1632,27 +1564,9 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data)
1632 compat_ptr(data)); 1564 compat_ptr(data));
1633 break; 1565 break;
1634 1566
1635 case PTRACE_GETEVENTMSG:
1636 ret = put_user(child->ptrace_message, (unsigned int __user *) compat_ptr(data));
1637 break;
1638
1639 case PTRACE_SYSCALL: /* continue, stop after next syscall */
1640 case PTRACE_CONT: /* restart after signal. */
1641 case PTRACE_KILL:
1642 case PTRACE_SINGLESTEP: /* execute chile for one instruction */
1643 case PTRACE_DETACH: /* detach a process */
1644 ret = sys_ptrace(request, pid, addr, data);
1645 break;
1646
1647 default: 1567 default:
1648 ret = ptrace_request(child, request, addr, data); 1568 return compat_ptrace_request(child, request, caddr, cdata);
1649 break;
1650
1651 } 1569 }
1652 out_tsk:
1653 put_task_struct(child);
1654 out:
1655 unlock_kernel();
1656 return ret; 1570 return ret;
1657} 1571}
1658 1572
@@ -1704,14 +1618,6 @@ out:
1704} 1618}
1705 1619
1706asmlinkage int 1620asmlinkage int
1707sys32_pause (void)
1708{
1709 current->state = TASK_INTERRUPTIBLE;
1710 schedule();
1711 return -ERESTARTNOHAND;
1712}
1713
1714asmlinkage int
1715sys32_msync (unsigned int start, unsigned int len, int flags) 1621sys32_msync (unsigned int start, unsigned int len, int flags)
1716{ 1622{
1717 unsigned int addr; 1623 unsigned int addr;