Main Page | Directories | File List | Globals

cpuid.c File Reference

#include <agnix/agnix.h>

Include dependency graph for cpuid.c:

Go to the source code of this file.

Functions

void cpuid (u32 level, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
u32 cpuid_reg (u32 level, int reg_nr)


Function Documentation

void cpuid u32  level,
u32 eax,
u32 ebx,
u32 ecx,
u32 edx
 

Definition at line 16 of file cpuid.c.

Referenced by cpu_get_brand_string(), cpu_get_cache_size(), cpu_get_serial_number(), cpu_get_signature(), and cpu_get_vendor_id().

00017 {
00018     asm("cpuid"
00019         :"=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
00020         :"0"(level));
00021 }

u32 cpuid_reg u32  level,
int  reg_nr
 

Definition at line 23 of file cpuid.c.

References eax, ebx, ecx, and edx.

00024 {
00025     u32 eax, ebx, ecx, edx;
00026 
00027     asm("cpuid"
00028         :"=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
00029         :"0"(level));
00030     
00031     switch(reg_nr) {
00032         case 0: return eax;
00033         case 1: return ebx;
00034         case 2: return ecx;
00035         case 3: return edx;
00036     }
00037 
00038     return 0;
00039 }

Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix