Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

i386/kernel/ptrace.c File Reference

#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/user.h>
#include <linux/sys.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/processor.h>
#include <asm/debugreg.h>

Include dependency graph for i386/kernel/ptrace.c:

Go to the source code of this file.

Defines

#define FLAG_MASK   0x00044dd5
#define TRAP_FLAG   0x100
#define EFL_OFFSET   ((EFL-2)*4-sizeof(struct pt_regs))

Functions

static int get_stack_long (struct task_struct *task, int offset)
static int put_stack_long (struct task_struct *task, int offset, unsigned long data)
static unsigned long get_long (struct task_struct *tsk, struct vm_area_struct *vma, unsigned long addr)
static void put_long (struct task_struct *tsk, struct vm_area_struct *vma, unsigned long addr, unsigned long data)
static struct vm_area_struct * find_extend_vma (struct task_struct *tsk, unsigned long addr)
static int read_long (struct task_struct *tsk, unsigned long addr, unsigned long *result)
static int write_long (struct task_struct *tsk, unsigned long addr, unsigned long data)
static int putreg (struct task_struct *child, unsigned long regno, unsigned long value)
static unsigned long getreg (struct task_struct *child, unsigned long regno)
asmlinkage int sys_ptrace (long request, long pid, long addr, long data)
asmlinkage void syscall_trace (void)


Define Documentation

#define EFL_OFFSET   ((EFL-2)*4-sizeof(struct pt_regs))
 

Definition at line 37 of file i386/kernel/ptrace.c.

Referenced by putreg(), and sys_ptrace().

#define FLAG_MASK   0x00044dd5
 

Definition at line 29 of file i386/kernel/ptrace.c.

Referenced by putreg().

#define TRAP_FLAG   0x100
 

Definition at line 32 of file i386/kernel/ptrace.c.

Referenced by sys_ptrace().


Function Documentation

static struct vm_area_struct* find_extend_vma struct task_struct *  tsk,
unsigned long  addr
[static]
 

Definition at line 206 of file i386/kernel/ptrace.c.

References find_vma(), NULL, PAGE_MASK, and RLIMIT_STACK.

Here is the call graph for this function:

static unsigned long get_long struct task_struct *  tsk,
struct vm_area_struct *  vma,
unsigned long  addr
[static]
 

Definition at line 77 of file i386/kernel/ptrace.c.

References fault, force_sig(), handle_mm_fault(), MAP_NR, max_mapnr, page, PAGE_MASK, pgd_bad, pgd_clear, pgd_none, pgd_offset, pmd_bad, pmd_clear, pmd_none, pmd_offset, printk, pte_offset, pte_page, pte_present, and SIGKILL.

Here is the call graph for this function:

static int get_stack_long struct task_struct *  task,
int  offset
[inline, static]
 

Definition at line 45 of file i386/kernel/ptrace.c.

References stack.

static unsigned long getreg struct task_struct *  child,
unsigned long  regno
[static]
 

Definition at line 359 of file i386/kernel/ptrace.c.

References CS, DS, ES, FS, get_stack_long(), GS, and SS.

Referenced by sys_ptrace().

Here is the call graph for this function:

static void put_long struct task_struct *  tsk,
struct vm_area_struct *  vma,
unsigned long  addr,
unsigned long  data
[static]
 

Definition at line 141 of file i386/kernel/ptrace.c.

References fault, flush_tlb, force_sig(), handle_mm_fault(), MAP_NR, max_mapnr, mk_pte, page, PAGE_MASK, pgd_bad, pgd_clear, pgd_offset, pgd_present, pmd_bad, pmd_clear, pmd_none, pmd_offset, printk, pte_mkdirty, pte_offset, pte_page, pte_present, pte_write, set_pte, and SIGKILL.

Here is the call graph for this function:

static int put_stack_long struct task_struct *  task,
int  offset,
unsigned long  data
[inline, static]
 

Definition at line 60 of file i386/kernel/ptrace.c.

References stack.

static int putreg struct task_struct *  child,
unsigned long  regno,
unsigned long  value
[static]
 

Definition at line 319 of file i386/kernel/ptrace.c.

References CS, DS, EFL, EFL_OFFSET, EIO, ES, FLAG_MASK, FS, get_stack_long(), GS, NR_syscalls, ORIG_EAX, put_stack_long(), and SS.

Referenced by sys_ptrace().

Here is the call graph for this function:

static int read_long struct task_struct *  tsk,
unsigned long  addr,
unsigned long result
[static]
 

Definition at line 229 of file i386/kernel/ptrace.c.

References EIO, find_extend_vma(), get_long(), high(), PAGE_MASK, and PAGE_SIZE.

Here is the call graph for this function:

asmlinkage int sys_ptrace long  request,
long  pid,
long  addr,
long  data
 

Definition at line 386 of file i386/kernel/ptrace.c.

References __copy_from_user, __copy_to_user, __get_user, __put_user, _NSIG, access_ok, boot_cpu_data, CAP_SYS_PTRACE, capable, current, down(), DR_CONTROL_RESERVED, dummy, EFL_OFFSET, EIO, EPERM, ESRCH, get_stack_long(), getreg(), cpuinfo_x86::hard_math, i, lock_kernel, long, NULL, out, PT_PTRACED, PT_TRACESYS, PTRACE_ATTACH, PTRACE_CONT, PTRACE_DETACH, PTRACE_GETFPREGS, PTRACE_GETREGS, PTRACE_KILL, PTRACE_PEEKDATA, PTRACE_PEEKTEXT, PTRACE_PEEKUSR, PTRACE_POKEDATA, PTRACE_POKETEXT, PTRACE_POKEUSR, PTRACE_SETFPREGS, PTRACE_SETREGS, PTRACE_SINGLESTEP, PTRACE_SYSCALL, PTRACE_TRACEME, put_stack_long(), put_user, putreg(), read_lock, read_long(), read_unlock, restore_i387_soft(), ret, save_i387_soft(), send_sig(), SIGKILL, SIGSTOP, TASK_SIZE, TASK_STOPPED, TASK_ZOMBIE, tasklist_lock, tmp, TRAP_FLAG, user::u_debugreg, unlock_kernel, up, VERIFY_READ, VERIFY_WRITE, wake_up_process(), write_lock_irqsave, write_long(), write_unlock_irqrestore, and xf.

Here is the call graph for this function:

asmlinkage void syscall_trace void   ) 
 

Definition at line 711 of file i386/kernel/ptrace.c.

References current, notify_parent(), PT_PTRACED, PT_TRACESYS, schedule(), send_sig(), SIGCHLD, SIGTRAP, and TASK_STOPPED.

Here is the call graph for this function:

static int write_long struct task_struct *  tsk,
unsigned long  addr,
unsigned long  data
[static]
 

Definition at line 271 of file i386/kernel/ptrace.c.

References EIO, find_extend_vma(), get_long(), high(), PAGE_MASK, PAGE_SIZE, and put_long().

Here is the call graph for this function: