Cpuid.c 439 B

12345678910111213141516
  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. PAL_NUM values[4];
  6. __asm__ volatile(
  7. "mov $0, %%rax\n"
  8. "cpuid\n"
  9. : "=a"(values[0]), "=b"(values[1]), "=c"(values[2]), "=d"(values[3])::"memory");
  10. pal_printf("cpuid[0] = %08lx %08lx %08lx %08lx\n", values[0], values[1], values[2], values[3]);
  11. return 0;
  12. }