Skip to content

Commit fa0403b

Browse files
authored
Report proper cache sizes for Qualcomm Oryon in WoA
1 parent 29fab2b commit fa0403b

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

cpuid_arm64.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ static int cpulowperf=0;
150150
static int cpumidperf=0;
151151
static int cpuhiperf=0;
152152

153+
int aliased = 0;
154+
153155
int get_feature(char *search)
154156
{
155157

@@ -418,7 +420,10 @@ int detect(void)
418420
if (errcode != ERROR_SUCCESS) wprintf(L"Error reading cpuname from registry:%x\n",errcode);
419421
//wprintf(stderr,L"%s\n",(PWSTR)valstring);
420422
RegCloseKey(reghandle);
421-
if (strstr(valstring, "Snapdragon(R) X Elite")) return CPU_NEOVERSEN1;
423+
if (strstr(valstring, "Snapdragon(R) X Elite")) {
424+
aliased = 1;
425+
return CPU_NEOVERSEN1;
426+
}
422427
if (strstr(valstring, "Ampere(R) Altra")) return CPU_NEOVERSEN1;
423428
if (strstr(valstring, "Snapdragon (TM) 8cx Gen 3")) return CPU_CORTEXX1;
424429
if (strstr(valstring, "Snapdragon Compute Platform")) return CPU_CORTEXX1;
@@ -541,6 +546,7 @@ void get_cpuconfig(void)
541546
break;
542547
case CPU_NEOVERSEN1:
543548
printf("#define %s\n", cpuname[d]);
549+
if (aliased == 0) {
544550
printf("#define L1_CODE_SIZE 65536\n");
545551
printf("#define L1_CODE_LINESIZE 64\n");
546552
printf("#define L1_CODE_ASSOCIATIVE 4\n");
@@ -552,6 +558,23 @@ void get_cpuconfig(void)
552558
printf("#define L2_ASSOCIATIVE 8\n");
553559
printf("#define DTB_DEFAULT_ENTRIES 48\n");
554560
printf("#define DTB_SIZE 4096\n");
561+
} else {
562+
printf("#define L1_CODE_SIZE 196608\n");
563+
printf("#define L1_CODE_LINESIZE 64\n");
564+
printf("#define L1_CODE_ASSOCIATIVE 6\n");
565+
printf("#define L1_DATA_SIZE 98304\n");
566+
printf("#define L1_DATA_LINESIZE 64\n");
567+
printf("#define L1_DATA_ASSOCIATIVE 6\n");
568+
printf("#define L2_SIZE 12582912\n");
569+
printf("#define L2_LINESIZE 32\n");
570+
printf("#define L2_ASSOCIATIVE 12\n");
571+
printf("#define ITB_SIZE 4096\n");
572+
printf("#define ITB_ASSOCIATIVE 8\n");
573+
printf("#define ITB_DEFAULT_ENTRIES 256\n");
574+
printf("#define DTB_DEFAULT_ENTRIES 224\n");
575+
printf("#define DTB_ASSOCIATIVE 7\n");
576+
printf("#define DTB_SIZE 4096\n");
577+
}
555578
break;
556579

557580
case CPU_NEOVERSEV1:

0 commit comments

Comments
 (0)