Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Evergreen:11.4
ia32el
cpuid.c
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File cpuid.c of Package ia32el
#include <stdio.h> #include <stdlib.h> #include <string.h> static inline void cpuid (unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { asm ("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) : "0" (op), "c" (0)); } static inline unsigned int cpuid_eax (unsigned int op) { unsigned int eax; asm ("cpuid" : "=a" (eax) : "0" (op) : "bx", "cx", "dx"); return eax; } int main (void) { union { char c[32]; unsigned int u[8]; } id; char *res; unsigned int eax; cpuid (0x80000002, &id.u[0], &id.u[1], &id.u[2], &id.u[3]); cpuid (0x80000003, &id.u[4], &id.u[5], &id.u[6], &id.u[7]); if (strncmp (id.c, " Intel (R) IA-32 Execution Layer", 32) != 0) res = "0"; else res = "1"; eax = cpuid_eax (1); if (((eax >> 8) & 15) == 15 && ((eax >> 20) & 15) == 2) res = "1"; printf ("%s\n", res); exit (0); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor