|
|
|
@@ -238,7 +238,7 @@ static int detectisa(const void* some_inst) |
|
|
|
static int g_sigill_caught = 0; |
|
|
|
static sigjmp_buf g_jmpbuf; |
|
|
|
|
|
|
|
static void catch_sigill(int signo, siginfo_t* si, void* data) |
|
|
|
static void catch_sigill(int /*signo*/, siginfo_t* /*si*/, void* /*data*/) |
|
|
|
{ |
|
|
|
g_sigill_caught = 1; |
|
|
|
siglongjmp(g_jmpbuf, -1); |
|
|
|
@@ -248,10 +248,11 @@ static int detectisa(void (*some_inst)()) |
|
|
|
{ |
|
|
|
g_sigill_caught = 0; |
|
|
|
|
|
|
|
struct sigaction sa = {0}; |
|
|
|
struct sigaction sa; |
|
|
|
struct sigaction old_sa; |
|
|
|
sa.sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO; |
|
|
|
memset(&sa, 0, sizeof(sa)); |
|
|
|
sa.sa_sigaction = catch_sigill; |
|
|
|
sa.sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO; |
|
|
|
sigaction(SIGILL, &sa, &old_sa); |
|
|
|
|
|
|
|
if (sigsetjmp(g_jmpbuf, 1) == 0) |
|
|
|
@@ -2043,12 +2044,12 @@ CpuSet::CpuSet() |
|
|
|
|
|
|
|
void CpuSet::enable(int cpu) |
|
|
|
{ |
|
|
|
mask |= (1 << cpu); |
|
|
|
mask |= ((ULONG_PTR)1 << cpu); |
|
|
|
} |
|
|
|
|
|
|
|
void CpuSet::disable(int cpu) |
|
|
|
{ |
|
|
|
mask &= ~(1 << cpu); |
|
|
|
mask &= ~((ULONG_PTR)1 << cpu); |
|
|
|
} |
|
|
|
|
|
|
|
void CpuSet::disable_all() |
|
|
|
@@ -2058,7 +2059,7 @@ void CpuSet::disable_all() |
|
|
|
|
|
|
|
bool CpuSet::is_enabled(int cpu) const |
|
|
|
{ |
|
|
|
return mask & (1 << cpu); |
|
|
|
return mask & ((ULONG_PTR)1 << cpu); |
|
|
|
} |
|
|
|
|
|
|
|
int CpuSet::num_enabled() const |
|
|
|
@@ -2117,12 +2118,12 @@ CpuSet::CpuSet() |
|
|
|
|
|
|
|
void CpuSet::enable(int cpu) |
|
|
|
{ |
|
|
|
policy |= (1 << cpu); |
|
|
|
policy |= ((unsigned int)1 << cpu); |
|
|
|
} |
|
|
|
|
|
|
|
void CpuSet::disable(int cpu) |
|
|
|
{ |
|
|
|
policy &= ~(1 << cpu); |
|
|
|
policy &= ~((unsigned int)1 << cpu); |
|
|
|
} |
|
|
|
|
|
|
|
void CpuSet::disable_all() |
|
|
|
@@ -2132,7 +2133,7 @@ void CpuSet::disable_all() |
|
|
|
|
|
|
|
bool CpuSet::is_enabled(int cpu) const |
|
|
|
{ |
|
|
|
return policy & (1 << cpu); |
|
|
|
return policy & ((unsigned int)1 << cpu); |
|
|
|
} |
|
|
|
|
|
|
|
int CpuSet::num_enabled() const |
|
|
|
|