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-v850.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD support for the NEC V850 processor
    2    Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
     2   Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
    33
    4 This file is part of BFD, the Binary File Descriptor library.
     4   This file is part of BFD, the Binary File Descriptor library.
    55
    6 This program is free software; you can redistribute it and/or modify
    7 it under the terms of the GNU General Public License as published by
    8 the Free Software Foundation; either version 2 of the License, or
    9 (at your option) any later version.
     6   This program is free software; you can redistribute it and/or modify
     7   it under the terms of the GNU General Public License as published by
     8   the Free Software Foundation; either version 2 of the License, or
     9   (at your option) any later version.
    1010
    11 This program is distributed in the hope that it will be useful,
    12 but WITHOUT ANY WARRANTY; without even the implied warranty of
    13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14 GNU General Public License for more details.
     11   This program is distributed in the hope that it will be useful,
     12   but WITHOUT ANY WARRANTY; without even the implied warranty of
     13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14   GNU General Public License for more details.
    1515
    16 You should have received a copy of the GNU General Public License
    17 along with this program; if not, write to the Free Software
    18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     16   You should have received a copy of the GNU General Public License
     17   along with this program; if not, write to the Free Software
     18   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    1919
    2020#include "bfd.h"
    2121#include "sysdep.h"
    2222#include "libbfd.h"
    23 
    24 #include <ctype.h>
    25 
    26 static boolean
    27 scan (info, string)
    28      const struct bfd_arch_info * info;
    29      const char * string;
    30 {
    31   const char *ptr_src;
    32   const char *ptr_tst;
    33   unsigned long number;
    34   enum bfd_architecture arch;
    35 
    36   /* First test for an exact match */
    37   if (strcasecmp (string, info->printable_name) == 0)
    38     return true;
    39 
    40   /* See how much of the supplied string matches with the
    41      architecture, eg the string m68k:68020 would match the m68k entry
    42      up to the :, then we get left with the machine number */
    43 
    44   for (ptr_src = string, ptr_tst = info->arch_name;
    45        *ptr_src && *ptr_tst;
    46        ptr_src++, ptr_tst++)
    47     {
    48       if (*ptr_src != *ptr_tst) break;
    49     }
    50 
    51   /* Chewed up as much of the architecture as will match, skip any
    52      colons */
    53   if (*ptr_src == ':')
    54     ptr_src++;
    55 
    56   if (*ptr_src == 0)
    57     {
    58       /* nothing more, then only keep this one if it is the default
    59          machine for this architecture */
    60       return info->the_default;
    61     }
    62 
    63   number = 0;
    64   while (isdigit ((unsigned char) *ptr_src))
    65     {
    66       number = number * 10 + * ptr_src  - '0';
    67       ptr_src++;
    68     }
    69 
    70   switch (number)
    71     {
    72     case bfd_mach_v850e:  arch = bfd_arch_v850; break;
    73     case bfd_mach_v850ea: arch = bfd_arch_v850; break;
    74     default:
    75       return false;
    76     }
    77 
    78   if (arch != info->arch)
    79     return false;
    80 
    81   if (number != info->mach)
    82     return false;
    83 
    84   return true;
    85 }
     23#include "safe-ctype.h"
    8624
    8725#define N(number, print, default, next)  \
    8826{  32, 32, 8, bfd_arch_v850, number, "v850", print, 2, default, \
    89      bfd_default_compatible, scan, next }
     27     bfd_default_compatible, bfd_default_scan, next }
    9028
    9129#define NEXT NULL
     
    9331static const bfd_arch_info_type arch_info_struct[] =
    9432{
    95   N (bfd_mach_v850e,  "v850e",  false, &arch_info_struct[1]),
    96   N (bfd_mach_v850ea, "v850ea", false, NULL)
     33  N (bfd_mach_v850e,  "v850e",  FALSE, NULL)
    9734};
    9835
    99 #undef NEXT
    100 #define NEXT &arch_info_struct[0]
     36#undef  NEXT
     37#define NEXT & arch_info_struct[0]
    10138
    10239const bfd_arch_info_type bfd_v850_arch =
    103   N (bfd_mach_v850, "v850", true, NEXT);
     40  N (bfd_mach_v850, "v850", TRUE, NEXT);
Note: See TracChangeset for help on using the changeset viewer.