Changeset 5287
- Timestamp:
- 06/19/08 14:37:06 (5 years ago)
- Location:
- i2c-tools/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
eeprom/decode-dimms (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2c-tools/trunk/CHANGES
r5280 r5287 3 3 4 4 SVN 5 decode-dimms: Add support for little-endian word hexdumps 5 6 decode-vaio: Remove history 6 7 i2cdetect: Support i2c bus passed by name -
i2c-tools/trunk/eeprom/decode-dimms
r5164 r5287 43 43 use vars qw($opt_html $opt_bodyonly $opt_igncheck $use_sysfs $use_hexdump 44 44 @vendors %decode_callback $revision @dimm_list %hexdump_cache); 45 46 use constant LITTLEENDIAN => "little-endian"; 47 use constant BIGENDIAN => "big-endian"; 45 48 46 49 $revision = '$Revision$ ($Date$)'; … … 1133 1136 if (/^(..)(..)$/) { 1134 1137 $word |= 1; 1135 $bytes[$addr++] = hex($1); 1136 $bytes[$addr++] = hex($2); 1138 if ($use_hexdump eq LITTLEENDIAN) { 1139 $bytes[$addr++] = hex($2); 1140 $bytes[$addr++] = hex($1); 1141 } else { 1142 $bytes[$addr++] = hex($1); 1143 $bytes[$addr++] = hex($2); 1144 } 1137 1145 } else { 1138 1146 $bytes[$addr++] = hex($_); … … 1142 1150 close F; 1143 1151 $header and die "Unable to parse any data from hexdump '$_[0]'"; 1144 $word and printc " Warning: Assuming big-endian order16-bit hex dump";1152 $word and printc "Using $use_hexdump 16-bit hex dump"; 1145 1153 1146 1154 # Cache the data for later use … … 1178 1186 foreach (@ARGV) { 1179 1187 if ($_ eq '-h' || $_ eq '--help') { 1180 print "Usage: $0 [-c] [-f [-b]] [-x file [files..]]\n",1188 print "Usage: $0 [-c] [-f [-b]] [-x|-X file [files..]]\n", 1181 1189 " $0 -h\n\n", 1182 1190 " -f, --format Print nice html output\n", … … 1185 1193 " -c, --checksum Decode completely even if checksum fails\n", 1186 1194 " -x, Read data from hexdump files\n", 1195 " -X, Same as -x except treat multibyte hex\n", 1196 " data as little endian\n", 1187 1197 " -h, --help Display this usage summary\n"; 1188 1198 print <<"EOF"; … … 1191 1201 likely many other progams producing hex dumps of one kind or another. Note 1192 1202 that the default output of "hexdump" will be byte-swapped on little-endian 1193 systems and will therefore not be parsed correctly. It is better to use1194 "hexdump -C", which is not ambiguous.1203 systems and you must use -X instead of -x, otherwise the dump will not be 1204 parsed correctly. It is better to use "hexdump -C", which is not ambiguous. 1195 1205 EOF 1196 1206 exit; … … 1210 1220 } 1211 1221 if ($_ eq '-x') { 1212 $use_hexdump = 1; 1222 $use_hexdump = BIGENDIAN; 1223 next; 1224 } 1225 if ($_ eq '-X') { 1226 $use_hexdump = LITTLEENDIAN; 1213 1227 next; 1214 1228 }
