| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | 
|  | 3 | * Licensed under the GPL | 
|  | 4 | */ | 
|  | 5 |  | 
|  | 6 | #ifndef __UM_PTRACE_GENERIC_H | 
|  | 7 | #define __UM_PTRACE_GENERIC_H | 
|  | 8 |  | 
|  | 9 | #ifndef __ASSEMBLY__ | 
|  | 10 |  | 
| Jeff Dike | e8df8c3 | 2006-09-25 23:33:10 -0700 | [diff] [blame] | 11 | #include "asm/arch/ptrace-abi.h" | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include "sysdep/ptrace.h" | 
|  | 13 |  | 
|  | 14 | struct pt_regs { | 
|  | 15 | union uml_pt_regs regs; | 
|  | 16 | }; | 
|  | 17 |  | 
| Al Viro | 4d338e1 | 2006-03-31 02:30:15 -0800 | [diff] [blame] | 18 | #define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 |  | 
|  | 20 | #define PT_REGS_IP(r) UPT_IP(&(r)->regs) | 
|  | 21 | #define PT_REGS_SP(r) UPT_SP(&(r)->regs) | 
|  | 22 |  | 
|  | 23 | #define PT_REG(r, reg) UPT_REG(&(r)->regs, reg) | 
|  | 24 | #define PT_REGS_SET(r, reg, val) UPT_SET(&(r)->regs, reg, val) | 
|  | 25 |  | 
|  | 26 | #define PT_REGS_SET_SYSCALL_RETURN(r, res) \ | 
|  | 27 | UPT_SET_SYSCALL_RETURN(&(r)->regs, res) | 
|  | 28 | #define PT_REGS_RESTART_SYSCALL(r) UPT_RESTART_SYSCALL(&(r)->regs) | 
|  | 29 |  | 
|  | 30 | #define PT_REGS_SYSCALL_NR(r) UPT_SYSCALL_NR(&(r)->regs) | 
|  | 31 |  | 
|  | 32 | #define PT_REGS_SC(r) UPT_SC(&(r)->regs) | 
|  | 33 |  | 
|  | 34 | #define instruction_pointer(regs) PT_REGS_IP(regs) | 
|  | 35 |  | 
|  | 36 | struct task_struct; | 
|  | 37 |  | 
|  | 38 | extern unsigned long getreg(struct task_struct *child, int regno); | 
|  | 39 | extern int putreg(struct task_struct *child, int regno, unsigned long value); | 
|  | 40 | extern int get_fpregs(unsigned long buf, struct task_struct *child); | 
|  | 41 | extern int set_fpregs(unsigned long buf, struct task_struct *child); | 
|  | 42 | extern int get_fpxregs(unsigned long buf, struct task_struct *child); | 
|  | 43 | extern int set_fpxregs(unsigned long buf, struct task_struct *tsk); | 
|  | 44 |  | 
|  | 45 | extern void show_regs(struct pt_regs *regs); | 
|  | 46 |  | 
|  | 47 | extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs, | 
|  | 48 | int error_code); | 
|  | 49 |  | 
| Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 50 | extern int arch_copy_tls(struct task_struct *new); | 
|  | 51 | extern void clear_flushed_tls(struct task_struct *task); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 |  | 
|  | 53 | #endif | 
|  | 54 |  | 
| Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 55 | #endif |