contain: call prctl(PR_SET_TSC) under x86/x86-64 only
This commit is contained in:
parent
8e4cc83eb2
commit
02458084fe
@ -121,10 +121,16 @@ static bool containCPU(nsjconf_t* nsjconf) {
|
|||||||
|
|
||||||
static bool containTSC(nsjconf_t* nsjconf) {
|
static bool containTSC(nsjconf_t* nsjconf) {
|
||||||
if (nsjconf->disable_tsc) {
|
if (nsjconf->disable_tsc) {
|
||||||
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
if (prctl(PR_SET_TSC, PR_TSC_SIGSEGV, 0, 0, 0) == -1) {
|
if (prctl(PR_SET_TSC, PR_TSC_SIGSEGV, 0, 0, 0) == -1) {
|
||||||
PLOG_E("prctl(PR_SET_TSC, PR_TSC_SIGSEGV, 0, 0, 0)");
|
PLOG_E("prctl(PR_SET_TSC, PR_TSC_SIGSEGV)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#else /* defined(__x86_64__) || defined(__i386__) */
|
||||||
|
LOG_W(
|
||||||
|
"prctl(PR_SET_TSC, PR_TSC_SIGSEGV) requested, but it's supported under "
|
||||||
|
"x86/x86-64 CPU architectures only. Ignoring it!");
|
||||||
|
#endif /* defined(__x86_64__) || defined(__i386__) */
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user