I need to find the architecture type of a CPU. I do not have access to /proc/cpuinfo, as the machine is running syslinux. I know there is a way to do it with inline ASM, how
How many bugs can you fit in so few lines ;)
Try
static int is64bit(void) { int iedx = 0; asm volatile ("movl $0x80000001, %%eax\n" "cpuid\n" : "=d"(iedx) : /* No Inputs */ : "eax", "ebx", "ecx" ); if(iedx & (1 << 29)) { return 1; } return 0; }