Subversion Repositories HelenOS-historic

Rev

Rev 1 | Rev 408 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 348
Line 37... Line 37...
37
    __u32 cpuid_ecx;
37
    __u32 cpuid_ecx;
38
    __u32 cpuid_edx;
38
    __u32 cpuid_edx;
39
} __attribute__ ((packed));
39
} __attribute__ ((packed));
40
 
40
 
41
extern int has_cpuid(void);
41
extern int has_cpuid(void);
42
extern void cpuid(__u32 cmd, cpu_info_t *info);
-
 
43
 
42
 
-
 
43
static inline void cpuid(__u32 cmd, struct cpu_info *info)
-
 
44
{
-
 
45
        __asm__ volatile (
-
 
46
                "movl %4, %%eax\n"
44
extern __u64 rdtsc(void);
47
                "cpuid\n"
-
 
48
                "movl %%eax,%0\n"
-
 
49
                "movl %%ebx,%1\n"
-
 
50
                "movl %%ecx,%2\n"
-
 
51
                "movl %%edx,%3\n"
-
 
52
                : "=m" (info->cpuid_eax), "=m" (info->cpuid_ebx), "=m" (info->cpuid_ecx), "=m" (info->cpuid_edx)
-
 
53
                : "m" (cmd)
-
 
54
                : "eax", "ebx", "ecx", "edx"
-
 
55
        );
-
 
56
}
45
 
57
 
46
#endif
58
#endif