This commit was manufactured by cvs2svn to create branch 'binutils-
[external/binutils.git] / bfd / cpu-i370.c
1 /* BFD i370 CPU definition
2    Copyright (C) 1994, 95, 96, 98, 99, 2000 Free Software Foundation, Inc.
3    Contributed by Ian Lance Taylor, Cygnus Support.
4    Hacked by Linas Vepstas <linas@linas.org> in 1998, 1999
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
10 the Free Software Foundation; either version 2 of the License, or
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
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
21
22 #include "bfd.h"
23 #include "sysdep.h"
24 #include "libbfd.h"
25
26 /* The common i360/370 architecture comes in many forms  */
27
28 static const bfd_arch_info_type *i370_compatible
29   PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
30
31 static const bfd_arch_info_type *
32 i370_compatible (a, b)
33      const bfd_arch_info_type *a;
34      const bfd_arch_info_type *b;
35 {
36   BFD_ASSERT (a->arch == bfd_arch_i370);
37   switch (b->arch)
38     {
39     default:
40       return NULL;
41     case bfd_arch_i370:
42       return bfd_default_compatible (a, b);
43     }
44   /*NOTREACHED*/
45 }
46
47 static const bfd_arch_info_type arch_info_struct[] =
48 {
49   /* hack alert: old old machines are really 16 and 24 bit arch ... */
50   {
51     32, /* 32 bits in a word */
52     32, /* 32 bits in an address */
53     8,  /* 8 bits in a byte */
54     bfd_arch_i370,
55     360, /* for the 360 */
56     "i370",
57     "i370:360",
58     3,
59     false, /* not the default */
60     i370_compatible,
61     bfd_default_scan,
62     &arch_info_struct[1]
63   },
64   {
65     32, /* 32 bits in a word */
66     32, /* 32 bits in an address */
67     8,  /* 8 bits in a byte */
68     bfd_arch_i370,
69     370, /* for the 370 */
70     "i370",
71     "i370:370",
72     3,
73     false, /* not the default */
74     i370_compatible,
75     bfd_default_scan,
76     0
77   },
78 };
79
80 const bfd_arch_info_type bfd_i370_arch =
81   {
82     32, /* 32 bits in a word */
83     32, /* 32 bits in an address */
84     8,  /* 8 bits in a byte */
85     bfd_arch_i370,
86     0,  /* for the 360/370 common architecture */
87     "i370",
88     "i370:common",
89     3,
90     true, /* the default */
91     i370_compatible,
92     bfd_default_scan,
93     &arch_info_struct[0]
94   };