Cpuid.c 541 B

123456789101112131415161718192021
  1. /* This Hello World simply print out "Hello World" */
  2. #include "pal.h"
  3. #include "pal_debug.h"
  4. int main (int argc, char ** argv, char ** envp)
  5. {
  6. PAL_NUM values[4];
  7. __asm__ volatile("mov $0, %%rax\n"
  8. "cpuid\n"
  9. : "=a"(values[0]),
  10. "=b"(values[1]),
  11. "=c"(values[2]),
  12. "=d"(values[3])
  13. :: "memory");
  14. pal_printf("cpuid[0] = %08lx %08lx %08lx %08lx\n", values[0], values[1],
  15. values[2], values[3]);
  16. return 0;
  17. }