Changeset 609 for branches/GNU/src/binutils/bfd/cpu-i960.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/cpu-i960.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* 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 3 3 Free Software Foundation, Inc. 4 4 Hacked by Steve Chamberlain of Cygnus Support. … … 24 24 #include "libbfd.h" 25 25 26 static bfd_boolean scan_960_mach 27 PARAMS ((const bfd_arch_info_type *, const char *)); 28 static const bfd_arch_info_type *compatible 29 PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); 30 26 31 /* This routine is provided a string, and tries to work out if it 27 32 could possibly refer to the i960 machine pointed at in the 28 33 info_struct pointer */ 29 34 30 static b oolean35 static bfd_boolean 31 36 scan_960_mach (ap, string) 32 37 const bfd_arch_info_type *ap; … … 34 39 { 35 40 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; 41 42 42 43 /* Look for the string i960 at the front of the string. */ 43 if (strnc mp ("i960", string, 4) == 0)44 if (strncasecmp ("i960", string, 4) == 0) 44 45 { 45 46 string += 4; … … 51 52 /* "i960:*" is valid, anything else is not. */ 52 53 if (* string != ':') 53 return false;54 return FALSE; 54 55 55 56 string ++; … … 61 62 string += 5; 62 63 63 /* Set t his to truehere. If a correct matching postfix64 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; 66 67 } 67 68 /* No match, can't be us. */ 68 69 else 69 return false;70 return FALSE; 70 71 71 72 if (* string == '\0') 72 return false;73 return FALSE; 73 74 74 75 if (string[0] == 'c' && string[1] == 'o' && string[2] == 'r' && 75 76 string[3] == 'e' && string[4] == '\0') 76 77 machine = bfd_mach_i960_core; 77 else if (strc mp (string, "ka_sa") == 0)78 else if (strcasecmp (string, "ka_sa") == 0) 78 79 machine = bfd_mach_i960_ka_sa; 79 else if (strc mp (string, "kb_sb") == 0)80 else if (strcasecmp (string, "kb_sb") == 0) 80 81 machine = bfd_mach_i960_kb_sb; 81 82 else if (string[1] == '\0' || string[2] != '\0') /* rest are 2-char. */ 82 return false;83 return FALSE; 83 84 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; } 85 86 else if (string[0] == 's' && string[1] == 'b') 86 87 machine = bfd_mach_i960_kb_sb; 87 88 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; } 89 90 else if (string[0] == 'x' && string[1] == 'a') 90 91 machine = bfd_mach_i960_xa; 91 92 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; } 93 94 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; } 95 96 else if (string[0] == 's' && string[1] == 'a') 96 97 machine = bfd_mach_i960_ka_sa; … … 100 101 machine = bfd_mach_i960_hx; 101 102 else 102 return false;103 return FALSE; 103 104 104 105 if (fail_because_not_80960) 105 return false;106 return FALSE; 106 107 107 108 if (machine == ap->mach) 108 return true;109 return TRUE; 109 110 110 return false;111 return FALSE; 111 112 } 112 113 … … 141 142 #define MAX_ARCH ((int)HX) 142 143 143 static CONSTunsigned long matrix[MAX_ARCH+1][MAX_ARCH+1] =144 static const unsigned long matrix[MAX_ARCH+1][MAX_ARCH+1] = 144 145 { 145 146 { ERROR, CORE, KA, KB, MC, XA, CA, JX, HX }, … … 164 165 } 165 166 166 int bfd_default_scan_num_mach();167 167 #define N(a,b,d,n) \ 168 168 { 32, 32, 8,bfd_arch_i960,a,"i960",b,3,d,compatible,scan_960_mach,n,} … … 170 170 static const bfd_arch_info_type arch_info_struct[] = 171 171 { 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), 179 179 }; 180 180 181 181 const 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]); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.