Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ptrace.h File Reference
#include <uapi/asm/ptrace.h>
#include <asm-generic/ptrace.h>
#include <linux/stddef.h>
#include <linux/thread_info.h>

Go to the source code of this file.

Macros

#define STACK_FRAME_OVERHEAD   16 /* size of minimum stack frame */
 
#define STACK_FRAME_LR_SAVE   1 /* Location of LR in stack frame */
 
#define STACK_FRAME_REGS_MARKER   ASM_CONST(0x72656773)
 
#define STACK_INT_FRAME_SIZE   (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
 
#define STACK_FRAME_MARKER   2
 
#define __SIGNAL_FRAMESIZE   64
 
#define GET_IP(regs)   ((regs)->nip)
 
#define GET_USP(regs)   ((regs)->gpr[1])
 
#define GET_FP(regs)   (0)
 
#define SET_FP(regs, val)
 
#define kernel_stack_pointer(regs)   ((regs)->gpr[1])
 
#define user_mode(regs)   (((regs)->msr & MSR_PR) != 0)
 
#define force_successful_syscall_return()
 
#define current_pt_regs()   ((struct pt_regs *)((unsigned long)current_thread_info() + THREAD_SIZE) - 1)
 
#define FULL_REGS(regs)   (((regs)->trap & 1) == 0)
 
#define IS_CRITICAL_EXC(regs)   (((regs)->trap & 2) != 0)
 
#define IS_MCHECK_EXC(regs)   (((regs)->trap & 4) != 0)
 
#define IS_DEBUG_EXC(regs)   (((regs)->trap & 8) != 0)
 
#define TRAP(regs)   ((regs)->trap & ~0xF)
 
#define NV_REG_POISON   0xdeadbeef
 
#define CHECK_FULL_REGS(regs)
 
#define arch_has_single_step()   (1)
 
#define arch_has_block_step()   (!cpu_has_feature(CPU_FTR_601))
 
#define ARCH_HAS_USER_SINGLE_STEP_INFO
 
#define MAX_REG_OFFSET   (offsetof(struct pt_regs, dsisr))
 

Functions

unsigned long ptrace_get_reg (struct task_struct *task, int regno)
 
int ptrace_put_reg (struct task_struct *task, int regno, unsigned long data)
 
int regs_query_register_offset (const char *name)
 
const charregs_query_register_name (unsigned int offset)
 

Macro Definition Documentation

#define __SIGNAL_FRAMESIZE   64

Definition at line 51 of file ptrace.h.

#define arch_has_block_step ( )    (!cpu_has_feature(CPU_FTR_601))

Definition at line 128 of file ptrace.h.

#define arch_has_single_step ( )    (1)

Definition at line 127 of file ptrace.h.

#define ARCH_HAS_USER_SINGLE_STEP_INFO

Definition at line 129 of file ptrace.h.

#define CHECK_FULL_REGS (   regs)
Value:
do { \
if ((regs)->trap & 1) \
printk(KERN_CRIT "%s: partial register set\n", __func__); \
} while (0)

Definition at line 120 of file ptrace.h.

#define current_pt_regs ( )    ((struct pt_regs *)((unsigned long)current_thread_info() + THREAD_SIZE) - 1)

Definition at line 99 of file ptrace.h.

#define force_successful_syscall_return ( )
Value:
do { \
set_thread_flag(TIF_NOERROR); \
} while(0)

Definition at line 89 of file ptrace.h.

#define FULL_REGS (   regs)    (((regs)->trap & 1) == 0)

Definition at line 108 of file ptrace.h.

#define GET_FP (   regs)    (0)

Definition at line 59 of file ptrace.h.

#define GET_IP (   regs)    ((regs)->nip)

Definition at line 57 of file ptrace.h.

#define GET_USP (   regs)    ((regs)->gpr[1])

Definition at line 58 of file ptrace.h.

#define IS_CRITICAL_EXC (   regs)    (((regs)->trap & 2) != 0)

Definition at line 110 of file ptrace.h.

#define IS_DEBUG_EXC (   regs)    (((regs)->trap & 8) != 0)

Definition at line 112 of file ptrace.h.

#define IS_MCHECK_EXC (   regs)    (((regs)->trap & 4) != 0)

Definition at line 111 of file ptrace.h.

#define kernel_stack_pointer (   regs)    ((regs)->gpr[1])

Definition at line 69 of file ptrace.h.

#define MAX_REG_OFFSET   (offsetof(struct pt_regs, dsisr))

Definition at line 139 of file ptrace.h.

#define NV_REG_POISON   0xdeadbeef

Definition at line 119 of file ptrace.h.

#define SET_FP (   regs,
  val 
)

Definition at line 60 of file ptrace.h.

#define STACK_FRAME_LR_SAVE   1 /* Location of LR in stack frame */

Definition at line 45 of file ptrace.h.

#define STACK_FRAME_MARKER   2

Definition at line 48 of file ptrace.h.

#define STACK_FRAME_OVERHEAD   16 /* size of minimum stack frame */

Definition at line 44 of file ptrace.h.

#define STACK_FRAME_REGS_MARKER   ASM_CONST(0x72656773)

Definition at line 46 of file ptrace.h.

#define STACK_INT_FRAME_SIZE   (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)

Definition at line 47 of file ptrace.h.

#define TRAP (   regs)    ((regs)->trap & ~0xF)

Definition at line 114 of file ptrace.h.

#define user_mode (   regs)    (((regs)->msr & MSR_PR) != 0)

Definition at line 86 of file ptrace.h.

Function Documentation

unsigned long ptrace_get_reg ( struct task_struct task,
int  regno 
)

Definition at line 195 of file ptrace.c.

int ptrace_put_reg ( struct task_struct task,
int  regno,
unsigned long  data 
)

Definition at line 212 of file ptrace.c.

const char* regs_query_register_name ( unsigned int  offset)

regs_query_register_name() - query register name from its offset : the offset of a register in struct pt_regs.

regs_query_register_name() returns the name of a register from its offset in struct pt_regs. If the is invalid, this returns NULL;

Definition at line 116 of file ptrace.c.

int regs_query_register_offset ( const char name)

Definition at line 100 of file ptrace.c.