def self.hpux_processor_list
return_value = []
hpux_proc_id_list = []
cpu = ""
if output = machinfo then
output.split("\n").each do |line|
if line.match(/processor model:\s+\d+\s+(.*)/) then
cpu = $1.to_s
elsif line.match(/\d+\s+((?:PA-RISC|Intel).*processors.*)/) then
cpu = $1.to_s
cpu.sub!(/processors/, "processor")
end
end
end
if cpu.empty? then
m = model
m.sub!(/\s+$/, "")
m.sub!(/.*\//, "")
m.sub!(/.*\s+/, "")
if sched_models_lines = read_sched_models
sched_models_lines.each do |l|
if l.match(m) and l.match(/^\S+\s+\d+\.\d+\s+(\S+)/) then
cpu = "PA-RISC " + $1.to_s.sub!(/^PA/, "") + " processor"
break
end
end
end
end
if cpu.empty? then
cpu_version = getconf_cpu_version
cpu_chip_type = getconf_cpu_chip_type
cpu_string = ""
if lines = read_unistd_h("/usr/include/sys/unistd.h") then
lines.each do |l|
if l.match(/define.*0x#{cpu_version.to_i.to_s(16)}.*\/\*\s+(.*)\s+\*\//) then
cpu_string = $1.to_s
break
end
end
end
if cpu_string.empty? then
cpu_string = "CPU v" + cpu_version
end
cpu = cpu_string + " CHIP TYPE #" + cpu_chip_type
end
if output = ioscan then
output.split("\n").each do |line|
if line.match(/processor/) then
hpux_proc_id_list << cpu
end
end
end
hpux_proc_id_list
end