[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 3DNow! and MMX







>hi attached a litte code. The Windows version works fine. But not the
>Linux version. Linux do a SIGSEGV.. any idea?
>  asm (
>  "mov %%eax, 80000001                                  \n"
>  "CPUID                                                \n"
>  "mov %0, %%edx                        \n"
>  :"=g" (id)
>  :
>  );

I don't think you're allowed to do this. I'd suggest you simply have your
program go look in /proc/cpuinfo to get this sort of stuff. The kernel does all
this for you and stores the results. When you access the psuedo files under the
/proc filesystem you can get all kinds of useful info, without resorting to
horrid code. It'll also port to the Linuxes running on completely other CPUs.