diff options
author | Alan Modra <amodra@gmail.com> | 2015-01-28 15:36:43 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2015-01-28 16:25:18 +1030 |
commit | 3f8107ab38095bb3db840f9f14a0fd339f55e06e (patch) | |
tree | 0b19ae4fcd667e7661da8adb99acca4e5a461253 /include | |
parent | cc9ad334a71b0c032f711e86885fb73821f3be16 (diff) | |
download | gdb-3f8107ab38095bb3db840f9f14a0fd339f55e06e.zip gdb-3f8107ab38095bb3db840f9f14a0fd339f55e06e.tar.gz gdb-3f8107ab38095bb3db840f9f14a0fd339f55e06e.tar.bz2 |
FT32 initial support
FT32 is a new 32-bit RISC core developed by FTDI for embedded applications.
* configure.ac: Add FT32 support.
* configure: Regenerate.
bfd/
* Makefile.am: Add FT32 files.
* archures.c (enum bfd_architecture): Add bfd_arch_ft32.
(bfd_mach_ft32): Define.
(bfd_ft32_arch): Declare.
(bfd_archures_list): Add bfd_ft32_arch.
* config.bfd: Handle FT32.
* configure.ac: Likewise.
* cpu-ft32.c: New file.
* elf32-ft32.c: New file.
* reloc.c (BFD_RELOC_FT32_10, BFD_RELOC_FT32_20, BFD_RELOC_FT32_17,
BFD_RELOC_FT32_18): Define.
* targets.c (_bfd_target_vector): Add ft32_elf32_vec.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* po/SRC-POTFILES.in: Regenerate.
binutils/
* readelf.c: Add FT32 support.
gas/
* Makefile.am: Add FT32 files.
* config/tc-ft32.c: New file.
* config/tc-ft32.h: New file.
* configure.tgt: Add FT32 support.
* Makefile.in: Regenerate.
* po/POTFILES.in: Regenerate.
gas/testsuite/
* gas/ft32/ft32.exp: New file.
* gas/ft32/insn.d: New file.
* gas/ft32/insn.s: New file.
include/
* dis-asm.h (print_insn_ft32): Declare.
include/elf/
* common.h (EM_FT32): Define.
* ft32.h: New file.
include/opcode/
* ft32.h: New file.
ld/
* Makefile.am: Add FT32 files.
* configure.tgt: Handle FT32 target.
* emulparams/elf32ft32.sh: New file.
* scripttempl/ft32.sc: New file.
* Makefile.in: Regenerate.
opcodes/
* Makefile.am: Add FT32 files.
* configure.ac: Handle FT32.
* disassemble.c (disassembler): Call print_insn_ft32.
* ft32-dis.c: New file.
* ft32-opc.c: New file.
* Makefile.in: Regenerate.
* configure: Regenerate.
* po/POTFILES.in: Regenerate.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/dis-asm.h | 1 | ||||
-rw-r--r-- | include/elf/ChangeLog | 5 | ||||
-rw-r--r-- | include/elf/common.h | 1 | ||||
-rw-r--r-- | include/elf/ft32.h | 37 | ||||
-rw-r--r-- | include/opcode/ChangeLog | 4 | ||||
-rw-r--r-- | include/opcode/ft32.h | 100 |
7 files changed, 152 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 21b6ae6..16dc84a 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2015-01-28 James Bowman <james.bowman@ftdichip.com> + + * dis-asm.h (print_insn_ft32): Declare. + 2015-01-15 Mark Wielaard <mjw@redhat.com> * dwarf2.def (DW_AT_noreturn): New DWARF5 attribute. diff --git a/include/dis-asm.h b/include/dis-asm.h index f9e9ee5..198a6f8 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -236,6 +236,7 @@ extern int print_insn_dlx (bfd_vma, disassemble_info *); extern int print_insn_epiphany (bfd_vma, disassemble_info *); extern int print_insn_fr30 (bfd_vma, disassemble_info *); extern int print_insn_frv (bfd_vma, disassemble_info *); +extern int print_insn_ft32 (bfd_vma, disassemble_info *); extern int print_insn_h8300 (bfd_vma, disassemble_info *); extern int print_insn_h8300h (bfd_vma, disassemble_info *); extern int print_insn_h8300s (bfd_vma, disassemble_info *); diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 6eb7b8f..99bc4ff 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,8 @@ +2015-01-28 James Bowman <james.bowman@ftdichip.com> + + * common.h (EM_FT32): Define. + * ft32.h: New file. + 2015-01-09 Anthony Green <green@moxielogic.com> * common.h (EM_MOXIE): Redefine to official number. diff --git a/include/elf/common.h b/include/elf/common.h index f584e34..ae7b5f81 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -302,6 +302,7 @@ #define EM_INTEL208 208 /* Reserved by Intel */ #define EM_INTEL209 209 /* Reserved by Intel */ #define EM_VISIUM 221 /* Controls and Data Services VISIUMcore processor */ +#define EM_FT32 222 /* FTDI Chip FT32 high performance 32-bit RISC architecture */ #define EM_MOXIE 223 /* Moxie processor family */ /* If it is necessary to assign new unofficial EM_* values, please pick large diff --git a/include/elf/ft32.h b/include/elf/ft32.h new file mode 100644 index 0000000..2d06a58 --- /dev/null +++ b/include/elf/ft32.h @@ -0,0 +1,37 @@ +/* ft32 ELF support for BFD. + Copyright (C) 2009-2015 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _ELF_FT32_H +#define _ELF_FT32_H + +#include "elf/reloc-macros.h" + +/* Relocation types. */ +START_RELOC_NUMBERS (elf_ft32_reloc_type) + RELOC_NUMBER (R_FT32_NONE, 0) + RELOC_NUMBER (R_FT32_32, 1) + RELOC_NUMBER (R_FT32_16, 2) + RELOC_NUMBER (R_FT32_8, 3) + RELOC_NUMBER (R_FT32_10, 4) + RELOC_NUMBER (R_FT32_20, 5) + RELOC_NUMBER (R_FT32_17, 6) + RELOC_NUMBER (R_FT32_18, 7) +END_RELOC_NUMBERS (R_FT32_max) + +#endif /* _ELF_FT32_H */ diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index f97e56f..52fd462 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,7 @@ +2015-01-28 James Bowman <james.bowman@ftdichip.com> + + * ft32.h: New file. + 2015-01-16 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * s390.h (s390_opcode_cpu_val): Add S390_OPCODE_Z13. diff --git a/include/opcode/ft32.h b/include/opcode/ft32.h new file mode 100644 index 0000000..9617890 --- /dev/null +++ b/include/opcode/ft32.h @@ -0,0 +1,100 @@ +/* Definitions for decoding the ft32 opcode table. + Copyright (C) 2013-2015 Free Software Foundation, Inc. + Contributed by FTDI (support@ftdichip.com) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +02110-1301, USA. */ + +typedef struct ft32_opc_info_t +{ + const char *name; + int dw; + unsigned int mask; + unsigned int bits; + int fields; +} ft32_opc_info_t; + +#define FT32_PAT_ALUOP 0x08 +#define FT32_PAT_LDA 0x18 +#define FT32_PAT_TOCI 0x01 +#define FT32_PAT_CMPOP 0x0b +#define FT32_PAT_STA 0x17 +#define FT32_PAT_EXA 0x07 +#define FT32_PAT_LDK 0x0c +#define FT32_PAT_FFUOP 0x1e +#define FT32_PAT_LDI 0x15 +#define FT32_PAT_STI 0x16 +#define FT32_PAT_EXI 0x1d +#define FT32_PAT_POP 0x11 +#define FT32_PAT_LPM 0x0d +#define FT32_PAT_LINK 0x12 +#define FT32_PAT_TOC 0x00 +#define FT32_PAT_PUSH 0x10 +#define FT32_PAT_RETURN 0x14 +#define FT32_PAT_UNLINK 0x13 +#define FT32_PAT_LPMI 0x19 + +#define FT32_FLD_CBCRCV (1 << 0) +#define FT32_FLD_INT (1 << 1) +#define FT32_FLD_INT_BIT 26 +#define FT32_FLD_INT_SIZ 1 +#define FT32_FLD_DW (1 << 2) +#define FT32_FLD_DW_BIT 25 +#define FT32_FLD_DW_SIZ 2 +#define FT32_FLD_CB (1 << 3) +#define FT32_FLD_CB_BIT 22 +#define FT32_FLD_CB_SIZ 5 +#define FT32_FLD_R_D (1 << 4) +#define FT32_FLD_R_D_BIT 20 +#define FT32_FLD_R_D_SIZ 5 +#define FT32_FLD_CR (1 << 5) +#define FT32_FLD_CR_BIT 20 +#define FT32_FLD_CR_SIZ 2 +#define FT32_FLD_CV (1 << 6) +#define FT32_FLD_CV_BIT 19 +#define FT32_FLD_CV_SIZ 1 +#define FT32_FLD_BT (1 << 7) +#define FT32_FLD_BT_BIT 18 +#define FT32_FLD_BT_SIZ 1 +#define FT32_FLD_R_1 (1 << 8) +#define FT32_FLD_R_1_BIT 15 +#define FT32_FLD_R_1_SIZ 5 +#define FT32_FLD_RIMM (1 << 9) +#define FT32_FLD_RIMM_BIT 4 +#define FT32_FLD_RIMM_SIZ 11 +#define FT32_FLD_R_2 (1 << 10) +#define FT32_FLD_R_2_BIT 4 +#define FT32_FLD_R_2_SIZ 5 +#define FT32_FLD_K20 (1 << 11) +#define FT32_FLD_K20_BIT 0 +#define FT32_FLD_K20_SIZ 20 +#define FT32_FLD_PA (1 << 12) +#define FT32_FLD_PA_BIT 0 +#define FT32_FLD_PA_SIZ 18 +#define FT32_FLD_AA (1 << 13) +#define FT32_FLD_AA_BIT 0 +#define FT32_FLD_AA_SIZ 17 +#define FT32_FLD_K16 (1 << 14) +#define FT32_FLD_K16_BIT 0 +#define FT32_FLD_K16_SIZ 16 +#define FT32_FLD_K8 (1 << 15) +#define FT32_FLD_K8_BIT 0 +#define FT32_FLD_K8_SIZ 8 +#define FT32_FLD_AL (1 << 16) +#define FT32_FLD_AL_BIT 0 +#define FT32_FLD_AL_SIZ 4 + +#define FT32_FLD_R_D_POST (1 << 17) +#define FT32_FLD_R_1_POST (1 << 18) |