Sys::Info::Driver::Unknown::Device::CPU - Compatibility layer for unsupported platforms


Sys-Info-Driver-Unknown documentation Contained in the Sys-Info-Driver-Unknown distribution.

Index


Code Index:

NAME

Top

Sys::Info::Driver::Unknown::Device::CPU - Compatibility layer for unsupported platforms

SYNOPSIS

Top

See Sys::Info::Device::CPU.

DESCRIPTION

Top

This document describes version 0.78 of Sys::Info::Driver::Unknown::Device::CPU released on 17 April 2011.

Unix::Processors is recommended for unsupported platforms.

METHODS

Top

identify

See identify in Sys::Info::Device::CPU.

load

See load in Sys::Info::Device::CPU.

bitness

See bitness in Sys::Info::Device::CPU.

SEE ALSO

Top

Sys::Info, Sys::Info::CPU, Unix::Processors.

AUTHOR

Top

Burak Gursoy <burak@cpan.org>.

COPYRIGHT

Top

LICENSE

Top

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.3 or, at your option, any later version of Perl 5 you may have available.


Sys-Info-Driver-Unknown documentation Contained in the Sys-Info-Driver-Unknown distribution.

package Sys::Info::Driver::Unknown::Device::CPU;
use strict;
use warnings;
use vars qw($VERSION $UP);
use base qw(Sys::Info::Driver::Unknown::Device::CPU::Env);

$VERSION = '0.78';

BEGIN {
    local $SIG{__DIE__};
    local $@;
    my $eok = eval {
        require Unix::Processors;
        Unix::Processors->import;
    };
    $UP = Unix::Processors->new if ! $@ && $eok;
}

sub load    {}
sub bitness {}

sub identify {
    my $self = shift;
    $self->{META_DATA} ||= [
        !$UP ? $self->SUPER::identify(@_) : map {{
            processor_id                 => $_->id, # cpu id 0,1,2,3...
            data_width                   => undef,
            address_width                => undef,
            bus_speed                    => undef,
            speed                        => $_->clock,
            name                         => $_->type,
            family                       => undef,
            manufacturer                 => undef,
            model                        => undef,
            stepping                     => undef,
            number_of_cores              => $UP->max_physical,
            number_of_logical_processors => $UP->max_online,
            L1_cache                     => undef,
            flags                        => undef,
        }} @{ $UP->processors }
    ];
    return $self->_serve_from_cache(wantarray);
}

1;

__END__