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

Go to the source code of this file.

Data Structures

struct  pt_regs
 

Macros

#define user_mode(regs)   (((regs)->ARM_cpsr & 0xf) == 0)
 
#define thumb_mode(regs)   (0)
 
#define isa_mode(regs)
 
#define processor_mode(regs)   ((regs)->ARM_cpsr & MODE_MASK)
 
#define interrupts_enabled(regs)   (!((regs)->ARM_cpsr & PSR_I_BIT))
 
#define fast_interrupts_enabled(regs)   (!((regs)->ARM_cpsr & PSR_F_BIT))
 
#define instruction_pointer(regs)   (regs)->ARM_pc
 
#define profile_pc(regs)   instruction_pointer(regs)
 
#define predicate(x)   ((x) & 0xf0000000)
 
#define PREDICATE_ALWAYS   0xe0000000
 
#define is_wide_instruction(instr)   ((unsigned)(instr) >= 0xe800)
 
#define MAX_REG_OFFSET   (offsetof(struct pt_regs, ARM_ORIG_r0))
 
#define current_pt_regs(void)
 

Functions

int regs_query_register_offset (const char *name)
 
const charregs_query_register_name (unsigned int offset)
 
bool regs_within_kernel_stack (struct pt_regs *regs, unsigned long addr)
 
unsigned long regs_get_kernel_stack_nth (struct pt_regs *regs, unsigned int n)
 

Macro Definition Documentation

#define current_pt_regs (   void)
Value:
({ \
register unsigned long sp asm ("sp"); \
(struct pt_regs *)((sp | (THREAD_SIZE - 1)) - 7) - 1; \
})

Definition at line 137 of file ptrace.h.

#define fast_interrupts_enabled (   regs)    (!((regs)->ARM_cpsr & PSR_F_BIT))

Definition at line 40 of file ptrace.h.

#define instruction_pointer (   regs)    (regs)->ARM_pc

Definition at line 77 of file ptrace.h.

#define interrupts_enabled (   regs)    (!((regs)->ARM_cpsr & PSR_I_BIT))

Definition at line 37 of file ptrace.h.

#define is_wide_instruction (   instr)    ((unsigned)(instr) >= 0xe800)

Definition at line 94 of file ptrace.h.

#define isa_mode (   regs)
Value:
((((regs)->ARM_cpsr & PSR_J_BIT) >> 23) | \
(((regs)->ARM_cpsr & PSR_T_BIT) >> 5))

Definition at line 30 of file ptrace.h.

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

Definition at line 101 of file ptrace.h.

#define predicate (   x)    ((x) & 0xf0000000)

Definition at line 85 of file ptrace.h.

#define PREDICATE_ALWAYS   0xe0000000

Definition at line 86 of file ptrace.h.

#define processor_mode (   regs)    ((regs)->ARM_cpsr & MODE_MASK)

Definition at line 34 of file ptrace.h.

#define profile_pc (   regs)    instruction_pointer(regs)

Definition at line 82 of file ptrace.h.

#define thumb_mode (   regs)    (0)

Definition at line 27 of file ptrace.h.

#define user_mode (   regs)    (((regs)->ARM_cpsr & 0xf) == 0)

Definition at line 20 of file ptrace.h.

Function Documentation

unsigned long regs_get_kernel_stack_nth ( struct pt_regs regs,
unsigned int  n 
)

regs_get_kernel_stack_nth() - get Nth entry of the stack : pt_regs which contains kernel stack pointer.
: stack entry number.

regs_get_kernel_stack_nth() returns
th entry of the kernel stack which is specified by . If the
th entry is NOT in the kernel stack, this returns 0.

regs_get_kernel_stack_nth() - get Nth entry of the stack :pt_regs which contains kernel stack pointer.
:stack entry number.

regs_get_kernel_stack_nth() returns
th entry of the kernel stack which is specifined by . If the
th entry is NOT in the kernel stack, this returns 0.

Definition at line 148 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.

bool regs_within_kernel_stack ( struct pt_regs regs,
unsigned long  addr 
)

regs_within_kernel_stack() - check the address in the stack : pt_regs which contains kernel stack pointer. : address which is checked.

regs_within_kernel_stack() checks is within the kernel stack page(s). If is within the kernel stack, it returns true. If not, returns false.

Definition at line 133 of file ptrace.c.