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