blob: 442f1d025dc2f838096eaa5a77c066933a1db58d [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
Al Viro5077c2a2008-08-18 00:19:01 -040011#include <asm/ptrace-abi.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include "sysdep/ptrace.h"
13
14struct pt_regs {
Jeff Dike77bf4402007-10-16 01:26:58 -070015 struct uml_pt_regs regs;
Linus Torvalds1da177e2005-04-16 15:20:36 -070016};
17
Christoph Hellwig1bd09502010-03-10 15:22:56 -080018#define arch_has_single_step() (1)
19
Al Viro4d338e12006-03-31 02:30:15 -080020#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS }
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
22#define PT_REGS_IP(r) UPT_IP(&(r)->regs)
23#define PT_REGS_SP(r) UPT_SP(&(r)->regs)
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#define PT_REGS_RESTART_SYSCALL(r) UPT_RESTART_SYSCALL(&(r)->regs)
26
27#define PT_REGS_SYSCALL_NR(r) UPT_SYSCALL_NR(&(r)->regs)
28
Linus Torvalds1da177e2005-04-16 15:20:36 -070029#define instruction_pointer(regs) PT_REGS_IP(regs)
30
31struct task_struct;
32
Richard Weinberger8818b672010-11-11 14:05:04 -080033extern long subarch_ptrace(struct task_struct *child, long request,
34 unsigned long addr, unsigned long data);
Linus Torvalds1da177e2005-04-16 15:20:36 -070035extern unsigned long getreg(struct task_struct *child, int regno);
36extern int putreg(struct task_struct *child, int regno, unsigned long value);
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Paolo 'Blaisorblade' Giarrussoaa6758d2006-03-31 02:30:22 -080038extern int arch_copy_tls(struct task_struct *new);
39extern void clear_flushed_tls(struct task_struct *task);
Al Viro1bfa2312012-05-23 00:18:33 -040040extern void syscall_trace_enter(struct pt_regs *regs);
41extern void syscall_trace_leave(struct pt_regs *regs);
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
43#endif
44
Paolo 'Blaisorblade' Giarrussoaa6758d2006-03-31 02:30:22 -080045#endif