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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [include/] [asm/] [elf.h] - Blame information for rev 199

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

Line No. Rev Author Line
1 199 simons
#ifndef __ASMOR1K_ELF_H
2
#define __ASMOR1K_ELF_H
3
 
4
/*
5
 * ELF register definitions..
6
 */
7
 
8
#include <asm/ptrace.h>
9
 
10
typedef unsigned long elf_greg_t;
11
 
12
#define ELF_NGREG 33 /* pc/sr/sp/r2-r31 */
13
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
14
 
15
typedef struct user_m68kfp_struct elf_fpregset_t;
16
 
17
/*
18
 * This is used to ensure we don't load something for the wrong architecture.
19
 */
20
#define elf_check_arch(x) ((x) == EM_OR1K)
21
 
22
/* Max number of setion in one elf file */
23
#define ELF_SECTION_NB 20
24
/*
25
 * These are used to set parameters in the core dumps.
26
 */
27
#define ELF_CLASS       ELFCLASS32
28
#define ELF_DATA        ELFDATA2MSB;
29
#define ELF_ARCH        EM_OR1K
30
 
31
        /* For SVR4/m68k the function pointer to be registered with
32
           `atexit' is passed in %a1.  Although my copy of the ABI has
33
           no such statement, it is actually used on ASV.  */
34
#define ELF_PLAT_INIT(_r)
35
 
36
#undef USE_ELF_CORE_DUMP
37
#define ELF_EXEC_PAGESIZE       4096
38
 
39
enum reloc_type
40
{
41
  R_OR32_NONE = 0,
42
  R_OR32_32,
43
  R_OR32_16,
44
  R_OR32_8,
45
  R_OR32_CONST,
46
  R_OR32_CONSTH,
47
  R_OR32_JUMPTARG,
48
  R_OR32_max
49
};
50
 
51
#define ELF_CORE_COPY_REGS(pr_reg, regs)                                \
52
        /* Bleech. */                                                   \
53
        pr_reg[0] = regs->pc;                                            \
54
        pr_reg[1] = regs->sr;                                           \
55
        pr_reg[2] = regs->sp;                                           \
56
        pr_reg[3] = regs->gprs[0];                                       \
57
        pr_reg[4] = regs->gprs[1];                                      \
58
        pr_reg[5] = regs->gprs[2];                                      \
59
        pr_reg[6] = regs->gprs[3];                                      \
60
        pr_reg[7] = regs->gprs[4];                                      \
61
        pr_reg[8] = regs->gprs[5];                                      \
62
        pr_reg[9] = regs->gprs[6];                                      \
63
        pr_reg[10] = regs->gprs[7];                                     \
64
        pr_reg[11] = regs->gprs[8];                                     \
65
        pr_reg[12] = regs->gprs[9];                                     \
66
        pr_reg[13] = regs->gprs[10];                                    \
67
        pr_reg[14] = regs->gprs[11];                                    \
68
        pr_reg[15] = regs->gprs[12];                                    \
69
        pr_reg[16] = regs->gprs[13];                                    \
70
        pr_reg[17] = regs->gprs[14];                                    \
71
        pr_reg[18] = regs->gprs[15];                                    \
72
        pr_reg[19] = regs->gprs[16];                                    \
73
        pr_reg[20] = regs->gprs[17];                                    \
74
        pr_reg[21] = regs->gprs[18];                                    \
75
        pr_reg[22] = regs->gprs[19];                                    \
76
        pr_reg[23] = regs->gprs[20];                                    \
77
        pr_reg[24] = regs->gprs[21];                                    \
78
        pr_reg[25] = regs->gprs[22];                                    \
79
        pr_reg[26] = regs->gprs[23];                                    \
80
        pr_reg[27] = regs->gprs[24];                                    \
81
        pr_reg[28] = regs->gprs[25];                                    \
82
        pr_reg[29] = regs->gprs[26];                                    \
83
        pr_reg[30] = regs->gprs[27];                                    \
84
        pr_reg[31] = regs->gprs[28];                                    \
85
        pr_reg[32] = regs->gprs[29];                                    \
86
        }
87
 
88
#endif

powered by: WebSVN 2.1.0

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