How to identity processor architecture

Denis Kirjanov kirjanov at gmail.com
Thu Jan 27 15:01:19 EST 2011


On Thu, Jan 27, 2011 at 10:27 PM, mindentropy <mindentropy at gmail.com> wrote:
> On Thursday 27 Jan 2011 12:15:47 pm Mulyadi Santosa wrote:
>> On Thu, Jan 27, 2011 at 13:40, prabhu <prabhum at msys-tech.com> wrote:
>> > No, because 32bit code will tell the datatype size and i think pointer
>> > variable depends on architecture.
>> > So 64 bit processor needs 64 address line to point the data location. So
>> > pointer variable needs to be 8 byte.
>>
>> Please don't top post and please use the new list address, ok? :)
>>
>> IMO, I second your opinion. And as addition, I think it's worth to
>> check /proc/cpuinfo too  in "address sizes" field
>>
>> NB: I was thinking, if in x64, it is operating in full 32 bit mode
>> (not hybrid one), it is supposed to yield 32 bit address too, right?
> Why not simply use CPUID ?

In this case solution is not portable and uses arch specific methods.
I think most 64-bit systems today use LP64 data model.

> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Regards,
Denis



More information about the Kernelnewbies mailing list