Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * arch/s390/kernel/ptrace.c |
| 3 | * |
| 4 | * S390 version |
| 5 | * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation |
| 6 | * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), |
| 7 | * Martin Schwidefsky (schwidefsky@de.ibm.com) |
| 8 | * |
| 9 | * Based on PowerPC version |
| 10 | * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) |
| 11 | * |
| 12 | * Derived from "arch/m68k/kernel/ptrace.c" |
| 13 | * Copyright (C) 1994 by Hamish Macdonald |
| 14 | * Taken from linux/kernel/ptrace.c and modified for M680x0. |
| 15 | * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds |
| 16 | * |
| 17 | * Modified by Cort Dougan (cort@cs.nmt.edu) |
| 18 | * |
| 19 | * |
| 20 | * This file is subject to the terms and conditions of the GNU General |
| 21 | * Public License. See the file README.legal in the main directory of |
| 22 | * this archive for more details. |
| 23 | */ |
| 24 | |
| 25 | #include <linux/kernel.h> |
| 26 | #include <linux/sched.h> |
| 27 | #include <linux/mm.h> |
| 28 | #include <linux/smp.h> |
| 29 | #include <linux/smp_lock.h> |
| 30 | #include <linux/errno.h> |
| 31 | #include <linux/ptrace.h> |
| 32 | #include <linux/user.h> |
| 33 | #include <linux/security.h> |
| 34 | #include <linux/audit.h> |
Jesper Juhl | 7ed20e1 | 2005-05-01 08:59:14 -0700 | [diff] [blame] | 35 | #include <linux/signal.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
| 37 | #include <asm/segment.h> |
| 38 | #include <asm/page.h> |
| 39 | #include <asm/pgtable.h> |
| 40 | #include <asm/pgalloc.h> |
| 41 | #include <asm/system.h> |
| 42 | #include <asm/uaccess.h> |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 43 | #include <asm/unistd.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 45 | #ifdef CONFIG_COMPAT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | #include "compat_ptrace.h" |
| 47 | #endif |
| 48 | |
| 49 | static void |
| 50 | FixPerRegisters(struct task_struct *task) |
| 51 | { |
| 52 | struct pt_regs *regs; |
| 53 | per_struct *per_info; |
| 54 | |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 55 | regs = task_pt_regs(task); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | per_info = (per_struct *) &task->thread.per_info; |
| 57 | per_info->control_regs.bits.em_instruction_fetch = |
| 58 | per_info->single_step | per_info->instruction_fetch; |
| 59 | |
| 60 | if (per_info->single_step) { |
| 61 | per_info->control_regs.bits.starting_addr = 0; |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 62 | #ifdef CONFIG_COMPAT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | if (test_thread_flag(TIF_31BIT)) |
| 64 | per_info->control_regs.bits.ending_addr = 0x7fffffffUL; |
| 65 | else |
| 66 | #endif |
| 67 | per_info->control_regs.bits.ending_addr = PSW_ADDR_INSN; |
| 68 | } else { |
| 69 | per_info->control_regs.bits.starting_addr = |
| 70 | per_info->starting_addr; |
| 71 | per_info->control_regs.bits.ending_addr = |
| 72 | per_info->ending_addr; |
| 73 | } |
| 74 | /* |
| 75 | * if any of the control reg tracing bits are on |
| 76 | * we switch on per in the psw |
| 77 | */ |
| 78 | if (per_info->control_regs.words.cr[0] & PER_EM_MASK) |
| 79 | regs->psw.mask |= PSW_MASK_PER; |
| 80 | else |
| 81 | regs->psw.mask &= ~PSW_MASK_PER; |
| 82 | |
| 83 | if (per_info->control_regs.bits.em_storage_alteration) |
| 84 | per_info->control_regs.bits.storage_alt_space_ctl = 1; |
| 85 | else |
| 86 | per_info->control_regs.bits.storage_alt_space_ctl = 0; |
| 87 | } |
| 88 | |
Roland McGrath | 0ac30be | 2008-01-26 14:11:22 +0100 | [diff] [blame^] | 89 | void user_enable_single_step(struct task_struct *task) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | { |
| 91 | task->thread.per_info.single_step = 1; |
| 92 | FixPerRegisters(task); |
| 93 | } |
| 94 | |
Roland McGrath | 0ac30be | 2008-01-26 14:11:22 +0100 | [diff] [blame^] | 95 | void user_disable_single_step(struct task_struct *task) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | { |
| 97 | task->thread.per_info.single_step = 0; |
| 98 | FixPerRegisters(task); |
| 99 | } |
| 100 | |
| 101 | /* |
| 102 | * Called by kernel/ptrace.c when detaching.. |
| 103 | * |
| 104 | * Make sure single step bits etc are not set. |
| 105 | */ |
| 106 | void |
| 107 | ptrace_disable(struct task_struct *child) |
| 108 | { |
| 109 | /* make sure the single step bit is not set. */ |
Roland McGrath | 0ac30be | 2008-01-26 14:11:22 +0100 | [diff] [blame^] | 110 | user_disable_single_step(child); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | } |
| 112 | |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 113 | #ifndef CONFIG_64BIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | # define __ADDR_MASK 3 |
| 115 | #else |
| 116 | # define __ADDR_MASK 7 |
| 117 | #endif |
| 118 | |
| 119 | /* |
| 120 | * Read the word at offset addr from the user area of a process. The |
| 121 | * trouble here is that the information is littered over different |
| 122 | * locations. The process registers are found on the kernel stack, |
| 123 | * the floating point stuff and the trace settings are stored in |
| 124 | * the task structure. In addition the different structures in |
| 125 | * struct user contain pad bytes that should be read as zeroes. |
| 126 | * Lovely... |
| 127 | */ |
| 128 | static int |
| 129 | peek_user(struct task_struct *child, addr_t addr, addr_t data) |
| 130 | { |
| 131 | struct user *dummy = NULL; |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 132 | addr_t offset, tmp, mask; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | |
| 134 | /* |
| 135 | * Stupid gdb peeks/pokes the access registers in 64 bit with |
| 136 | * an alignment of 4. Programmers from hell... |
| 137 | */ |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 138 | mask = __ADDR_MASK; |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 139 | #ifdef CONFIG_64BIT |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 140 | if (addr >= (addr_t) &dummy->regs.acrs && |
| 141 | addr < (addr_t) &dummy->regs.orig_gpr2) |
| 142 | mask = 3; |
| 143 | #endif |
| 144 | if ((addr & mask) || addr > sizeof(struct user) - __ADDR_MASK) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | return -EIO; |
| 146 | |
| 147 | if (addr < (addr_t) &dummy->regs.acrs) { |
| 148 | /* |
| 149 | * psw and gprs are stored on the stack |
| 150 | */ |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 151 | tmp = *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | if (addr == (addr_t) &dummy->regs.psw.mask) |
| 153 | /* Remove per bit from user psw. */ |
| 154 | tmp &= ~PSW_MASK_PER; |
| 155 | |
| 156 | } else if (addr < (addr_t) &dummy->regs.orig_gpr2) { |
| 157 | /* |
| 158 | * access registers are stored in the thread structure |
| 159 | */ |
| 160 | offset = addr - (addr_t) &dummy->regs.acrs; |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 161 | #ifdef CONFIG_64BIT |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 162 | /* |
| 163 | * Very special case: old & broken 64 bit gdb reading |
| 164 | * from acrs[15]. Result is a 64 bit value. Read the |
| 165 | * 32 bit acrs[15] value and shift it by 32. Sick... |
| 166 | */ |
| 167 | if (addr == (addr_t) &dummy->regs.acrs[15]) |
| 168 | tmp = ((unsigned long) child->thread.acrs[15]) << 32; |
| 169 | else |
| 170 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | tmp = *(addr_t *)((addr_t) &child->thread.acrs + offset); |
| 172 | |
| 173 | } else if (addr == (addr_t) &dummy->regs.orig_gpr2) { |
| 174 | /* |
| 175 | * orig_gpr2 is stored on the kernel stack |
| 176 | */ |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 177 | tmp = (addr_t) task_pt_regs(child)->orig_gpr2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | |
| 179 | } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { |
| 180 | /* |
| 181 | * floating point regs. are stored in the thread structure |
| 182 | */ |
| 183 | offset = addr - (addr_t) &dummy->regs.fp_regs; |
| 184 | tmp = *(addr_t *)((addr_t) &child->thread.fp_regs + offset); |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 185 | if (addr == (addr_t) &dummy->regs.fp_regs.fpc) |
| 186 | tmp &= (unsigned long) FPC_VALID_MASK |
| 187 | << (BITS_PER_LONG - 32); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | |
| 189 | } else if (addr < (addr_t) (&dummy->regs.per_info + 1)) { |
| 190 | /* |
| 191 | * per_info is found in the thread structure |
| 192 | */ |
| 193 | offset = addr - (addr_t) &dummy->regs.per_info; |
| 194 | tmp = *(addr_t *)((addr_t) &child->thread.per_info + offset); |
| 195 | |
| 196 | } else |
| 197 | tmp = 0; |
| 198 | |
| 199 | return put_user(tmp, (addr_t __user *) data); |
| 200 | } |
| 201 | |
| 202 | /* |
| 203 | * Write a word to the user area of a process at location addr. This |
| 204 | * operation does have an additional problem compared to peek_user. |
| 205 | * Stores to the program status word and on the floating point |
| 206 | * control register needs to get checked for validity. |
| 207 | */ |
| 208 | static int |
| 209 | poke_user(struct task_struct *child, addr_t addr, addr_t data) |
| 210 | { |
| 211 | struct user *dummy = NULL; |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 212 | addr_t offset, mask; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | |
| 214 | /* |
| 215 | * Stupid gdb peeks/pokes the access registers in 64 bit with |
| 216 | * an alignment of 4. Programmers from hell indeed... |
| 217 | */ |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 218 | mask = __ADDR_MASK; |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 219 | #ifdef CONFIG_64BIT |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 220 | if (addr >= (addr_t) &dummy->regs.acrs && |
| 221 | addr < (addr_t) &dummy->regs.orig_gpr2) |
| 222 | mask = 3; |
| 223 | #endif |
| 224 | if ((addr & mask) || addr > sizeof(struct user) - __ADDR_MASK) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | return -EIO; |
| 226 | |
| 227 | if (addr < (addr_t) &dummy->regs.acrs) { |
| 228 | /* |
| 229 | * psw and gprs are stored on the stack |
| 230 | */ |
| 231 | if (addr == (addr_t) &dummy->regs.psw.mask && |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 232 | #ifdef CONFIG_COMPAT |
Gerald Schaefer | c1821c2 | 2007-02-05 21:18:17 +0100 | [diff] [blame] | 233 | data != PSW_MASK_MERGE(psw_user32_bits, data) && |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | #endif |
Gerald Schaefer | c1821c2 | 2007-02-05 21:18:17 +0100 | [diff] [blame] | 235 | data != PSW_MASK_MERGE(psw_user_bits, data)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | /* Invalid psw mask. */ |
| 237 | return -EINVAL; |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 238 | #ifndef CONFIG_64BIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | if (addr == (addr_t) &dummy->regs.psw.addr) |
| 240 | /* I'd like to reject addresses without the |
| 241 | high order bit but older gdb's rely on it */ |
| 242 | data |= PSW_ADDR_AMODE; |
| 243 | #endif |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 244 | *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | |
| 246 | } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) { |
| 247 | /* |
| 248 | * access registers are stored in the thread structure |
| 249 | */ |
| 250 | offset = addr - (addr_t) &dummy->regs.acrs; |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 251 | #ifdef CONFIG_64BIT |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 252 | /* |
| 253 | * Very special case: old & broken 64 bit gdb writing |
| 254 | * to acrs[15] with a 64 bit value. Ignore the lower |
| 255 | * half of the value and write the upper 32 bit to |
| 256 | * acrs[15]. Sick... |
| 257 | */ |
| 258 | if (addr == (addr_t) &dummy->regs.acrs[15]) |
| 259 | child->thread.acrs[15] = (unsigned int) (data >> 32); |
| 260 | else |
| 261 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | *(addr_t *)((addr_t) &child->thread.acrs + offset) = data; |
| 263 | |
| 264 | } else if (addr == (addr_t) &dummy->regs.orig_gpr2) { |
| 265 | /* |
| 266 | * orig_gpr2 is stored on the kernel stack |
| 267 | */ |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 268 | task_pt_regs(child)->orig_gpr2 = data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | |
| 270 | } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { |
| 271 | /* |
| 272 | * floating point regs. are stored in the thread structure |
| 273 | */ |
| 274 | if (addr == (addr_t) &dummy->regs.fp_regs.fpc && |
Martin Schwidefsky | 778959d | 2005-06-04 15:43:30 -0700 | [diff] [blame] | 275 | (data & ~((unsigned long) FPC_VALID_MASK |
| 276 | << (BITS_PER_LONG - 32))) != 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | return -EINVAL; |
| 278 | offset = addr - (addr_t) &dummy->regs.fp_regs; |
| 279 | *(addr_t *)((addr_t) &child->thread.fp_regs + offset) = data; |
| 280 | |
| 281 | } else if (addr < (addr_t) (&dummy->regs.per_info + 1)) { |
| 282 | /* |
| 283 | * per_info is found in the thread structure |
| 284 | */ |
| 285 | offset = addr - (addr_t) &dummy->regs.per_info; |
| 286 | *(addr_t *)((addr_t) &child->thread.per_info + offset) = data; |
| 287 | |
| 288 | } |
| 289 | |
| 290 | FixPerRegisters(child); |
| 291 | return 0; |
| 292 | } |
| 293 | |
| 294 | static int |
| 295 | do_ptrace_normal(struct task_struct *child, long request, long addr, long data) |
| 296 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 297 | ptrace_area parea; |
| 298 | int copied, ret; |
| 299 | |
| 300 | switch (request) { |
| 301 | case PTRACE_PEEKTEXT: |
| 302 | case PTRACE_PEEKDATA: |
| 303 | /* Remove high order bit from address (only for 31 bit). */ |
| 304 | addr &= PSW_ADDR_INSN; |
| 305 | /* read word at location addr. */ |
Alexey Dobriyan | 7664732 | 2007-07-17 04:03:43 -0700 | [diff] [blame] | 306 | return generic_ptrace_peekdata(child, addr, data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 307 | |
| 308 | case PTRACE_PEEKUSR: |
| 309 | /* read the word at location addr in the USER area. */ |
| 310 | return peek_user(child, addr, data); |
| 311 | |
| 312 | case PTRACE_POKETEXT: |
| 313 | case PTRACE_POKEDATA: |
| 314 | /* Remove high order bit from address (only for 31 bit). */ |
| 315 | addr &= PSW_ADDR_INSN; |
| 316 | /* write the word at location addr. */ |
Alexey Dobriyan | f284ce7 | 2007-07-17 04:03:44 -0700 | [diff] [blame] | 317 | return generic_ptrace_pokedata(child, addr, data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | |
| 319 | case PTRACE_POKEUSR: |
| 320 | /* write the word at location addr in the USER area */ |
| 321 | return poke_user(child, addr, data); |
| 322 | |
| 323 | case PTRACE_PEEKUSR_AREA: |
| 324 | case PTRACE_POKEUSR_AREA: |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 325 | if (copy_from_user(&parea, (void __force __user *) addr, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 326 | sizeof(parea))) |
| 327 | return -EFAULT; |
| 328 | addr = parea.kernel_addr; |
| 329 | data = parea.process_addr; |
| 330 | copied = 0; |
| 331 | while (copied < parea.len) { |
| 332 | if (request == PTRACE_PEEKUSR_AREA) |
| 333 | ret = peek_user(child, addr, data); |
| 334 | else { |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 335 | addr_t utmp; |
| 336 | if (get_user(utmp, |
| 337 | (addr_t __force __user *) data)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 338 | return -EFAULT; |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 339 | ret = poke_user(child, addr, utmp); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | } |
| 341 | if (ret) |
| 342 | return ret; |
| 343 | addr += sizeof(unsigned long); |
| 344 | data += sizeof(unsigned long); |
| 345 | copied += sizeof(unsigned long); |
| 346 | } |
| 347 | return 0; |
| 348 | } |
| 349 | return ptrace_request(child, request, addr, data); |
| 350 | } |
| 351 | |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 352 | #ifdef CONFIG_COMPAT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 353 | /* |
| 354 | * Now the fun part starts... a 31 bit program running in the |
| 355 | * 31 bit emulation tracing another program. PTRACE_PEEKTEXT, |
| 356 | * PTRACE_PEEKDATA, PTRACE_POKETEXT and PTRACE_POKEDATA are easy |
| 357 | * to handle, the difference to the 64 bit versions of the requests |
| 358 | * is that the access is done in multiples of 4 byte instead of |
| 359 | * 8 bytes (sizeof(unsigned long) on 31/64 bit). |
| 360 | * The ugly part are PTRACE_PEEKUSR, PTRACE_PEEKUSR_AREA, |
| 361 | * PTRACE_POKEUSR and PTRACE_POKEUSR_AREA. If the traced program |
| 362 | * is a 31 bit program too, the content of struct user can be |
| 363 | * emulated. A 31 bit program peeking into the struct user of |
| 364 | * a 64 bit program is a no-no. |
| 365 | */ |
| 366 | |
| 367 | /* |
| 368 | * Same as peek_user but for a 31 bit program. |
| 369 | */ |
| 370 | static int |
| 371 | peek_user_emu31(struct task_struct *child, addr_t addr, addr_t data) |
| 372 | { |
| 373 | struct user32 *dummy32 = NULL; |
| 374 | per_struct32 *dummy_per32 = NULL; |
| 375 | addr_t offset; |
| 376 | __u32 tmp; |
| 377 | |
| 378 | if (!test_thread_flag(TIF_31BIT) || |
| 379 | (addr & 3) || addr > sizeof(struct user) - 3) |
| 380 | return -EIO; |
| 381 | |
| 382 | if (addr < (addr_t) &dummy32->regs.acrs) { |
| 383 | /* |
| 384 | * psw and gprs are stored on the stack |
| 385 | */ |
| 386 | if (addr == (addr_t) &dummy32->regs.psw.mask) { |
| 387 | /* Fake a 31 bit psw mask. */ |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 388 | tmp = (__u32)(task_pt_regs(child)->psw.mask >> 32); |
Gerald Schaefer | c1821c2 | 2007-02-05 21:18:17 +0100 | [diff] [blame] | 389 | tmp = PSW32_MASK_MERGE(psw32_user_bits, tmp); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 390 | } else if (addr == (addr_t) &dummy32->regs.psw.addr) { |
| 391 | /* Fake a 31 bit psw address. */ |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 392 | tmp = (__u32) task_pt_regs(child)->psw.addr | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 393 | PSW32_ADDR_AMODE31; |
| 394 | } else { |
| 395 | /* gpr 0-15 */ |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 396 | tmp = *(__u32 *)((addr_t) &task_pt_regs(child)->psw + |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 397 | addr*2 + 4); |
| 398 | } |
| 399 | } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) { |
| 400 | /* |
| 401 | * access registers are stored in the thread structure |
| 402 | */ |
| 403 | offset = addr - (addr_t) &dummy32->regs.acrs; |
| 404 | tmp = *(__u32*)((addr_t) &child->thread.acrs + offset); |
| 405 | |
| 406 | } else if (addr == (addr_t) (&dummy32->regs.orig_gpr2)) { |
| 407 | /* |
| 408 | * orig_gpr2 is stored on the kernel stack |
| 409 | */ |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 410 | tmp = *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 411 | |
| 412 | } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) { |
| 413 | /* |
| 414 | * floating point regs. are stored in the thread structure |
| 415 | */ |
| 416 | offset = addr - (addr_t) &dummy32->regs.fp_regs; |
| 417 | tmp = *(__u32 *)((addr_t) &child->thread.fp_regs + offset); |
| 418 | |
| 419 | } else if (addr < (addr_t) (&dummy32->regs.per_info + 1)) { |
| 420 | /* |
| 421 | * per_info is found in the thread structure |
| 422 | */ |
| 423 | offset = addr - (addr_t) &dummy32->regs.per_info; |
| 424 | /* This is magic. See per_struct and per_struct32. */ |
| 425 | if ((offset >= (addr_t) &dummy_per32->control_regs && |
| 426 | offset < (addr_t) (&dummy_per32->control_regs + 1)) || |
| 427 | (offset >= (addr_t) &dummy_per32->starting_addr && |
| 428 | offset <= (addr_t) &dummy_per32->ending_addr) || |
| 429 | offset == (addr_t) &dummy_per32->lowcore.words.address) |
| 430 | offset = offset*2 + 4; |
| 431 | else |
| 432 | offset = offset*2; |
| 433 | tmp = *(__u32 *)((addr_t) &child->thread.per_info + offset); |
| 434 | |
| 435 | } else |
| 436 | tmp = 0; |
| 437 | |
| 438 | return put_user(tmp, (__u32 __user *) data); |
| 439 | } |
| 440 | |
| 441 | /* |
| 442 | * Same as poke_user but for a 31 bit program. |
| 443 | */ |
| 444 | static int |
| 445 | poke_user_emu31(struct task_struct *child, addr_t addr, addr_t data) |
| 446 | { |
| 447 | struct user32 *dummy32 = NULL; |
| 448 | per_struct32 *dummy_per32 = NULL; |
| 449 | addr_t offset; |
| 450 | __u32 tmp; |
| 451 | |
| 452 | if (!test_thread_flag(TIF_31BIT) || |
| 453 | (addr & 3) || addr > sizeof(struct user32) - 3) |
| 454 | return -EIO; |
| 455 | |
| 456 | tmp = (__u32) data; |
| 457 | |
| 458 | if (addr < (addr_t) &dummy32->regs.acrs) { |
| 459 | /* |
| 460 | * psw, gprs, acrs and orig_gpr2 are stored on the stack |
| 461 | */ |
| 462 | if (addr == (addr_t) &dummy32->regs.psw.mask) { |
| 463 | /* Build a 64 bit psw mask from 31 bit mask. */ |
Gerald Schaefer | c1821c2 | 2007-02-05 21:18:17 +0100 | [diff] [blame] | 464 | if (tmp != PSW32_MASK_MERGE(psw32_user_bits, tmp)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 465 | /* Invalid psw mask. */ |
| 466 | return -EINVAL; |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 467 | task_pt_regs(child)->psw.mask = |
Gerald Schaefer | c1821c2 | 2007-02-05 21:18:17 +0100 | [diff] [blame] | 468 | PSW_MASK_MERGE(psw_user32_bits, (__u64) tmp << 32); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 469 | } else if (addr == (addr_t) &dummy32->regs.psw.addr) { |
| 470 | /* Build a 64 bit psw address from 31 bit address. */ |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 471 | task_pt_regs(child)->psw.addr = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 | (__u64) tmp & PSW32_ADDR_INSN; |
| 473 | } else { |
| 474 | /* gpr 0-15 */ |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 475 | *(__u32*)((addr_t) &task_pt_regs(child)->psw |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 476 | + addr*2 + 4) = tmp; |
| 477 | } |
| 478 | } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) { |
| 479 | /* |
| 480 | * access registers are stored in the thread structure |
| 481 | */ |
| 482 | offset = addr - (addr_t) &dummy32->regs.acrs; |
| 483 | *(__u32*)((addr_t) &child->thread.acrs + offset) = tmp; |
| 484 | |
| 485 | } else if (addr == (addr_t) (&dummy32->regs.orig_gpr2)) { |
| 486 | /* |
| 487 | * orig_gpr2 is stored on the kernel stack |
| 488 | */ |
Al Viro | c7584fb | 2006-01-12 01:05:49 -0800 | [diff] [blame] | 489 | *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4) = tmp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 490 | |
| 491 | } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) { |
| 492 | /* |
| 493 | * floating point regs. are stored in the thread structure |
| 494 | */ |
| 495 | if (addr == (addr_t) &dummy32->regs.fp_regs.fpc && |
| 496 | (tmp & ~FPC_VALID_MASK) != 0) |
| 497 | /* Invalid floating point control. */ |
| 498 | return -EINVAL; |
| 499 | offset = addr - (addr_t) &dummy32->regs.fp_regs; |
| 500 | *(__u32 *)((addr_t) &child->thread.fp_regs + offset) = tmp; |
| 501 | |
| 502 | } else if (addr < (addr_t) (&dummy32->regs.per_info + 1)) { |
| 503 | /* |
| 504 | * per_info is found in the thread structure. |
| 505 | */ |
| 506 | offset = addr - (addr_t) &dummy32->regs.per_info; |
| 507 | /* |
| 508 | * This is magic. See per_struct and per_struct32. |
| 509 | * By incident the offsets in per_struct are exactly |
| 510 | * twice the offsets in per_struct32 for all fields. |
| 511 | * The 8 byte fields need special handling though, |
| 512 | * because the second half (bytes 4-7) is needed and |
| 513 | * not the first half. |
| 514 | */ |
| 515 | if ((offset >= (addr_t) &dummy_per32->control_regs && |
| 516 | offset < (addr_t) (&dummy_per32->control_regs + 1)) || |
| 517 | (offset >= (addr_t) &dummy_per32->starting_addr && |
| 518 | offset <= (addr_t) &dummy_per32->ending_addr) || |
| 519 | offset == (addr_t) &dummy_per32->lowcore.words.address) |
| 520 | offset = offset*2 + 4; |
| 521 | else |
| 522 | offset = offset*2; |
| 523 | *(__u32 *)((addr_t) &child->thread.per_info + offset) = tmp; |
| 524 | |
| 525 | } |
| 526 | |
| 527 | FixPerRegisters(child); |
| 528 | return 0; |
| 529 | } |
| 530 | |
| 531 | static int |
| 532 | do_ptrace_emu31(struct task_struct *child, long request, long addr, long data) |
| 533 | { |
| 534 | unsigned int tmp; /* 4 bytes !! */ |
| 535 | ptrace_area_emu31 parea; |
| 536 | int copied, ret; |
| 537 | |
| 538 | switch (request) { |
| 539 | case PTRACE_PEEKTEXT: |
| 540 | case PTRACE_PEEKDATA: |
| 541 | /* read word at location addr. */ |
| 542 | copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); |
| 543 | if (copied != sizeof(tmp)) |
| 544 | return -EIO; |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 545 | return put_user(tmp, (unsigned int __force __user *) data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 546 | |
| 547 | case PTRACE_PEEKUSR: |
| 548 | /* read the word at location addr in the USER area. */ |
| 549 | return peek_user_emu31(child, addr, data); |
| 550 | |
| 551 | case PTRACE_POKETEXT: |
| 552 | case PTRACE_POKEDATA: |
| 553 | /* write the word at location addr. */ |
| 554 | tmp = data; |
| 555 | copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 1); |
| 556 | if (copied != sizeof(tmp)) |
| 557 | return -EIO; |
| 558 | return 0; |
| 559 | |
| 560 | case PTRACE_POKEUSR: |
| 561 | /* write the word at location addr in the USER area */ |
| 562 | return poke_user_emu31(child, addr, data); |
| 563 | |
| 564 | case PTRACE_PEEKUSR_AREA: |
| 565 | case PTRACE_POKEUSR_AREA: |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 566 | if (copy_from_user(&parea, (void __force __user *) addr, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 567 | sizeof(parea))) |
| 568 | return -EFAULT; |
| 569 | addr = parea.kernel_addr; |
| 570 | data = parea.process_addr; |
| 571 | copied = 0; |
| 572 | while (copied < parea.len) { |
| 573 | if (request == PTRACE_PEEKUSR_AREA) |
| 574 | ret = peek_user_emu31(child, addr, data); |
| 575 | else { |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 576 | __u32 utmp; |
| 577 | if (get_user(utmp, |
| 578 | (__u32 __force __user *) data)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 579 | return -EFAULT; |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 580 | ret = poke_user_emu31(child, addr, utmp); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 581 | } |
| 582 | if (ret) |
| 583 | return ret; |
| 584 | addr += sizeof(unsigned int); |
| 585 | data += sizeof(unsigned int); |
| 586 | copied += sizeof(unsigned int); |
| 587 | } |
| 588 | return 0; |
| 589 | case PTRACE_GETEVENTMSG: |
| 590 | return put_user((__u32) child->ptrace_message, |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 591 | (unsigned int __force __user *) data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 592 | case PTRACE_GETSIGINFO: |
| 593 | if (child->last_siginfo == NULL) |
| 594 | return -EINVAL; |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 595 | return copy_siginfo_to_user32((compat_siginfo_t |
| 596 | __force __user *) data, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 597 | child->last_siginfo); |
| 598 | case PTRACE_SETSIGINFO: |
| 599 | if (child->last_siginfo == NULL) |
| 600 | return -EINVAL; |
| 601 | return copy_siginfo_from_user32(child->last_siginfo, |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 602 | (compat_siginfo_t |
| 603 | __force __user *) data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 604 | } |
| 605 | return ptrace_request(child, request, addr, data); |
| 606 | } |
| 607 | #endif |
| 608 | |
| 609 | #define PT32_IEEE_IP 0x13c |
| 610 | |
| 611 | static int |
| 612 | do_ptrace(struct task_struct *child, long request, long addr, long data) |
| 613 | { |
| 614 | int ret; |
| 615 | |
| 616 | if (request == PTRACE_ATTACH) |
| 617 | return ptrace_attach(child); |
| 618 | |
| 619 | /* |
| 620 | * Special cases to get/store the ieee instructions pointer. |
| 621 | */ |
| 622 | if (child == current) { |
| 623 | if (request == PTRACE_PEEKUSR && addr == PT_IEEE_IP) |
| 624 | return peek_user(child, addr, data); |
| 625 | if (request == PTRACE_POKEUSR && addr == PT_IEEE_IP) |
| 626 | return poke_user(child, addr, data); |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 627 | #ifdef CONFIG_COMPAT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 628 | if (request == PTRACE_PEEKUSR && |
| 629 | addr == PT32_IEEE_IP && test_thread_flag(TIF_31BIT)) |
| 630 | return peek_user_emu31(child, addr, data); |
| 631 | if (request == PTRACE_POKEUSR && |
| 632 | addr == PT32_IEEE_IP && test_thread_flag(TIF_31BIT)) |
| 633 | return poke_user_emu31(child, addr, data); |
| 634 | #endif |
| 635 | } |
| 636 | |
| 637 | ret = ptrace_check_attach(child, request == PTRACE_KILL); |
| 638 | if (ret < 0) |
| 639 | return ret; |
| 640 | |
| 641 | switch (request) { |
| 642 | case PTRACE_SYSCALL: |
| 643 | /* continue and stop at next (return from) syscall */ |
| 644 | case PTRACE_CONT: |
| 645 | /* restart after signal. */ |
Jesper Juhl | 7ed20e1 | 2005-05-01 08:59:14 -0700 | [diff] [blame] | 646 | if (!valid_signal(data)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 647 | return -EIO; |
| 648 | if (request == PTRACE_SYSCALL) |
| 649 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
| 650 | else |
| 651 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
| 652 | child->exit_code = data; |
| 653 | /* make sure the single step bit is not set. */ |
Roland McGrath | 0ac30be | 2008-01-26 14:11:22 +0100 | [diff] [blame^] | 654 | user_disable_single_step(child); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 655 | wake_up_process(child); |
| 656 | return 0; |
| 657 | |
| 658 | case PTRACE_KILL: |
| 659 | /* |
| 660 | * make the child exit. Best I can do is send it a sigkill. |
| 661 | * perhaps it should be put in the status that it wants to |
| 662 | * exit. |
| 663 | */ |
| 664 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ |
| 665 | return 0; |
| 666 | child->exit_code = SIGKILL; |
| 667 | /* make sure the single step bit is not set. */ |
Roland McGrath | 0ac30be | 2008-01-26 14:11:22 +0100 | [diff] [blame^] | 668 | user_disable_single_step(child); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 669 | wake_up_process(child); |
| 670 | return 0; |
| 671 | |
| 672 | case PTRACE_SINGLESTEP: |
| 673 | /* set the trap flag. */ |
Jesper Juhl | 7ed20e1 | 2005-05-01 08:59:14 -0700 | [diff] [blame] | 674 | if (!valid_signal(data)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 675 | return -EIO; |
| 676 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
| 677 | child->exit_code = data; |
Roland McGrath | 0ac30be | 2008-01-26 14:11:22 +0100 | [diff] [blame^] | 678 | user_enable_single_step(child); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 679 | /* give it a chance to run. */ |
| 680 | wake_up_process(child); |
| 681 | return 0; |
| 682 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 683 | /* Do requests that differ for 31/64 bit */ |
| 684 | default: |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 685 | #ifdef CONFIG_COMPAT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 686 | if (test_thread_flag(TIF_31BIT)) |
| 687 | return do_ptrace_emu31(child, request, addr, data); |
| 688 | #endif |
| 689 | return do_ptrace_normal(child, request, addr, data); |
| 690 | } |
| 691 | /* Not reached. */ |
| 692 | return -EIO; |
| 693 | } |
| 694 | |
| 695 | asmlinkage long |
| 696 | sys_ptrace(long request, long pid, long addr, long data) |
| 697 | { |
| 698 | struct task_struct *child; |
| 699 | int ret; |
| 700 | |
| 701 | lock_kernel(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 702 | if (request == PTRACE_TRACEME) { |
Christoph Hellwig | 6b9c7ed8 | 2006-01-08 01:02:33 -0800 | [diff] [blame] | 703 | ret = ptrace_traceme(); |
| 704 | goto out; |
| 705 | } |
| 706 | |
| 707 | child = ptrace_get_task_struct(pid); |
| 708 | if (IS_ERR(child)) { |
| 709 | ret = PTR_ERR(child); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 710 | goto out; |
| 711 | } |
| 712 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 713 | ret = do_ptrace(child, request, addr, data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 714 | put_task_struct(child); |
| 715 | out: |
| 716 | unlock_kernel(); |
| 717 | return ret; |
| 718 | } |
| 719 | |
| 720 | asmlinkage void |
| 721 | syscall_trace(struct pt_regs *regs, int entryexit) |
| 722 | { |
| 2fd6f58 | 2005-04-29 16:08:28 +0100 | [diff] [blame] | 723 | if (unlikely(current->audit_context) && entryexit) |
Al Viro | 5411be5 | 2006-03-29 20:23:36 -0500 | [diff] [blame] | 724 | audit_syscall_exit(AUDITSC_RESULT(regs->gprs[2]), regs->gprs[2]); |
| 2fd6f58 | 2005-04-29 16:08:28 +0100 | [diff] [blame] | 725 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 726 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) |
| 2fd6f58 | 2005-04-29 16:08:28 +0100 | [diff] [blame] | 727 | goto out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 728 | if (!(current->ptrace & PT_PTRACED)) |
| 2fd6f58 | 2005-04-29 16:08:28 +0100 | [diff] [blame] | 729 | goto out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 730 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) |
| 731 | ? 0x80 : 0)); |
| 732 | |
| 733 | /* |
Bodo Stroesser | c5c3a6d | 2005-06-04 15:43:32 -0700 | [diff] [blame] | 734 | * If the debuffer has set an invalid system call number, |
| 735 | * we prepare to skip the system call restart handling. |
| 736 | */ |
| 737 | if (!entryexit && regs->gprs[2] >= NR_syscalls) |
| 738 | regs->trap = -1; |
| 739 | |
| 740 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 741 | * this isn't the same as continuing with a signal, but it will do |
| 742 | * for normal use. strace only continues with a signal if the |
| 743 | * stopping signal is not SIGTRAP. -brl |
| 744 | */ |
| 745 | if (current->exit_code) { |
| 746 | send_sig(current->exit_code, current, 1); |
| 747 | current->exit_code = 0; |
| 748 | } |
| 2fd6f58 | 2005-04-29 16:08:28 +0100 | [diff] [blame] | 749 | out: |
| 750 | if (unlikely(current->audit_context) && !entryexit) |
Al Viro | 5411be5 | 2006-03-29 20:23:36 -0500 | [diff] [blame] | 751 | audit_syscall_entry(test_thread_flag(TIF_31BIT)?AUDIT_ARCH_S390:AUDIT_ARCH_S390X, |
| 2fd6f58 | 2005-04-29 16:08:28 +0100 | [diff] [blame] | 752 | regs->gprs[2], regs->orig_gpr2, regs->gprs[3], |
| 753 | regs->gprs[4], regs->gprs[5]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 754 | } |