xref: /openbsd-src/gnu/usr.bin/binutils/include/elf/ip2k.h (revision d2201f2f89f0be1a0be6f7568000ed297414a06d)
1*d2201f2fSdrahn /* IP2xxx ELF support for BFD.
2*d2201f2fSdrahn    Copyright (C) 2000, 2002 Free Software Foundation, Inc.
3*d2201f2fSdrahn 
4*d2201f2fSdrahn    This file is part of BFD, the Binary File Descriptor library.
5*d2201f2fSdrahn 
6*d2201f2fSdrahn    This program is free software; you can redistribute it and/or modify
7*d2201f2fSdrahn    it under the terms of the GNU General Public License as published by
8*d2201f2fSdrahn    the Free Software Foundation; either version 2 of the License, or
9*d2201f2fSdrahn    (at your option) any later version.
10*d2201f2fSdrahn 
11*d2201f2fSdrahn    This program is distributed in the hope that it will be useful,
12*d2201f2fSdrahn    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*d2201f2fSdrahn    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*d2201f2fSdrahn    GNU General Public License for more details.
15*d2201f2fSdrahn 
16*d2201f2fSdrahn    You should have received a copy of the GNU General Public License
17*d2201f2fSdrahn    along with this program; if not, write to the Free Software Foundation, Inc.,
18*d2201f2fSdrahn    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
19*d2201f2fSdrahn 
20*d2201f2fSdrahn #ifndef _ELF_IP2K_H
21*d2201f2fSdrahn #define _ELF_IP2K_H
22*d2201f2fSdrahn 
23*d2201f2fSdrahn #include "elf/reloc-macros.h"
24*d2201f2fSdrahn 
25*d2201f2fSdrahn /* Relocations.  */
26*d2201f2fSdrahn START_RELOC_NUMBERS (elf_ip2k_reloc_type)
27*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_NONE, 0)
28*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_16, 1)
29*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_32, 2)
30*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_FR9, 3)
31*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_BANK, 4)
32*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_ADDR16CJP, 5)
33*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_PAGE3, 6)
34*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_LO8DATA, 7)
35*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_HI8DATA, 8)
36*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_LO8INSN, 9)
37*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_HI8INSN, 10)
38*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_PC_SKIP, 11)
39*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_TEXT, 12)
40*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_FR_OFFSET, 13)
41*d2201f2fSdrahn   RELOC_NUMBER (R_IP2K_EX8DATA, 14)
42*d2201f2fSdrahn END_RELOC_NUMBERS(R_IP2K_max)
43*d2201f2fSdrahn 
44*d2201f2fSdrahn 
45*d2201f2fSdrahn /* Define the data & instruction memory discriminator.  In a linked
46*d2201f2fSdrahn    executable, an symbol should be deemed to point to an instruction
47*d2201f2fSdrahn    if ((address & IP2K_INSN_MASK) == IP2K_INSN_VALUE), and similarly
48*d2201f2fSdrahn    for the data space.  See also `ld/emulparams/elf32ip2k.sh'.  */
49*d2201f2fSdrahn /* ??? Consider extending the _MASK values to include all the
50*d2201f2fSdrahn    intermediate bits that must be zero due to the limited physical
51*d2201f2fSdrahn    memory size on the IP2K.  */
52*d2201f2fSdrahn 
53*d2201f2fSdrahn #define IP2K_DATA_MASK   0xff000000
54*d2201f2fSdrahn #define IP2K_DATA_VALUE  0x01000000
55*d2201f2fSdrahn #define IP2K_INSN_MASK   0xff000000
56*d2201f2fSdrahn #define IP2K_INSN_VALUE  0x02000000
57*d2201f2fSdrahn 
58*d2201f2fSdrahn /* The location of the memory mapped hardware stack.  */
59*d2201f2fSdrahn #define IP2K_STACK_VALUE 0x0f000000
60*d2201f2fSdrahn #define IP2K_STACK_SIZE  0x20
61*d2201f2fSdrahn 
62*d2201f2fSdrahn #endif /* _ELF_IP2K_H */
63