Skip to content
Newer
Older
100644 42 lines (38 sloc) 1.7 KB
d51bfc2 @nelhage Add the license to the files in arch/, too.
authored Feb 12, 2011
1 /*
2 * Copyright (C) 2011 by Nelson Elhage
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
1dfdfbc @nelhage Add architecture hooks for saving and restoring the syscall number.
authored Jan 26, 2011
22 static inline void arch_fixup_regs(struct user *user) {
c84bdba @nelhage Refactor architecture-dependent headers slightly.
authored Jan 26, 2011
23 user->regs.reg_ip -= 2;
1dfdfbc @nelhage Add architecture hooks for saving and restoring the syscall number.
authored Jan 26, 2011
24 user->regs.reg_ax = user->regs.orig_ax;
25 }
26
27 static inline int arch_set_syscall(struct ptrace_child *child,
28 unsigned long sysno) {
29 return ptrace_command(child, PTRACE_POKEUSER,
30 offsetof(struct user, regs.orig_ax),
31 sysno);
32 }
33
34 static inline int arch_save_syscall(struct ptrace_child *child) {
35 child->saved_syscall = child->user.regs.orig_ax;
36 return 0;
37 }
38
39 static inline int arch_restore_syscall(struct ptrace_child *child) {
40 return 0;
c84bdba @nelhage Refactor architecture-dependent headers slightly.
authored Jan 26, 2011
41 }
Something went wrong with that request. Please try again.