コード例 #1
0
ファイル: proc.c プロジェクト: zerowindow/dynamorio
static void
get_cache_sizes_amd(uint max_ext_val)
{
    uint cpuid_res_local[4]; /* eax, ebx, ecx, and edx registers (in that order) */

    if (max_ext_val >= 0x80000005) {
        our_cpuid((int*)cpuid_res_local, 0x80000005, 0);
        set_cache_size((cpuid_res_local[2]/*ecx*/ >> 24), &cpu_info.L1_icache_size);
        set_cache_size((cpuid_res_local[3]/*edx*/ >> 24), &cpu_info.L1_dcache_size);
    }
コード例 #2
0
ファイル: proc.c プロジェクト: j616/DynamoRIO-for-ARM
static void
get_cache_sizes_amd(uint max_ext_val)
{
	// COMPLETEDD #253 get_cache_sizes_amd
    uint cpuid_res_local[4]; /* eax, ebx, ecx, and edx registers (in that order) */

    if (max_ext_val >= 0x80000005) {
#ifdef LINUX
        our_cpuid((int*)cpuid_res_local, 0x80000005);
#else
        __cpuid(cpuid_res_local, 0x80000005);
#endif
        set_cache_size((cpuid_res_local[2]/*ecx*/ >> 24), &L1_icache_size);
        set_cache_size((cpuid_res_local[3]/*edx*/ >> 24), &L1_dcache_size);
    }