2 * Port on Texas Instruments TMS320C6x architecture
4 * Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 #ifndef _ASM_C6X_ELF_H
12 #define _ASM_C6X_ELF_H
15 * ELF register definitions..
17 #include <asm/ptrace.h>
19 typedef unsigned long elf_greg_t;
20 typedef unsigned long elf_fpreg_t;
25 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
26 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
29 * This is used to ensure we don't load something for the wrong architecture.
31 #define elf_check_arch(x) ((x)->e_machine == EM_TI_C6000)
33 #define elf_check_const_displacement(x) (1)
36 * These are used to set parameters in the core dumps.
38 #ifdef __LITTLE_ENDIAN__
39 #define ELF_DATA ELFDATA2LSB
41 #define ELF_DATA ELFDATA2MSB
44 #define ELF_CLASS ELFCLASS32
45 #define ELF_ARCH EM_TI_C6000
47 /* Nothing for now. Need to setup DP... */
48 #define ELF_PLAT_INIT(_r)
50 #define USE_ELF_CORE_DUMP
51 #define ELF_EXEC_PAGESIZE 4096
53 #define ELF_CORE_COPY_REGS(_dest, _regs) \
54 memcpy((char *) &_dest, (char *) _regs, \
55 sizeof(struct pt_regs));
57 /* This yields a mask that user programs can use to figure out what
58 instruction set this cpu supports. */
62 /* This yields a string that ld.so will use to load implementation
63 specific libraries for optimization. This is more specific in
64 intent than poking at uname or /proc/cpuinfo. */
66 #define ELF_PLATFORM (NULL)
68 #define SET_PERSONALITY(ex) set_personality(PER_LINUX)
70 /* C6X specific section types */
71 #define SHT_C6000_UNWIND 0x70000001
72 #define SHT_C6000_PREEMPTMAP 0x70000002
73 #define SHT_C6000_ATTRIBUTES 0x70000003
75 /* C6X specific DT_ tags */
76 #define DT_C6000_DSBT_BASE 0x70000000
77 #define DT_C6000_DSBT_SIZE 0x70000001
78 #define DT_C6000_PREEMPTMAP 0x70000002
79 #define DT_C6000_DSBT_INDEX 0x70000003
81 /* C6X specific relocs */
82 #define R_C6000_NONE 0
83 #define R_C6000_ABS32 1
84 #define R_C6000_ABS16 2
85 #define R_C6000_ABS8 3
86 #define R_C6000_PCR_S21 4
87 #define R_C6000_PCR_S12 5
88 #define R_C6000_PCR_S10 6
89 #define R_C6000_PCR_S7 7
90 #define R_C6000_ABS_S16 8
91 #define R_C6000_ABS_L16 9
92 #define R_C6000_ABS_H16 10
93 #define R_C6000_SBR_U15_B 11
94 #define R_C6000_SBR_U15_H 12
95 #define R_C6000_SBR_U15_W 13
96 #define R_C6000_SBR_S16 14
97 #define R_C6000_SBR_L16_B 15
98 #define R_C6000_SBR_L16_H 16
99 #define R_C6000_SBR_L16_W 17
100 #define R_C6000_SBR_H16_B 18
101 #define R_C6000_SBR_H16_H 19
102 #define R_C6000_SBR_H16_W 20
103 #define R_C6000_SBR_GOT_U15_W 21
104 #define R_C6000_SBR_GOT_L16_W 22
105 #define R_C6000_SBR_GOT_H16_W 23
106 #define R_C6000_DSBT_INDEX 24
107 #define R_C6000_PREL31 25
108 #define R_C6000_COPY 26
109 #define R_C6000_ALIGN 253
110 #define R_C6000_FPHEAD 254
111 #define R_C6000_NOCMP 255
113 #endif /*_ASM_C6X_ELF_H */