OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-ppc/] [ptrace.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef _PPC_PTRACE_H
2
#define _PPC_PTRACE_H
3
 
4
 
5
/*
6
 * This struct defines the way the registers are stored on the
7
 * kernel stack during a system call or other kernel entry.
8
 * Note: the "_overhead" and "_underhead" spaces are stack locations
9
 * used by called routines.  Because of the way the PowerPC ABI
10
 * specifies the function prologue/epilogue, registers can be
11
 * saved in stack locations which are below the current stack
12
 * pointer (_underhead).  If an interrupt occurs during this
13
 * [albeit] small time interval, registers which were saved on
14
 * the stack could be trashed by the interrupt save code.  The
15
 * "_underhead" leaves a hole just in case this happens.  It also
16
 * wastes 80 bytes of stack if it doesn't!  Similarly, the called
17
 * routine stores some information "above" the stack pointer before
18
 * if gets adjusted.  This is covered by the "_overhead" field
19
 * and [thankfully] is not totally wasted.
20
 *
21
 */
22
 
23
struct pt_regs {
24
        unsigned long _overhead[14]; /* Callee's SP,LR,params */
25
        unsigned long gpr[32];
26
        unsigned long nip;
27
        unsigned long msr;
28
        unsigned long ctr;
29
        unsigned long link;
30
        unsigned long ccr;
31
        unsigned long xer;
32
        unsigned long dar;      /* Fault registers */
33
        unsigned long dsisr;
34
        unsigned long hash1, hash2;
35
        unsigned long imiss, dmiss;
36
        unsigned long icmp, dcmp;
37
        unsigned long orig_gpr3; /* Used for restarting system calls */
38
        unsigned long result;    /* Result of a system call */
39
        double        fpr[4];    /* Caution! Only FP0-FP3 save on interrupts */
40
        double        fpcsr;
41
        unsigned long trap;     /* Reason for being here */
42
        unsigned long marker;   /* Should have DEADDEAD */
43
        unsigned long _underhead[20]; /* Callee's register save area */
44
        unsigned long edx;      /* for binfmt_elf.c which wants edx */
45
};
46
 
47
#define instruction_pointer(regs) ((regs)->nip)
48
#define user_mode(regs) ((regs)->msr & 0x4000)
49
#ifdef KERNEL
50
extern void show_regs(struct pt_regs *);
51
#endif
52
 
53
/* Offsets used by 'ptrace' system call interface */
54
/* Note: these should correspond to gpr[x]        */
55
#define PT_R0   0
56
#define PT_R1   1
57
#define PT_R2   2
58
#define PT_R3   3
59
#define PT_R4   4
60
#define PT_R5   5
61
#define PT_R6   6
62
#define PT_R7   7
63
#define PT_R8   8
64
#define PT_R9   9
65
#define PT_R10  10
66
#define PT_R11  11
67
#define PT_R12  12
68
#define PT_R13  13
69
#define PT_R14  14
70
#define PT_R15  15
71
#define PT_R16  16
72
#define PT_R17  17
73
#define PT_R18  18
74
#define PT_R19  19
75
#define PT_R20  20
76
#define PT_R21  21
77
#define PT_R22  22
78
#define PT_R23  23
79
#define PT_R24  24
80
#define PT_R25  25
81
#define PT_R26  26
82
#define PT_R27  27
83
#define PT_R28  28
84
#define PT_R29  29
85
#define PT_R30  30
86
#define PT_R31  31
87
 
88
#define PT_NIP  32
89
#define PT_MSR  33
90
#define PT_ORIG_R3 34
91
#define PT_CTR  35
92
#define PT_LNK  36
93
#define PT_XER  37
94
#define PT_CCR  38
95
 
96
#define PT_FPR0 48
97
 
98
#endif
99
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.