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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-i960/] [ptrace.h] - Blame information for rev 1633

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef _I960_PTRACE_H
2
#define _I960_PTRACE_H
3
 
4
/* this file describes the stack. While our actual stack frame contains only
5
 * the local registers, a few words before the frame pointer we'll have the
6
 * PC and AC, so we just consider this structure as if it were the actual
7
 * regset. Since interrupts save the g-regs, we might as well make those
8
 * available as well.
9
 */
10
 
11
/* 16 local registers */
12
#define PT_R0   0
13
#define PT_R1   1
14
#define PT_R2   2
15
#define PT_R3   3
16
#define PT_R4   4
17
#define PT_R5   5
18
#define PT_R6   6
19
#define PT_R7   7
20
#define PT_R8   8
21
#define PT_R9   9
22
#define PT_R10  10
23
#define PT_R11  11
24
#define PT_R12  12
25
#define PT_R13  13
26
#define PT_R14  14
27
#define PT_R15  15
28
/* AKAs for local registers */
29
#define PT_PFP  0
30
#define PT_SP   1
31
#define PT_RIP  2
32
 
33
 
34
#ifndef __ASSEMBLY__
35
 
36
/* this struct defines the way the registers are stored on the
37
   stack during system calls and interrupts */
38
 
39
struct pt_regs {
40
        /* FP - 16 */
41
        long    pc;             /* processor control reg */
42
        long    ac;             /* arithmetic control reg */
43
        unsigned char vecs[4];  /* vecs[3] is irq; rest are reserved */
44
        long    reserved;
45
 
46
        /* FP */
47
        long    lregs[16];      /* 16 local regs */
48
        long    gregs[16];      /* 16 global regs */
49
};
50
 
51
 
52
#ifdef __KERNEL__
53
 
54
#if 1
55
#define user_mode(regs) (!test_bit(1, &(regs)->pc) )
56
#else
57
/*
58
 * Two cases: if 1st bit of pfp is set, it was a system call from user mode.
59
 * Otherwise, if the pfp's return field is 7 (i.e., it was an interrupt) we
60
 * can check the image of the PC. When we're in syscalls, we can't trust the
61
 * PC image in regs...
62
 */
63
#define user_mode(regs) \
64
( ((regs)->lregs[PT_PFP] & 0x2) || \
65
(((regs)->lregs[PT_PFP] & 0x7)==0x7 && (!test_bit(1, &(regs)->pc))) )
66
extern void show_regs(struct pt_regs *);
67
#endif  /* 0 */
68
 
69
/* get RIP out of previous frame */
70
#define instruction_pointer(regs)       \
71
( ((unsigned long*)((regs)->lregs[PT_PFP]))[PT_RIP])
72
 
73
#endif /* __KERNEL__ */
74
#endif /* __ASSEMBLY__ */
75
 
76
#endif /* _I960_PTRACE_H */

powered by: WebSVN 2.1.0

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