Back to index

cell-binutils  2.17cvs20070401
cpu-rs6000.c
Go to the documentation of this file.
00001 /* BFD back-end for rs6000 support
00002    Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003
00003    Free Software Foundation, Inc.
00004    FIXME: Can someone provide a transliteration of this name into ASCII?
00005    Using the following chars caused a compiler warning on HIUX (so I replaced
00006    them with octal escapes), and isn't useful without an understanding of what
00007    character set it is.
00008    Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM
00009    and John Gilmore of Cygnus Support.
00010 
00011 This file is part of BFD, the Binary File Descriptor library.
00012 
00013 This program is free software; you can redistribute it and/or modify
00014 it under the terms of the GNU General Public License as published by
00015 the Free Software Foundation; either version 2 of the License, or
00016 (at your option) any later version.
00017 
00018 This program is distributed in the hope that it will be useful,
00019 but WITHOUT ANY WARRANTY; without even the implied warranty of
00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021 GNU General Public License for more details.
00022 
00023 You should have received a copy of the GNU General Public License
00024 along with this program; if not, write to the Free Software
00025 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00026 
00027 #include "bfd.h"
00028 #include "sysdep.h"
00029 #include "libbfd.h"
00030 
00031 /* The RS/6000 architecture is compatible with the PowerPC common
00032    architecture.  */
00033 
00034 static const bfd_arch_info_type *rs6000_compatible
00035   PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
00036 
00037 static const bfd_arch_info_type *
00038 rs6000_compatible (a,b)
00039      const bfd_arch_info_type *a;
00040      const bfd_arch_info_type *b;
00041 {
00042   BFD_ASSERT (a->arch == bfd_arch_rs6000);
00043   switch (b->arch)
00044     {
00045     default:
00046       return NULL;
00047     case bfd_arch_rs6000:
00048       return bfd_default_compatible (a, b);
00049     case bfd_arch_powerpc:
00050       if (a->mach == bfd_mach_rs6k)
00051        return b;
00052       return NULL;
00053     }
00054   /*NOTREACHED*/
00055 }
00056 
00057 static const bfd_arch_info_type arch_info_struct[] =
00058 {
00059   {
00060     32,       /* 32 bits in a word */
00061     32,       /* 32 bits in an address */
00062     8, /* 8 bits in a byte */
00063     bfd_arch_rs6000,
00064     bfd_mach_rs6k_rs1,
00065     "rs6000",
00066     "rs6000:rs1",
00067     3,
00068     FALSE, /* not the default */
00069     rs6000_compatible,
00070     bfd_default_scan,
00071     &arch_info_struct[1]
00072   },
00073   {
00074     32,       /* 32 bits in a word */
00075     32,       /* 32 bits in an address */
00076     8, /* 8 bits in a byte */
00077     bfd_arch_rs6000,
00078     bfd_mach_rs6k_rsc,
00079     "rs6000",
00080     "rs6000:rsc",
00081     3,
00082     FALSE, /* not the default */
00083     rs6000_compatible,
00084     bfd_default_scan,
00085     &arch_info_struct[2]
00086   },
00087   {
00088     32,       /* 32 bits in a word */
00089     32,       /* 32 bits in an address */
00090     8, /* 8 bits in a byte */
00091     bfd_arch_rs6000,
00092     bfd_mach_rs6k_rs2,
00093     "rs6000",
00094     "rs6000:rs2",
00095     3,
00096     FALSE, /* not the default */
00097     rs6000_compatible,
00098     bfd_default_scan,
00099     0
00100   }
00101 };
00102 
00103 const bfd_arch_info_type bfd_rs6000_arch =
00104   {
00105     32,       /* 32 bits in a word */
00106     32,       /* 32 bits in an address */
00107     8, /* 8 bits in a byte */
00108     bfd_arch_rs6000,
00109     bfd_mach_rs6k,   /* POWER common architecture */
00110     "rs6000",
00111     "rs6000:6000",
00112     3,
00113     TRUE, /* the default */
00114     rs6000_compatible,
00115     bfd_default_scan,
00116     &arch_info_struct[0]
00117   };