Changeset 5961
- Timestamp:
- 04/15/11 10:26:49 (13 months ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 5 modified
-
CHANGES (modified) (1 diff)
-
prog/dump/isadump.8 (modified) (4 diffs)
-
prog/dump/isadump.c (modified) (7 diffs)
-
prog/dump/util.c (modified) (2 diffs)
-
prog/dump/util.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r5958 r5961 3 3 4 4 SVN HEAD 5 isadump: Add support for word (16-bit) and long (32-bit) reads 5 6 sensors-detect: Add AMD family 15h CPU detection 6 7 Add detection of ADT7461A / NCT1008 -
lm-sensors/trunk/prog/dump/isadump.8
r4471 r5961 1 .TH ISADUMP 8 "A ugust 2004"1 .TH ISADUMP 8 "April 2011" 2 2 .SH NAME 3 3 isadump \- examine ISA registers … … 6 6 .B isadump 7 7 .RB [ -y ] 8 .RB [ -W | -L ] 8 9 .RB [ "-k V1,V2..." ] 9 10 .I addrreg … … 13 14 .br 14 15 .B isadump 16 .B -f 15 17 .RB [ -y ] 16 .BI "-f " address 18 .RB [ -W | -L ] 19 .I address 17 20 .RI [ "range " [ "bank " [ bankreg ]]] 18 21 #for flat address space … … 40 43 Known key sequences are: 0x87,0x01,0x55,0x55 for ITE, 0x55 for SMSC, 0x87,0x87 41 44 for Winbond and VIA, none needed for National Semiconductor. 45 .TP 46 .B -W 47 Perform 16-bit reads. 48 .TP 49 .B -L 50 Perform 32-bit reads. 42 51 43 52 .SH OPTIONS (I2C-like access mode) -
lm-sensors/trunk/prog/dump/isadump.c
r5709 r5961 3 3 Copyright (C) 2000 Frodo Looijaard <frodol@dds.nl>, and 4 4 Mark D. Studebaker <mdsxyz123@yahoo.com> 5 Copyright (C) 2004 ,2007Jean Delvare <khali@linux-fr.org>5 Copyright (C) 2004-2011 Jean Delvare <khali@linux-fr.org> 6 6 7 7 This program is free software; you can redistribute it and/or modify … … 53 53 fprintf(stderr, 54 54 "Syntax for I2C-like access:\n" 55 " isadump [ -y] [-k V1,V2...] ADDRREG DATAREG [BANK [BANKREG]]\n"55 " isadump [OPTIONS] [-k V1,V2...] ADDRREG DATAREG [BANK [BANKREG]]\n" 56 56 "Syntax for flat address space:\n" 57 " isadump [-y] -f ADDRESS [RANGE [BANK [BANKREG]]]\n"); 57 " isadump -f [OPTIONS] ADDRESS [RANGE [BANK [BANKREG]]]\n" 58 "Options:\n" 59 " -k Super-I/O configuration access key\n" 60 " -f Enable flat address space mode\n" 61 " -y Assume affirmative answer to all questions\n" 62 " -W Read and display word (16-bit) values\n" 63 " -L Read and display long (32-bit) values\n"); 58 64 } 59 65 … … 97 103 int bankreg; 98 104 int oldbank = 0; 99 int i, j, res; 105 int i, j; 106 unsigned long res; 100 107 int flags = 0; 101 int flat = 0, yes = 0 ;108 int flat = 0, yes = 0, width = 1; 102 109 char *end; 103 110 unsigned char enter_key[SUPERIO_MAX_KEY+1]; … … 119 126 flags++; 120 127 break; 128 case 'W': width = 2; break; 129 case 'L': width = 4; break; 121 130 default: 122 131 fprintf(stderr, "Warning: Unsupported flag " … … 271 280 oldbank = set_bank(flat, addrreg, datareg, bank, bankreg); 272 281 273 if (flat) 274 printf(" "); 275 printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f\n"); 282 /* print column headers */ 283 printf("%*s", flat ? 5 : 3, ""); 284 for (j = 0; j < 16; j += width) 285 printf(" %*x", width * 2, j); 286 printf("\n"); 287 276 288 for (i = 0; i < range; i += 16) { 277 289 if (flat) … … 289 301 superio_write_key(addrreg, enter_key); 290 302 291 for (j = 0; j < 16; j ++) {303 for (j = 0; j < 16; j += width) { 292 304 fflush(stdout); 293 305 if (flat) { 294 res = in b(addrreg + i + j);306 res = inx(addrreg + i + j, width); 295 307 } else { 296 308 outb(i+j, addrreg); … … 299 311 range = 128; 300 312 } 301 res = in b(datareg);302 } 303 printf("%0 2x ", res);313 res = inx(datareg, width); 314 } 315 printf("%0*lx ", width * 2, res); 304 316 } 305 317 printf("\n"); -
lm-sensors/trunk/prog/dump/util.c
r4670 r5961 11 11 #include <stdio.h> 12 12 #include "util.h" 13 14 /* To keep glibc2 happy */ 15 #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0 16 #include <sys/io.h> 17 #else 18 #include <asm/io.h> 19 #endif 13 20 14 21 /* Return 1 if we should continue, 0 if we should abort */ … … 47 54 } 48 55 56 /* I/O read of specified size */ 57 unsigned long inx(int addr, int width) 58 { 59 switch (width) { 60 case 2: 61 return inw(addr); 62 break; 63 case 4: 64 return inl(addr); 65 break; 66 default: 67 return inb(addr); 68 } 69 } -
lm-sensors/trunk/prog/dump/util.h
r4670 r5961 13 13 14 14 extern int user_ack(int def); 15 extern unsigned long inx(int addr, int width); 15 16 16 17 #endif /* _UTIL_H */
