MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_cpu_get_flag_enabled

Function rte_cpu_get_flag_enabled

dpdk/lib/eal/loongarch/rte_cpuflags.c:64–79  ·  view source on GitHub ↗

* Checks if a particular flag is available on current machine. */

Source from the content-addressed store, hash-verified

62 * Checks if a particular flag is available on current machine.
63 */
64int
65rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)
66{
67 const struct feature_entry *feat;
68 hwcap_registers_t regs = {0};
69
70 if ((unsigned int)feature >= RTE_DIM(rte_cpu_feature_table))
71 return -ENOENT;
72
73 feat = &rte_cpu_feature_table[feature];
74 if (feat->reg == REG_NONE)
75 return -EFAULT;
76
77 rte_cpu_get_features(regs);
78 return (regs[feat->reg] >> feat->bit) & 1;
79}
80
81const char *
82rte_cpu_get_flag_name(enum rte_cpu_flag_t feature)

Callers

nothing calls this directly

Calls 1

rte_cpu_get_featuresFunction · 0.70

Tested by

no test coverage detected