[PATCH] expose extended processor information for various architectures

Martin Szulecki compiz at sukimashita.com
Sun Apr 8 09:41:21 PDT 2007


Here is a prototype patch to extend the information available for the
processor device as I think it fits into the basic idea of HAL. It
enables applications (or games) to query for certain CPU features and be
able to adjust themselves automatically purely by using HAL. (Check if
the computer has enough speed, the CPU supports SSE, ...)

In current HAL the whole /proc/cpuinfo file content is already read and
the processor model is stored as "info.product", however in a way that
only works for x86 and compatible architectures.

The patch basically supports the cpuinfo format of different
architectures and should be easily expandable to whoever wants to
contribute more.

The issues for discussion seem to be:
- agree on the correct processor namespace
- conditional compilation depending on HAL's architecture (if I compile
ppc HAL packages, is the x86 stuff obsolete?)
- freebsd, solaris
- the quality of my code. ;)

As we can expect (even major) differences among CPU architectures, I
introduced an architecture dependent namespace such as "processor.x86".

However in terms of abstraction, it might make more sense to simply add
(and agree upon) more non-mandatory general processor properties such as
"processor.bogomips", "processor.flags" and rather store the
architecture in "processor.architecture".

I leave that up for the namespace gurus here and will fix the patch
accordingly.

This might show better what I am talking about:
http://sukimashita.com/temp/00-hal-processor-cpuinfo-1.png

Another issue that was brought up on IRC was the deprecation of /proc
for sysfs. I think the CPU stuff is pretty hardwired and it will take
quite some time until that stuff is ported and especially itself
abstracted to sysfs for all archs. Once that time comes, we simply
adjust to use sysfs and HAL users won't notice (accounting good
abstraction).

- Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 00-hal-processor-cpuinfo.diff
Type: text/x-patch
Size: 12994 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070408/4e6d7568/00-hal-processor-cpuinfo.bin


More information about the hal mailing list