xref: /dflybsd-src/contrib/gdb-7/bfd/cpu-i386.c (revision 5796c8dc12c637f18a1740c26afd8d40ffa9b719)
1*5796c8dcSSimon Schubert /* BFD support for the Intel 386 architecture.
2*5796c8dcSSimon Schubert    Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2004, 2005,
3*5796c8dcSSimon Schubert    2007, 2009
4*5796c8dcSSimon Schubert    Free Software Foundation, Inc.
5*5796c8dcSSimon Schubert 
6*5796c8dcSSimon Schubert    This file is part of BFD, the Binary File Descriptor library.
7*5796c8dcSSimon Schubert 
8*5796c8dcSSimon Schubert    This program is free software; you can redistribute it and/or modify
9*5796c8dcSSimon Schubert    it under the terms of the GNU General Public License as published by
10*5796c8dcSSimon Schubert    the Free Software Foundation; either version 3 of the License, or
11*5796c8dcSSimon Schubert    (at your option) any later version.
12*5796c8dcSSimon Schubert 
13*5796c8dcSSimon Schubert    This program is distributed in the hope that it will be useful,
14*5796c8dcSSimon Schubert    but WITHOUT ANY WARRANTY; without even the implied warranty of
15*5796c8dcSSimon Schubert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*5796c8dcSSimon Schubert    GNU General Public License for more details.
17*5796c8dcSSimon Schubert 
18*5796c8dcSSimon Schubert    You should have received a copy of the GNU General Public License
19*5796c8dcSSimon Schubert    along with this program; if not, write to the Free Software
20*5796c8dcSSimon Schubert    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21*5796c8dcSSimon Schubert    MA 02110-1301, USA.  */
22*5796c8dcSSimon Schubert 
23*5796c8dcSSimon Schubert #include "sysdep.h"
24*5796c8dcSSimon Schubert #include "bfd.h"
25*5796c8dcSSimon Schubert #include "libbfd.h"
26*5796c8dcSSimon Schubert 
27*5796c8dcSSimon Schubert static const bfd_arch_info_type bfd_x86_64_arch_intel_syntax =
28*5796c8dcSSimon Schubert {
29*5796c8dcSSimon Schubert   64, /* 64 bits in a word */
30*5796c8dcSSimon Schubert   64, /* 64 bits in an address */
31*5796c8dcSSimon Schubert   8,  /* 8 bits in a byte */
32*5796c8dcSSimon Schubert   bfd_arch_i386,
33*5796c8dcSSimon Schubert   bfd_mach_x86_64_intel_syntax,
34*5796c8dcSSimon Schubert   "i386:intel",
35*5796c8dcSSimon Schubert   "i386:x86-64:intel",
36*5796c8dcSSimon Schubert   3,
37*5796c8dcSSimon Schubert   FALSE,
38*5796c8dcSSimon Schubert   bfd_default_compatible,
39*5796c8dcSSimon Schubert   bfd_default_scan,
40*5796c8dcSSimon Schubert   0
41*5796c8dcSSimon Schubert };
42*5796c8dcSSimon Schubert 
43*5796c8dcSSimon Schubert static const bfd_arch_info_type bfd_i386_arch_intel_syntax =
44*5796c8dcSSimon Schubert {
45*5796c8dcSSimon Schubert   32,	/* 32 bits in a word */
46*5796c8dcSSimon Schubert   32,	/* 32 bits in an address */
47*5796c8dcSSimon Schubert   8,	/* 8 bits in a byte */
48*5796c8dcSSimon Schubert   bfd_arch_i386,
49*5796c8dcSSimon Schubert   bfd_mach_i386_i386_intel_syntax,
50*5796c8dcSSimon Schubert   "i386:intel",
51*5796c8dcSSimon Schubert   "i386:intel",
52*5796c8dcSSimon Schubert   3,
53*5796c8dcSSimon Schubert   TRUE,
54*5796c8dcSSimon Schubert   bfd_default_compatible,
55*5796c8dcSSimon Schubert   bfd_default_scan,
56*5796c8dcSSimon Schubert   &bfd_x86_64_arch_intel_syntax
57*5796c8dcSSimon Schubert };
58*5796c8dcSSimon Schubert 
59*5796c8dcSSimon Schubert static const bfd_arch_info_type i8086_arch =
60*5796c8dcSSimon Schubert {
61*5796c8dcSSimon Schubert   32,	/* 32 bits in a word */
62*5796c8dcSSimon Schubert   32,	/* 32 bits in an address (well, not really) */
63*5796c8dcSSimon Schubert   8,	/* 8 bits in a byte */
64*5796c8dcSSimon Schubert   bfd_arch_i386,
65*5796c8dcSSimon Schubert   bfd_mach_i386_i8086,
66*5796c8dcSSimon Schubert   "i8086",
67*5796c8dcSSimon Schubert   "i8086",
68*5796c8dcSSimon Schubert   3,
69*5796c8dcSSimon Schubert   FALSE,
70*5796c8dcSSimon Schubert   bfd_default_compatible,
71*5796c8dcSSimon Schubert   bfd_default_scan,
72*5796c8dcSSimon Schubert   &bfd_i386_arch_intel_syntax
73*5796c8dcSSimon Schubert };
74*5796c8dcSSimon Schubert 
75*5796c8dcSSimon Schubert static const bfd_arch_info_type bfd_x86_64_arch =
76*5796c8dcSSimon Schubert {
77*5796c8dcSSimon Schubert   64, /* 64 bits in a word */
78*5796c8dcSSimon Schubert   64, /* 64 bits in an address */
79*5796c8dcSSimon Schubert   8,  /* 8 bits in a byte */
80*5796c8dcSSimon Schubert   bfd_arch_i386,
81*5796c8dcSSimon Schubert   bfd_mach_x86_64,
82*5796c8dcSSimon Schubert   "i386",
83*5796c8dcSSimon Schubert   "i386:x86-64",
84*5796c8dcSSimon Schubert   3,
85*5796c8dcSSimon Schubert   FALSE,
86*5796c8dcSSimon Schubert   bfd_default_compatible,
87*5796c8dcSSimon Schubert   bfd_default_scan,
88*5796c8dcSSimon Schubert   &i8086_arch
89*5796c8dcSSimon Schubert };
90*5796c8dcSSimon Schubert 
91*5796c8dcSSimon Schubert const bfd_arch_info_type bfd_i386_arch =
92*5796c8dcSSimon Schubert {
93*5796c8dcSSimon Schubert   32,	/* 32 bits in a word */
94*5796c8dcSSimon Schubert   32,	/* 32 bits in an address */
95*5796c8dcSSimon Schubert   8,	/* 8 bits in a byte */
96*5796c8dcSSimon Schubert   bfd_arch_i386,
97*5796c8dcSSimon Schubert   bfd_mach_i386_i386,
98*5796c8dcSSimon Schubert   "i386",
99*5796c8dcSSimon Schubert   "i386",
100*5796c8dcSSimon Schubert   3,
101*5796c8dcSSimon Schubert   TRUE,
102*5796c8dcSSimon Schubert   bfd_default_compatible,
103*5796c8dcSSimon Schubert   bfd_default_scan,
104*5796c8dcSSimon Schubert   &bfd_x86_64_arch
105*5796c8dcSSimon Schubert };
106