We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f727235 commit ef9c976Copy full SHA for ef9c976
cpuid_riscv64.c
@@ -88,18 +88,21 @@ int detect(void){
88
infile = fopen("/proc/cpuinfo", "r");
89
while (fgets(buffer, sizeof(buffer), infile)){
90
if(!strncmp(buffer, "model name", 10)){
91
- strcpy(model_buffer, buffer)
+ strcpy(model_buffer, buffer);
92
pmodel = strchr(isa_buffer, ':') + 1;
93
}
94
95
if(!strncmp(buffer, "isa", 3)){
96
- strcpy(isa_buffer, buffer)
+ strcpy(isa_buffer, buffer);
97
pisa = strchr(isa_buffer, '4') + 1;
98
99
100
101
fclose(infile);
102
103
+ if (!pmodel)
104
+ return(CPU_GENERIC);
105
+
106
if (strstr(pmodel, check_c910_str) && strchr(pisa, 'v'))
107
return CPU_C910V;
108
0 commit comments