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/riscv/rte_cpuflags.c:93–108  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

91 * Checks if a particular flag is available on current machine.
92 */
93int
94rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)
95{
96 const struct feature_entry *feat;
97 hwcap_registers_t regs = {0};
98
99 if ((unsigned int)feature >= RTE_DIM(rte_cpu_feature_table))
100 return -ENOENT;
101
102 feat = &rte_cpu_feature_table[feature];
103 if (feat->reg == REG_NONE)
104 return -EFAULT;
105
106 rte_cpu_get_features(regs);
107 return (regs[feat->reg] >> feat->bit) & 1;
108}
109
110const char *
111rte_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