Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/bfd/cpu-i960.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD library support routines for the i960 architecture.
    2    Copyright 1990, 1991, 1993, 1994, 1996, 1999, 2000
     2   Copyright 1990, 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002
    33   Free Software Foundation, Inc.
    44   Hacked by Steve Chamberlain of Cygnus Support.
     
    2424#include "libbfd.h"
    2525
     26static bfd_boolean scan_960_mach
     27  PARAMS ((const bfd_arch_info_type *, const char *));
     28static const bfd_arch_info_type *compatible
     29  PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
     30
    2631/* This routine is provided a string, and tries to work out if it
    2732   could possibly refer to the i960 machine pointed at in the
    2833   info_struct pointer */
    2934
    30 static boolean
     35static bfd_boolean
    3136scan_960_mach (ap, string)
    3237     const bfd_arch_info_type *ap;
     
    3439{
    3540  unsigned long machine;
    36   int i;
    37   int fail_because_not_80960 = false;
    38 
    39   for (i = 0; i < strlen (string); i ++)
    40     string[i] = tolower (string[i]);
     41  int fail_because_not_80960 = FALSE;
    4142
    4243  /* Look for the string i960 at the front of the string.  */
    43   if (strncmp ("i960", string, 4) == 0)
     44  if (strncasecmp ("i960", string, 4) == 0)
    4445    {
    4546      string += 4;
     
    5152      /* "i960:*" is valid, anything else is not.  */
    5253      if (* string != ':')
    53         return false;
     54        return FALSE;
    5455
    5556      string ++;
     
    6162      string += 5;
    6263
    63       /* Sett his to true here.  If a correct matching postfix
    64          is detected below it will be reset to false.  */
    65       fail_because_not_80960 = true;
     64      /* Set this to TRUE here.  If a correct matching postfix
     65         is detected below it will be reset to FALSE.  */
     66      fail_because_not_80960 = TRUE;
    6667    }
    6768  /* No match, can't be us.  */
    6869  else
    69     return false;
     70    return FALSE;
    7071
    7172  if (* string == '\0')
    72     return false;
     73    return FALSE;
    7374
    7475  if (string[0] == 'c' && string[1] == 'o' && string[2] == 'r' &&
    7576      string[3] == 'e' && string[4] == '\0')
    7677    machine = bfd_mach_i960_core;
    77   else if (strcmp (string, "ka_sa") == 0)
     78  else if (strcasecmp (string, "ka_sa") == 0)
    7879    machine = bfd_mach_i960_ka_sa;
    79   else if (strcmp (string, "kb_sb") == 0)
     80  else if (strcasecmp (string, "kb_sb") == 0)
    8081    machine = bfd_mach_i960_kb_sb;
    8182  else if (string[1] == '\0' || string[2] != '\0') /* rest are 2-char.  */
    82     return false;
     83    return FALSE;
    8384  else if (string[0] == 'k' && string[1] == 'b')
    84     { machine = bfd_mach_i960_kb_sb; fail_because_not_80960 = false; }
     85    { machine = bfd_mach_i960_kb_sb; fail_because_not_80960 = FALSE; }
    8586  else if (string[0] == 's' && string[1] == 'b')
    8687    machine = bfd_mach_i960_kb_sb;
    8788  else if (string[0] == 'm' && string[1] == 'c')
    88     { machine = bfd_mach_i960_mc; fail_because_not_80960 = false; }
     89    { machine = bfd_mach_i960_mc; fail_because_not_80960 = FALSE; }
    8990  else if (string[0] == 'x' && string[1] == 'a')
    9091    machine = bfd_mach_i960_xa;
    9192  else if (string[0] == 'c' && string[1] == 'a')
    92     { machine = bfd_mach_i960_ca; fail_because_not_80960 = false; }
     93    { machine = bfd_mach_i960_ca; fail_because_not_80960 = FALSE; }
    9394  else if (string[0] == 'k' && string[1] == 'a')
    94     { machine = bfd_mach_i960_ka_sa; fail_because_not_80960 = false; }
     95    { machine = bfd_mach_i960_ka_sa; fail_because_not_80960 = FALSE; }
    9596  else if (string[0] == 's' && string[1] == 'a')
    9697    machine = bfd_mach_i960_ka_sa;
     
    100101    machine = bfd_mach_i960_hx;
    101102  else
    102     return false;
     103    return FALSE;
    103104
    104105  if (fail_because_not_80960)
    105     return false;
     106    return FALSE;
    106107
    107108  if (machine == ap->mach)
    108     return true;
     109    return TRUE;
    109110
    110   return false;
     111  return FALSE;
    111112}
    112113
     
    141142#define MAX_ARCH ((int)HX)
    142143
    143   static CONST unsigned long matrix[MAX_ARCH+1][MAX_ARCH+1] =
     144  static const unsigned long matrix[MAX_ARCH+1][MAX_ARCH+1] =
    144145    {
    145146      { ERROR,  CORE,   KA,     KB,     MC,     XA,     CA,     JX,     HX },
     
    164165}
    165166
    166 int bfd_default_scan_num_mach();
    167167#define N(a,b,d,n) \
    168168{ 32, 32, 8,bfd_arch_i960,a,"i960",b,3,d,compatible,scan_960_mach,n,}
     
    170170static const bfd_arch_info_type arch_info_struct[] =
    171171{
    172   N(bfd_mach_i960_ka_sa,"i960:ka_sa",false, &arch_info_struct[1]),
    173   N(bfd_mach_i960_kb_sb,"i960:kb_sb",false, &arch_info_struct[2]),
    174   N(bfd_mach_i960_mc,   "i960:mc",   false, &arch_info_struct[3]),
    175   N(bfd_mach_i960_xa,   "i960:xa",   false, &arch_info_struct[4]),
    176   N(bfd_mach_i960_ca,   "i960:ca",   false, &arch_info_struct[5]),
    177   N(bfd_mach_i960_jx,   "i960:jx",   false, &arch_info_struct[6]),
    178   N(bfd_mach_i960_hx,   "i960:hx",   false, 0),
     172  N(bfd_mach_i960_ka_sa,"i960:ka_sa",FALSE, &arch_info_struct[1]),
     173  N(bfd_mach_i960_kb_sb,"i960:kb_sb",FALSE, &arch_info_struct[2]),
     174  N(bfd_mach_i960_mc,   "i960:mc",   FALSE, &arch_info_struct[3]),
     175  N(bfd_mach_i960_xa,   "i960:xa",   FALSE, &arch_info_struct[4]),
     176  N(bfd_mach_i960_ca,   "i960:ca",   FALSE, &arch_info_struct[5]),
     177  N(bfd_mach_i960_jx,   "i960:jx",   FALSE, &arch_info_struct[6]),
     178  N(bfd_mach_i960_hx,   "i960:hx",   FALSE, 0),
    179179};
    180180
    181181const bfd_arch_info_type bfd_i960_arch =
    182   N(bfd_mach_i960_core, "i960:core", true, &arch_info_struct[0]);
     182  N(bfd_mach_i960_core, "i960:core", TRUE, &arch_info_struct[0]);
Note: See TracChangeset for help on using the changeset viewer.