How to identity processor architecture
From: Enrico Granata <hidden>
Date: 2011-01-27 06:54:09
On Jan 26, 2011, at 10:45 PM, Mulyadi Santosa wrote:
On Thu, Jan 27, 2011 at 13:40, prabhu [off-list ref] wrote:quoted
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? -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com _______________________________________________ Kernelnewbies mailing list Kernelnewbies at kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
I guess a 64bit processor does need 64bit addresses to reference memory. But at the same time, if 32 bit programs are to run unmodified on 64 bit architectures there needs to be ways in which 32bit pointers can still work. So, I am almost 100% sure that compiling 32bit code, even on a 64bit processor, should yield 4 for sizeof(void*) Enrico Granata Computer Science & Engineering Department (EBU3B) - Room 3240 office phone 858 534 9914 University of California, San Diego -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110126/92bcc874/attachment.html