blob: 315749705ea1b91fccf261ba1161eb785cff9701 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Jeff Dikeba180fd2007-10-16 01:27:00 -07002 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * Licensed under the GPL
4 */
5
6#ifndef __UM_PTRACE_GENERIC_H
7#define __UM_PTRACE_GENERIC_H
8
9#ifndef __ASSEMBLY__
10
Jeff Dikee8df8c32006-09-25 23:33:10 -070011#include "asm/arch/ptrace-abi.h"
Jeff Dikee8012b52007-10-16 01:27:16 -070012#include <asm/user.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include "sysdep/ptrace.h"
14
15struct pt_regs {
Jeff Dike77bf4402007-10-16 01:26:58 -070016 struct uml_pt_regs regs;
Linus Torvalds1da177e2005-04-16 15:20:36 -070017};
18
Al Viro4d338e12006-03-31 02:30:15 -080019#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS }
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
21#define PT_REGS_IP(r) UPT_IP(&(r)->regs)
22#define PT_REGS_SP(r) UPT_SP(&(r)->regs)
23
24#define PT_REG(r, reg) UPT_REG(&(r)->regs, reg)
25#define PT_REGS_SET(r, reg, val) UPT_SET(&(r)->regs, reg, val)
26
27#define PT_REGS_SET_SYSCALL_RETURN(r, res) \
28 UPT_SET_SYSCALL_RETURN(&(r)->regs, res)
29#define PT_REGS_RESTART_SYSCALL(r) UPT_RESTART_SYSCALL(&(r)->regs)
30
31#define PT_REGS_SYSCALL_NR(r) UPT_SYSCALL_NR(&(r)->regs)
32
33#define PT_REGS_SC(r) UPT_SC(&(r)->regs)
34
35#define instruction_pointer(regs) PT_REGS_IP(regs)
36
37struct task_struct;
38
Jeff Dikee8012b52007-10-16 01:27:16 -070039extern long subarch_ptrace(struct task_struct *child, long request, long addr,
40 long data);
Linus Torvalds1da177e2005-04-16 15:20:36 -070041extern unsigned long getreg(struct task_struct *child, int regno);
42extern int putreg(struct task_struct *child, int regno, unsigned long value);
Jeff Dikee8012b52007-10-16 01:27:16 -070043extern int get_fpregs(struct user_i387_struct __user *buf,
44 struct task_struct *child);
45extern int set_fpregs(struct user_i387_struct __user *buf,
46 struct task_struct *child);
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
48extern void show_regs(struct pt_regs *regs);
49
Paolo 'Blaisorblade' Giarrussoaa6758d2006-03-31 02:30:22 -080050extern int arch_copy_tls(struct task_struct *new);
51extern void clear_flushed_tls(struct task_struct *task);
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
53#endif
54
Paolo 'Blaisorblade' Giarrussoaa6758d2006-03-31 02:30:22 -080055#endif