Commit | Line | Data |
---|---|---|
026df7c5 | 1 | /* bfd back-end for TMS320C[34]x support |
2c3fc389 NC |
2 | Copyright 1996, 1997, 2002, 2003, 2005, 2007, 2012 |
3 | Free Software Foundation, Inc. | |
026df7c5 NC |
4 | |
5 | Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) | |
6 | ||
7 | This file is part of BFD, the Binary File Descriptor library. | |
8 | ||
9 | This program is free software; you can redistribute it and/or modify | |
10 | it under the terms of the GNU General Public License as published by | |
cd123cb7 | 11 | the Free Software Foundation; either version 3 of the License, or |
026df7c5 NC |
12 | (at your option) any later version. |
13 | ||
14 | This program is distributed in the hope that it will be useful, | |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU General Public License | |
20 | along with this program; if not, write to the Free Software | |
cd123cb7 NC |
21 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
22 | MA 02110-1301, USA. */ | |
026df7c5 | 23 | |
026df7c5 | 24 | #include "sysdep.h" |
3db64b00 | 25 | #include "bfd.h" |
026df7c5 NC |
26 | #include "libbfd.h" |
27 | ||
b34976b6 | 28 | static bfd_boolean |
2c3fc389 NC |
29 | tic4x_scan (const struct bfd_arch_info *info, |
30 | const char *string) | |
026df7c5 NC |
31 | { |
32 | /* Allow strings of form [ti][Cc][34][0-9], let's not be too picky | |
33 | about strange numbered machines in C3x or C4x series. */ | |
34 | if (string[0] == 't' && string[1] == 'i') | |
35 | string += 2; | |
36 | if (*string == 'C' || *string == 'c') | |
37 | string++; | |
38 | if (string[1] < '0' && string[1] > '9') | |
b34976b6 | 39 | return FALSE; |
026df7c5 NC |
40 | |
41 | if (*string == '3') | |
be33c5dd | 42 | return (info->mach == bfd_mach_tic3x); |
026df7c5 | 43 | else if (*string == '4') |
be33c5dd | 44 | return info->mach == bfd_mach_tic4x; |
026df7c5 | 45 | |
b34976b6 | 46 | return FALSE; |
026df7c5 NC |
47 | } |
48 | ||
49 | ||
50 | const bfd_arch_info_type bfd_tic3x_arch = | |
51 | { | |
52 | 32, /* 32 bits in a word. */ | |
53 | 32, /* 32 bits in an address. */ | |
54 | 32, /* 32 bits in a byte. */ | |
55 | bfd_arch_tic4x, | |
be33c5dd SS |
56 | bfd_mach_tic3x, /* Machine number. */ |
57 | "tic3x", /* Architecture name. */ | |
026df7c5 NC |
58 | "tms320c3x", /* Printable name. */ |
59 | 0, /* Alignment power. */ | |
b34976b6 AM |
60 | FALSE, /* Not the default architecture. */ |
61 | bfd_default_compatible, | |
be33c5dd | 62 | tic4x_scan, |
b7761f11 | 63 | bfd_arch_default_fill, |
026df7c5 NC |
64 | 0 |
65 | }; | |
66 | ||
67 | const bfd_arch_info_type bfd_tic4x_arch = | |
68 | { | |
69 | 32, /* 32 bits in a word. */ | |
70 | 32, /* 32 bits in an address. */ | |
71 | 32, /* 32 bits in a byte. */ | |
72 | bfd_arch_tic4x, | |
be33c5dd SS |
73 | bfd_mach_tic4x, /* Machine number. */ |
74 | "tic4x", /* Architecture name. */ | |
026df7c5 NC |
75 | "tms320c4x", /* Printable name. */ |
76 | 0, /* Alignment power. */ | |
b34976b6 AM |
77 | TRUE, /* The default architecture. */ |
78 | bfd_default_compatible, | |
be33c5dd | 79 | tic4x_scan, |
b7761f11 | 80 | bfd_arch_default_fill, |
026df7c5 NC |
81 | &bfd_tic3x_arch, |
82 | }; | |
83 | ||
84 |