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

stacktrace.c File Reference

#include <linux/kernel.h>
#include <asm/system.h>

Include dependency graph for stacktrace.c:

Go to the source code of this file.

Defines

#define MAJOR_OP   0xfc000000
#define LDA_OP   0x20000000
#define STQ_OP   0xb4000000
#define BR_OP   0xc0000000
#define STK_ALLOC_1   0x23de8000
#define STK_ALLOC_1M   0xffff8000
#define STK_ALLOC_2   0x43c0153e
#define STK_ALLOC_2M   0xffe01fff
#define MEM_REG   0x03e00000
#define MEM_BASE   0x001f0000
#define MEM_OFF   0x0000ffff
#define MEM_OFF_SIGN   0x00008000
#define BASE_SP   0x001e0000
#define STK_ALLOC_MATCH(INSTR)
#define STK_PUSH_MATCH(INSTR)   (((INSTR) & (MAJOR_OP | MEM_BASE | MEM_OFF_SIGN)) == (STQ_OP | BASE_SP))
#define MEM_OP_OFFSET(INSTR)   (((long)((INSTR) & MEM_OFF) << 48) >> 48)
#define MEM_OP_REG(INSTR)   (((INSTR) & MEM_REG) >> 22)
#define BB_END(INSTR)
#define IS_KERNEL_TEXT(PC)   ((unsigned long)(PC) > START_ADDR)

Typedefs

typedef unsigned int instr

Functions

static instrdisplay_stored_regs (instr *pro_pc, unsigned char *sp)
static instrseek_prologue (instr *pc)
static long stack_increment (instr *prologue_pc)
void stacktrace (void)

Variables

static char reg_name [][4]


Define Documentation

#define BASE_SP   0x001e0000
 

Definition at line 20 of file stacktrace.c.

#define BB_END INSTR   ) 
 

Value:

(((instr)(INSTR) >= BR_OP) | ((instr)(INSTR) < LDA_OP) |        \
   ((((instr)(INSTR) ^ 0x60000000) < 0x20000000) &              \
    (((instr)(INSTR) & 0x0c000000) != 0)))

Definition at line 33 of file stacktrace.c.

Referenced by display_stored_regs(), and seek_prologue().

#define BR_OP   0xc0000000
 

Definition at line 9 of file stacktrace.c.

#define IS_KERNEL_TEXT PC   )     ((unsigned long)(PC) > START_ADDR)
 

Definition at line 38 of file stacktrace.c.

Referenced by stacktrace().

#define LDA_OP   0x20000000
 

Definition at line 7 of file stacktrace.c.

#define MAJOR_OP   0xfc000000
 

Definition at line 6 of file stacktrace.c.

#define MEM_BASE   0x001f0000
 

Definition at line 17 of file stacktrace.c.

Referenced by __initfunc().

#define MEM_OFF   0x0000ffff
 

Definition at line 18 of file stacktrace.c.

Referenced by display_stored_regs().

#define MEM_OFF_SIGN   0x00008000
 

Definition at line 19 of file stacktrace.c.

#define MEM_OP_OFFSET INSTR   )     (((long)((INSTR) & MEM_OFF) << 48) >> 48)
 

Definition at line 27 of file stacktrace.c.

#define MEM_OP_REG INSTR   )     (((INSTR) & MEM_REG) >> 22)
 

Definition at line 29 of file stacktrace.c.

#define MEM_REG   0x03e00000
 

Definition at line 16 of file stacktrace.c.

Referenced by display_stored_regs().

#define STK_ALLOC_1   0x23de8000
 

Definition at line 11 of file stacktrace.c.

#define STK_ALLOC_1M   0xffff8000
 

Definition at line 12 of file stacktrace.c.

Referenced by stack_increment().

#define STK_ALLOC_2   0x43c0153e
 

Definition at line 13 of file stacktrace.c.

#define STK_ALLOC_2M   0xffe01fff
 

Definition at line 14 of file stacktrace.c.

#define STK_ALLOC_MATCH INSTR   ) 
 

Value:

(((INSTR) & STK_ALLOC_1M) == STK_ALLOC_1        \
   || ((INSTR) & STK_ALLOC_2M) == STK_ALLOC_2)

Definition at line 22 of file stacktrace.c.

Referenced by seek_prologue(), and stack_increment().

#define STK_PUSH_MATCH INSTR   )     (((INSTR) & (MAJOR_OP | MEM_BASE | MEM_OFF_SIGN)) == (STQ_OP | BASE_SP))
 

Definition at line 25 of file stacktrace.c.

Referenced by display_stored_regs().

#define STQ_OP   0xb4000000
 

Definition at line 8 of file stacktrace.c.


Typedef Documentation

r0 ldr Get PC add movs lr return &move spsr_svc into cpsr endm macro rm endm macro temp endm macro temp and instr
 

Definition at line 4 of file stacktrace.c.


Function Documentation

static instr* display_stored_regs instr pro_pc,
unsigned char *  sp
[static]
 

Definition at line 49 of file stacktrace.c.

References BB_END, MEM_OFF, MEM_REG, printk, reg, reg_name, STK_PUSH_MATCH, and value.

Referenced by stacktrace().

static instr* seek_prologue instr pc  )  [static]
 

Definition at line 68 of file stacktrace.c.

References BB_END, and STK_ALLOC_MATCH.

Referenced by stacktrace().

static long stack_increment instr prologue_pc  )  [static]
 

Definition at line 78 of file stacktrace.c.

References long, STK_ALLOC_1M, and STK_ALLOC_MATCH.

Referenced by stacktrace().

void stacktrace void   ) 
 

Definition at line 91 of file stacktrace.c.

References __asm__(), display_stored_regs(), IS_KERNEL_TEXT, printk, prologue, seek_prologue(), sp, and stack_increment().

Here is the call graph for this function:


Variable Documentation

char reg_name[][4] [static]
 

Initial value:

 {
        "v0 ", "t0 ", "t1 ", "t2 ", "t3 ", "t4 ", "t5 ", "t6 ", "t7 ",
        "s0 ", "s1 ", "s2 ", "s3 ", "s4 ", "s5 ", "s6 ", "a0 ", "a1 ",
        "a2 ", "a3 ", "a4 ", "a5 ", "t8 ", "t9 ", "t10", "t11", "ra ",
        "pv ", "at ", "gp ", "sp ", "0"
}

Definition at line 40 of file stacktrace.c.

Referenced by display_stored_regs().