Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
kprobes.c File Reference
#include <linux/kprobes.h>
#include <linux/module.h>
#include <linux/ptrace.h>
#include <linux/preempt.h>
#include <linux/kdebug.h>
#include <linux/slab.h>
#include <asm/cacheflush.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Macros

#define OPCODE_JMP(x)   (((x) & 0xF0FF) == 0x402b)
 
#define OPCODE_JSR(x)   (((x) & 0xF0FF) == 0x400b)
 
#define OPCODE_BRA(x)   (((x) & 0xF000) == 0xa000)
 
#define OPCODE_BRAF(x)   (((x) & 0xF0FF) == 0x0023)
 
#define OPCODE_BSR(x)   (((x) & 0xF000) == 0xb000)
 
#define OPCODE_BSRF(x)   (((x) & 0xF0FF) == 0x0003)
 
#define OPCODE_BF_S(x)   (((x) & 0xFF00) == 0x8f00)
 
#define OPCODE_BT_S(x)   (((x) & 0xFF00) == 0x8d00)
 
#define OPCODE_BF(x)   (((x) & 0xFF00) == 0x8b00)
 
#define OPCODE_BT(x)   (((x) & 0xFF00) == 0x8900)
 
#define OPCODE_RTS(x)   (((x) & 0x000F) == 0x000b)
 
#define OPCODE_RTE(x)   (((x) & 0xFFFF) == 0x002b)
 

Functions

 DEFINE_PER_CPU (struct kprobe *, current_kprobe)
 
 DEFINE_PER_CPU (struct kprobe_ctlblk, kprobe_ctlblk)
 
int __kprobes arch_prepare_kprobe (struct kprobe *p)
 
void __kprobes arch_copy_kprobe (struct kprobe *p)
 
void __kprobes arch_arm_kprobe (struct kprobe *p)
 
void __kprobes arch_disarm_kprobe (struct kprobe *p)
 
int __kprobes arch_trampoline_kprobe (struct kprobe *p)
 
int __kprobes kprobe_handle_illslot (unsigned long pc)
 
void __kprobes arch_remove_kprobe (struct kprobe *p)
 
void __kprobes arch_prepare_kretprobe (struct kretprobe_instance *ri, struct pt_regs *regs)
 
int __kprobes trampoline_probe_handler (struct kprobe *p, struct pt_regs *regs)
 
int __kprobes kprobe_fault_handler (struct pt_regs *regs, int trapnr)
 
int __kprobes kprobe_exceptions_notify (struct notifier_block *self, unsigned long val, void *data)
 
int __kprobes setjmp_pre_handler (struct kprobe *p, struct pt_regs *regs)
 
void __kprobes jprobe_return (void)
 
int __kprobes longjmp_break_handler (struct kprobe *p, struct pt_regs *regs)
 
int __init arch_init_kprobes (void)
 

Macro Definition Documentation

#define OPCODE_BF (   x)    (((x) & 0xFF00) == 0x8b00)

Definition at line 37 of file kprobes.c.

#define OPCODE_BF_S (   x)    (((x) & 0xFF00) == 0x8f00)

Definition at line 34 of file kprobes.c.

#define OPCODE_BRA (   x)    (((x) & 0xF000) == 0xa000)

Definition at line 29 of file kprobes.c.

#define OPCODE_BRAF (   x)    (((x) & 0xF0FF) == 0x0023)

Definition at line 30 of file kprobes.c.

#define OPCODE_BSR (   x)    (((x) & 0xF000) == 0xb000)

Definition at line 31 of file kprobes.c.

#define OPCODE_BSRF (   x)    (((x) & 0xF0FF) == 0x0003)

Definition at line 32 of file kprobes.c.

#define OPCODE_BT (   x)    (((x) & 0xFF00) == 0x8900)

Definition at line 38 of file kprobes.c.

#define OPCODE_BT_S (   x)    (((x) & 0xFF00) == 0x8d00)

Definition at line 35 of file kprobes.c.

#define OPCODE_JMP (   x)    (((x) & 0xF0FF) == 0x402b)

Definition at line 27 of file kprobes.c.

#define OPCODE_JSR (   x)    (((x) & 0xF0FF) == 0x400b)

Definition at line 28 of file kprobes.c.

#define OPCODE_RTE (   x)    (((x) & 0xFFFF) == 0x002b)

Definition at line 41 of file kprobes.c.

#define OPCODE_RTS (   x)    (((x) & 0x000F) == 0x000b)

Definition at line 40 of file kprobes.c.

Function Documentation

void __kprobes arch_arm_kprobe ( struct kprobe p)

Definition at line 61 of file kprobes.c.

void __kprobes arch_copy_kprobe ( struct kprobe p)

Definition at line 55 of file kprobes.c.

void __kprobes arch_disarm_kprobe ( struct kprobe p)

Definition at line 68 of file kprobes.c.

int __init arch_init_kprobes ( void  )

Definition at line 582 of file kprobes.c.

int __kprobes arch_prepare_kprobe ( struct kprobe p)

Definition at line 43 of file kprobes.c.

void __kprobes arch_prepare_kretprobe ( struct kretprobe_instance ri,
struct pt_regs regs 
)

Definition at line 206 of file kprobes.c.

void __kprobes arch_remove_kprobe ( struct kprobe p)

Definition at line 103 of file kprobes.c.

int __kprobes arch_trampoline_kprobe ( struct kprobe p)

Definition at line 75 of file kprobes.c.

DEFINE_PER_CPU ( struct kprobe ,
current_kprobe   
)
DEFINE_PER_CPU ( struct kprobe_ctlblk  ,
kprobe_ctlblk   
)
void __kprobes jprobe_return ( void  )

Definition at line 551 of file kprobes.c.

int __kprobes kprobe_exceptions_notify ( struct notifier_block self,
unsigned long  val,
void data 
)

Definition at line 486 of file kprobes.c.

int __kprobes kprobe_fault_handler ( struct pt_regs regs,
int  trapnr 
)

Definition at line 420 of file kprobes.c.

int __kprobes kprobe_handle_illslot ( unsigned long  pc)

If an illegal slot instruction exception occurs for an address containing a kprobe, remove the probe.

Returns 0 if the exception was handled successfully, 1 otherwise.

Definition at line 89 of file kprobes.c.

int __kprobes longjmp_break_handler ( struct kprobe p,
struct pt_regs regs 
)

Definition at line 556 of file kprobes.c.

int __kprobes setjmp_pre_handler ( struct kprobe p,
struct pt_regs regs 
)

Definition at line 526 of file kprobes.c.

int __kprobes trampoline_probe_handler ( struct kprobe p,
struct pt_regs regs 
)

Definition at line 309 of file kprobes.c.