diff options
| author | Yang Liu <numbksco@gmail.com> | 2025-10-22 01:15:18 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-22 01:15:18 +0800 |
| commit | fe0e3b7a9fb6a3dd0a7b4f60b4b5c2c9d83bb796 (patch) | |
| tree | f5f1438f654661352dce169dbb5d4cd879585bc2 /src/os/hostext_linux.c | |
| parent | e3cd3e8347086b9a2a3cc370088bba0ace0e740a (diff) | |
| download | box64-fe0e3b7a9fb6a3dd0a7b4f60b4b5c2c9d83bb796.tar.gz box64-fe0e3b7a9fb6a3dd0a7b4f60b4b5c2c9d83bb796.zip | |
[LA64] Fixed LBT signal handling, also refined la64noext support (#3080)
Diffstat (limited to 'src/os/hostext_linux.c')
| -rw-r--r-- | src/os/hostext_linux.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/os/hostext_linux.c b/src/os/hostext_linux.c index c202a33f..531f7b85 100644 --- a/src/os/hostext_linux.c +++ b/src/os/hostext_linux.c @@ -185,7 +185,7 @@ int DetectHostCpuFeatures(void) #endif #elif defined(LA64) char* p = GetEnv("BOX64_DYNAREC_LA64NOEXT"); - if(p == NULL || p[0] == '0') { + if (p == NULL || p[0] != '1') { uint32_t cpucfg2 = 0, idx = 2; asm volatile("cpucfg %0, %1" : "=r"(cpucfg2) : "r"(idx)); if (((cpucfg2 >> 6) & 0b11) != 3) return 0; // LSX/LASX must present @@ -195,6 +195,17 @@ int DetectHostCpuFeatures(void) cpuext.lam_bh = (cpucfg2 >> 27) & 0b1; cpuext.lamcas = (cpucfg2 >> 28) & 0b1; cpuext.scq = (cpucfg2 >> 30) & 0b1; + if (p) { + p = strtok(p, ","); + while (p) { + if (!strcasecmp(p, "lbt")) cpuext.lbt = 0; + if (!strcasecmp(p, "frecipe")) cpuext.frecipe = 0; + if (!strcasecmp(p, "lam_bh")) cpuext.lam_bh = 0; + if (!strcasecmp(p, "lamcas")) cpuext.lamcas = 0; + if (!strcasecmp(p, "scq")) cpuext.scq = 0; + p = strtok(NULL, ","); + } + } } #elif defined(RV64) // private env. variable for the developer ;) |