2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

cpu: Make cpu routines being per-acrh

They are really depends on CPU we're running on.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov
2013-02-18 17:54:49 +04:00
committed by Pavel Emelyanov
parent f50f7d01ec
commit fcb9a9bfb1
9 changed files with 64 additions and 28 deletions

View File

@@ -35,7 +35,7 @@ static char *buf = __buf.buf;
#define BUF_SIZE sizeof(__buf.buf)
int parse_cpuinfo_features(void)
int parse_cpuinfo_features(int (*handler)(char *tok))
{
FILE *cpuinfo;
@@ -53,12 +53,8 @@ int parse_cpuinfo_features(void)
for (tok = strtok(buf, " \t\n"); tok;
tok = strtok(NULL, " \t\n")) {
if (!strcmp(tok, x86_cap_flags[X86_FEATURE_FXSR]))
cpu_set_feature(X86_FEATURE_FXSR);
else if (!strcmp(tok, x86_cap_flags[X86_FEATURE_XSAVE]))
cpu_set_feature(X86_FEATURE_XSAVE);
else if (!strcmp(tok, x86_cap_flags[X86_FEATURE_FPU]))
cpu_set_feature(X86_FEATURE_FPU);
if (handler(tok) < 0)
break;
}
}