Show
Ignore:
Timestamp:
02/20/08 20:05:00 (6 years ago)
Author:
khali
Message:

Do not access I/O ports on PPC.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect

    r5117 r5124  
    44#    sensors-detect - Detect PCI bus and chips 
    55#    Copyright (C) 1998 - 2002  Frodo Looijaard <frodol@dds.nl> 
    6 #    Copyright (C) 2004 - 2007  Jean Delvare <khali@linux-fr.org> 
     6#    Copyright (C) 2004 - 2008  Jean Delvare <khali@linux-fr.org> 
    77# 
    88#    This program is free software; you can redistribute it and/or modify 
     
    23672367# [3] -> EXTRAVERSION 
    23682368# 
    2369 use vars qw(@kernel_version); 
     2369use vars qw(@kernel_version $kernel_arch); 
    23702370 
    23712371sub initialize_kernel_version 
     
    23732373  `uname -r` =~ /(\d+)\.(\d+)\.(\d+)(.*)/; 
    23742374  @kernel_version = ($1, $2, $3, $4); 
     2375  chomp($kernel_arch = `uname -m`); 
    23752376} 
    23762377 
     
    58115812  print "\n"; 
    58125813 
    5813   print "Some chips are also accessible through the ISA I/O ports. We have to\n". 
    5814         "write to arbitrary I/O ports to probe them. This is usually safe though.\n". 
    5815         "Yes, you do have ISA I/O ports even if you do not have any ISA slots!\n"; 
    5816   print "Do you want to scan the ISA I/O ports? (YES/no): "; 
    5817   unless (<STDIN> =~ /^\s*n/i) { 
    5818     initialize_ioports(); 
    5819     scan_isa_bus(); 
    5820     close_ioports(); 
    5821   } 
    5822   print "\n"; 
    5823  
    5824   print "Some Super I/O chips may also contain sensors. We have to write to\n". 
    5825         "standard I/O ports to probe them. This is usually safe.\n"; 
    5826   print "Do you want to scan for Super I/O sensors? (YES/no): "; 
    5827   unless (<STDIN> =~ /^\s*n/i) { 
    5828     initialize_ioports(); 
    5829     scan_superio(0x2e, 0x2f); 
    5830     scan_superio(0x4e, 0x4f); 
    5831     close_ioports(); 
    5832   } 
    5833   print "\n"; 
     5814  # Skip "random" I/O port probing on PPC 
     5815  if ($kernel_arch ne 'ppc' 
     5816   && $kernel_arch ne 'ppc64') { 
     5817    print "Some chips are also accessible through the ISA I/O ports. We have to\n". 
     5818          "write to arbitrary I/O ports to probe them. This is usually safe though.\n". 
     5819          "Yes, you do have ISA I/O ports even if you do not have any ISA slots!\n"; 
     5820    print "Do you want to scan the ISA I/O ports? (YES/no): "; 
     5821    unless (<STDIN> =~ /^\s*n/i) { 
     5822      initialize_ioports(); 
     5823      scan_isa_bus(); 
     5824      close_ioports(); 
     5825    } 
     5826    print "\n"; 
     5827 
     5828    print "Some Super I/O chips may also contain sensors. We have to write to\n". 
     5829          "standard I/O ports to probe them. This is usually safe.\n"; 
     5830    print "Do you want to scan for Super I/O sensors? (YES/no): "; 
     5831    unless (<STDIN> =~ /^\s*n/i) { 
     5832      initialize_ioports(); 
     5833      scan_superio(0x2e, 0x2f); 
     5834      scan_superio(0x4e, 0x4f); 
     5835      close_ioports(); 
     5836    } 
     5837    print "\n"; 
     5838  } 
    58345839 
    58355840  print "Some CPUs or memory controllers may also contain embedded sensors.\n";