Subversion Repositories HelenOS

Rev

Rev 2131 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2131 Rev 2315
Line 97... Line 97...
97
    return ret;
97
    return ret;
98
}
98
}
99
 
99
 
100
static inline void cpuid(uint32_t cmd, cpu_info_t *info)
100
static inline void cpuid(uint32_t cmd, cpu_info_t *info)
101
{
101
{
-
 
102
    register int eax asm("eax")=cmd;
-
 
103
    register int ebx asm("ebx");
-
 
104
    register int ecx asm("ecx");
-
 
105
    register int edx asm("edx");
102
    asm volatile (
106
    asm volatile (
103
        "movl %4, %%eax\n"
-
 
104
        "cpuid\n"
107
        "cpuid\n"
105
       
108
       
106
        "movl %%eax, %0\n"
-
 
107
        "movl %%ebx, %1\n"
-
 
108
        "movl %%ecx, %2\n"
-
 
109
        "movl %%edx, %3\n"
-
 
110
        : "=m" (info->cpuid_eax), "=m" (info->cpuid_ebx), "=m" (info->cpuid_ecx), "=m" (info->cpuid_edx)
109
        : "=r" (eax), "=r" (ebx), "=r" (ecx), "=r" (edx)
111
        : "m" (cmd)
110
        : "r" (eax)
112
        : "eax", "ebx", "ecx", "edx"
-
 
113
    );
111
    );
-
 
112
    info->cpuid_eax=eax;
-
 
113
    info->cpuid_ebx=ebx;
-
 
114
    info->cpuid_ecx=ecx;
-
 
115
    info->cpuid_edx=edx;
114
}
116
}
115
 
117
 
116
#endif
118
#endif
117
 
119
 
118
/** @}
120
/** @}