mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 09:58:09 +00:00
compel: fpu -- Add compel_test_fpu_cap helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
c926e2a718
commit
888514aee0
@ -16,6 +16,7 @@ static bool rt_info_done = false;
|
|||||||
void compel_set_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
void compel_set_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
||||||
void compel_clear_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
void compel_clear_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
||||||
int compel_test_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { return 0; }
|
int compel_test_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { return 0; }
|
||||||
|
int compel_test_fpu_cap(compel_cpuinfo_t *info, unsigned int feature) { return 0; }
|
||||||
int compel_cpuid(compel_cpuinfo_t *info) { return 0; }
|
int compel_cpuid(compel_cpuinfo_t *info) { return 0; }
|
||||||
|
|
||||||
bool compel_cpu_has_feature(unsigned int feature)
|
bool compel_cpu_has_feature(unsigned int feature)
|
||||||
|
@ -16,6 +16,7 @@ static bool rt_info_done = false;
|
|||||||
void compel_set_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
void compel_set_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
||||||
void compel_clear_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
void compel_clear_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
||||||
int compel_test_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { return 0; }
|
int compel_test_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { return 0; }
|
||||||
|
int compel_test_fpu_cap(compel_cpuinfo_t *info, unsigned int feature) { return 0; }
|
||||||
int compel_cpuid(compel_cpuinfo_t *info) { return 0; }
|
int compel_cpuid(compel_cpuinfo_t *info) { return 0; }
|
||||||
|
|
||||||
bool compel_cpu_has_feature(unsigned int feature)
|
bool compel_cpu_has_feature(unsigned int feature)
|
||||||
|
@ -17,6 +17,7 @@ static bool rt_info_done = false;
|
|||||||
|
|
||||||
void compel_set_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
void compel_set_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
||||||
void compel_clear_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
void compel_clear_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { }
|
||||||
|
int compel_test_fpu_cap(compel_cpuinfo_t *info, unsigned int feature) { return 0; }
|
||||||
int compel_test_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { return 0; }
|
int compel_test_cpu_cap(compel_cpuinfo_t *info, unsigned int feature) { return 0; }
|
||||||
|
|
||||||
int compel_cpuid(compel_cpuinfo_t *info)
|
int compel_cpuid(compel_cpuinfo_t *info)
|
||||||
|
@ -17,6 +17,7 @@ static bool rt_info_done = false;
|
|||||||
|
|
||||||
void compel_set_cpu_cap(compel_cpuinfo_t *c, unsigned int feature) { }
|
void compel_set_cpu_cap(compel_cpuinfo_t *c, unsigned int feature) { }
|
||||||
void compel_clear_cpu_cap(compel_cpuinfo_t *c, unsigned int feature) { }
|
void compel_clear_cpu_cap(compel_cpuinfo_t *c, unsigned int feature) { }
|
||||||
|
int compel_test_fpu_cap(compel_cpuinfo_t *info, unsigned int feature) { return 0; }
|
||||||
int compel_test_cpu_cap(compel_cpuinfo_t *c, unsigned int feature) { return 0; }
|
int compel_test_cpu_cap(compel_cpuinfo_t *c, unsigned int feature) { return 0; }
|
||||||
|
|
||||||
int compel_cpuid(compel_cpuinfo_t *info)
|
int compel_cpuid(compel_cpuinfo_t *info)
|
||||||
|
@ -67,6 +67,13 @@ int compel_test_cpu_cap(compel_cpuinfo_t *c, unsigned int feature)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int compel_test_fpu_cap(compel_cpuinfo_t *c, unsigned int feature)
|
||||||
|
{
|
||||||
|
if (likely(feature < XFEATURE_MAX))
|
||||||
|
return (c->xfeatures_mask & (1UL << feature));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int compel_fpuid(compel_cpuinfo_t *c)
|
static int compel_fpuid(compel_cpuinfo_t *c)
|
||||||
{
|
{
|
||||||
unsigned int last_good_offset;
|
unsigned int last_good_offset;
|
||||||
|
@ -63,6 +63,7 @@ enum xfeature {
|
|||||||
#define XFEATURE_MASK_PT (1 << XFEATURE_PT)
|
#define XFEATURE_MASK_PT (1 << XFEATURE_PT)
|
||||||
#define XFEATURE_MASK_PKRU (1 << XFEATURE_PKRU)
|
#define XFEATURE_MASK_PKRU (1 << XFEATURE_PKRU)
|
||||||
#define XFEATURE_MASK_HDC (1 << XFEATURE_HDC)
|
#define XFEATURE_MASK_HDC (1 << XFEATURE_HDC)
|
||||||
|
#define XFEATURE_MASK_MAX (1 << XFEATURE_MAX)
|
||||||
|
|
||||||
#define XFEATURE_MASK_FPSSE (XFEATURE_MASK_FP | XFEATURE_MASK_SSE)
|
#define XFEATURE_MASK_FPSSE (XFEATURE_MASK_FP | XFEATURE_MASK_SSE)
|
||||||
#define XFEATURE_MASK_AVX512 (XFEATURE_MASK_OPMASK | XFEATURE_MASK_ZMM_Hi256 | XFEATURE_MASK_Hi16_ZMM)
|
#define XFEATURE_MASK_AVX512 (XFEATURE_MASK_OPMASK | XFEATURE_MASK_ZMM_Hi256 | XFEATURE_MASK_Hi16_ZMM)
|
||||||
|
@ -7,5 +7,6 @@
|
|||||||
extern void compel_set_cpu_cap(compel_cpuinfo_t *info, unsigned int feature);
|
extern void compel_set_cpu_cap(compel_cpuinfo_t *info, unsigned int feature);
|
||||||
extern void compel_clear_cpu_cap(compel_cpuinfo_t *info, unsigned int feature);
|
extern void compel_clear_cpu_cap(compel_cpuinfo_t *info, unsigned int feature);
|
||||||
extern int compel_test_cpu_cap(compel_cpuinfo_t *info, unsigned int feature);
|
extern int compel_test_cpu_cap(compel_cpuinfo_t *info, unsigned int feature);
|
||||||
|
extern int compel_test_fpu_cap(compel_cpuinfo_t *c, unsigned int feature);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user