|
|
@@ -201,6 +201,7 @@ void get_cpuconfig(void){ |
|
|
|
printf("#define DTB_SIZE 4096\n"); |
|
|
|
printf("#define L2_ASSOCIATIVE 8\n"); |
|
|
|
} |
|
|
|
if (!get_feature(msa)) printf("#define NO_MSA\n"); |
|
|
|
} |
|
|
|
|
|
|
|
void get_libname(void){ |
|
|
@@ -218,3 +219,38 @@ void get_libname(void){ |
|
|
|
printf("mips64\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int get_feature(char *search) |
|
|
|
{ |
|
|
|
|
|
|
|
#ifdef __linux |
|
|
|
FILE *infile; |
|
|
|
char buffer[2048], *p,*t; |
|
|
|
p = (char *) NULL ; |
|
|
|
|
|
|
|
infile = fopen("/proc/cpuinfo", "r"); |
|
|
|
|
|
|
|
while (fgets(buffer, sizeof(buffer), infile)) |
|
|
|
{ |
|
|
|
|
|
|
|
if (!strncmp("Features", buffer, 8)) |
|
|
|
{ |
|
|
|
p = strchr(buffer, ':') + 2; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
fclose(infile); |
|
|
|
|
|
|
|
if( p == NULL ) return 0; |
|
|
|
|
|
|
|
t = strtok(p," "); |
|
|
|
while( t = strtok(NULL," ")) |
|
|
|
{ |
|
|
|
if (!strcmp(t, search)) { return(1); } |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
return(0); |
|
|
|
} |
|
|
|
|