Commit | Line | Data |
---|---|---|
2469cfa2 | 1 | /* BFD library support routines for the MSP architecture. |
b90efa5b | 2 | Copyright (C) 2002-2015 Free Software Foundation, Inc. |
2469cfa2 NC |
3 | Contributed by Dmitry Diky <diwil@mail.ru> |
4 | ||
5 | This file is part of BFD, the Binary File Descriptor library. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
cd123cb7 | 9 | the Free Software Foundation; either version 3 of the License, or |
2469cfa2 NC |
10 | (at your option) any later version. |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program; if not, write to the Free Software | |
cd123cb7 NC |
19 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
20 | MA 02110-1301, USA. */ | |
2469cfa2 | 21 | |
2469cfa2 | 22 | #include "sysdep.h" |
3db64b00 | 23 | #include "bfd.h" |
2469cfa2 NC |
24 | #include "libbfd.h" |
25 | ||
2c3fc389 NC |
26 | /* This routine is provided two arch_infos and works out which MSP |
27 | machine which would be compatible with both and returns a pointer | |
28 | to its info structure. */ | |
29 | ||
30 | static const bfd_arch_info_type * | |
31 | compatible (const bfd_arch_info_type * a, | |
32 | const bfd_arch_info_type * b) | |
33 | { | |
34 | /* If a & b are for different architectures we can do nothing. */ | |
35 | if (a->arch != b->arch) | |
36 | return NULL; | |
37 | ||
38 | if (a->mach <= b->mach) | |
39 | return b; | |
40 | ||
41 | return a; | |
42 | } | |
2469cfa2 NC |
43 | |
44 | #define N(addr_bits, machine, print, default, next) \ | |
45 | { \ | |
46 | 16, /* 16 bits in a word. */ \ | |
47 | addr_bits, /* Bits in an address. */ \ | |
48 | 8, /* 8 bits in a byte. */ \ | |
49 | bfd_arch_msp430, \ | |
50 | machine, /* Machine number. */ \ | |
51 | "msp430", /* Architecture name. */ \ | |
52 | print, /* Printable name. */ \ | |
53 | 1, /* Section align power. */ \ | |
54 | default, /* The default machine. */ \ | |
55 | compatible, \ | |
56 | bfd_default_scan, \ | |
b7761f11 | 57 | bfd_arch_default_fill, \ |
2469cfa2 NC |
58 | next \ |
59 | } | |
60 | ||
61 | static const bfd_arch_info_type arch_info_struct[] = | |
62 | { | |
63 | /* msp430x11x. */ | |
cbb2b07e | 64 | N (16, bfd_mach_msp11, "MSP430", FALSE, & arch_info_struct[1]), |
2469cfa2 | 65 | |
3b260895 | 66 | /* msp430x11x1. */ |
cbb2b07e | 67 | N (16, bfd_mach_msp110, "MSP430x11x1", FALSE, & arch_info_struct[2]), |
3b260895 | 68 | |
2469cfa2 | 69 | /* msp430x12x. */ |
cbb2b07e | 70 | N (16, bfd_mach_msp12, "MSP430x12", FALSE, & arch_info_struct[3]), |
2469cfa2 NC |
71 | |
72 | /* msp430x13x. */ | |
cbb2b07e | 73 | N (16, bfd_mach_msp13, "MSP430x13", FALSE, & arch_info_struct[4]), |
2469cfa2 NC |
74 | |
75 | /* msp430x14x. */ | |
cbb2b07e | 76 | N (16, bfd_mach_msp14, "MSP430x14", FALSE, & arch_info_struct[5]), |
3b260895 NC |
77 | |
78 | /* msp430x15x. */ | |
cbb2b07e | 79 | N (16, bfd_mach_msp15, "MSP430x15", FALSE, & arch_info_struct[6]), |
68ffbac6 | 80 | |
3b260895 | 81 | /* msp430x16x. */ |
cbb2b07e | 82 | N (16, bfd_mach_msp16, "MSP430x16", FALSE, & arch_info_struct[7]), |
2469cfa2 | 83 | |
13761a11 | 84 | /* msp430x20x. */ |
cbb2b07e | 85 | N (16, bfd_mach_msp20, "MSP430x20", FALSE, & arch_info_struct[8]), |
13761a11 | 86 | |
3260c64d | 87 | /* msp430x21x. */ |
cbb2b07e | 88 | N (16, bfd_mach_msp21, "MSP430x21", FALSE, & arch_info_struct[9]), |
13761a11 NC |
89 | |
90 | /* msp430x22x. */ | |
cbb2b07e | 91 | N (16, bfd_mach_msp22, "MSP430x22", FALSE, & arch_info_struct[10]), |
13761a11 NC |
92 | |
93 | /* msp430x23x. */ | |
cbb2b07e | 94 | N (16, bfd_mach_msp23, "MSP430x23", FALSE, & arch_info_struct[11]), |
13761a11 NC |
95 | |
96 | /* msp430x24x. */ | |
cbb2b07e | 97 | N (16, bfd_mach_msp24, "MSP430x24", FALSE, & arch_info_struct[12]), |
13761a11 NC |
98 | |
99 | /* msp430x26x. */ | |
cbb2b07e | 100 | N (16, bfd_mach_msp26, "MSP430x26", FALSE, & arch_info_struct[13]), |
3260c64d | 101 | |
2469cfa2 | 102 | /* msp430x31x. */ |
cbb2b07e | 103 | N (16, bfd_mach_msp31, "MSP430x31", FALSE, & arch_info_struct[14]), |
2469cfa2 NC |
104 | |
105 | /* msp430x32x. */ | |
cbb2b07e | 106 | N (16, bfd_mach_msp32, "MSP430x32", FALSE, & arch_info_struct[15]), |
2469cfa2 NC |
107 | |
108 | /* msp430x33x. */ | |
cbb2b07e | 109 | N (16, bfd_mach_msp33, "MSP430x33", FALSE, & arch_info_struct[16]), |
68ffbac6 | 110 | |
2469cfa2 | 111 | /* msp430x41x. */ |
cbb2b07e | 112 | N (16, bfd_mach_msp41, "MSP430x41", FALSE, & arch_info_struct[17]), |
3b260895 NC |
113 | |
114 | /* msp430x42x. */ | |
cbb2b07e | 115 | N (16, bfd_mach_msp42, "MSP430x42", FALSE, & arch_info_struct[18]), |
2469cfa2 NC |
116 | |
117 | /* msp430x43x. */ | |
cbb2b07e | 118 | N (16, bfd_mach_msp43, "MSP430x43", FALSE, & arch_info_struct[19]), |
2469cfa2 NC |
119 | |
120 | /* msp430x44x. */ | |
cbb2b07e | 121 | N (16, bfd_mach_msp43, "MSP430x44", FALSE, & arch_info_struct[20]), |
13761a11 NC |
122 | |
123 | /* msp430x46x. */ | |
cbb2b07e | 124 | N (16, bfd_mach_msp46, "MSP430x46", FALSE, & arch_info_struct[21]), |
13761a11 NC |
125 | |
126 | /* msp430x47x. */ | |
cbb2b07e | 127 | N (16, bfd_mach_msp47, "MSP430x47", FALSE, & arch_info_struct[22]), |
13761a11 NC |
128 | |
129 | /* msp430x54x. */ | |
cbb2b07e | 130 | N (16, bfd_mach_msp54, "MSP430x54", FALSE, & arch_info_struct[23]), |
13761a11 | 131 | |
cbb2b07e | 132 | N (32, bfd_mach_msp430x, "MSP430X", FALSE, NULL) |
13761a11 | 133 | |
2469cfa2 NC |
134 | }; |
135 | ||
136 | const bfd_arch_info_type bfd_msp430_arch = | |
137 | N (16, bfd_mach_msp14, "msp:14", TRUE, & arch_info_struct[0]); | |
138 |