CPUID: Difference between revisions

s/dword/uint32_t/g
[unchecked revision][unchecked revision]
m (Added a note)
(s/dword/uint32_t/g)
Line 143:
 
<source lang="c">
/* TODO: You should use the <cpuid.h> header that comes with GCC instead. */
 
enum cpuid_requests {
CPUID_GETVENDORSTRING,
Line 160 ⟶ 162:
* will be modified by the operation, so we need to tell the compiler about it.
*/
static inline void cpuid(int code, dworduint32_t *a, dworduint32_t *d) {
asm volatile("cpuid":"=a"(*a),"=d"(*d):"a"(code):"ecx","ebx");
}
Line 166 ⟶ 168:
/** issue a complete request, storing general registers output as a string
*/
static inline int cpuid_string(int code, dworduint32_t where[4]) {
asm volatile("cpuid":"=a"(*where),"=b"(*(where+1)),
"=c"(*(where+2)),"=d"(*(where+3)):"a"(code));
Anonymous user