* Checks if a particular flag is available on current machine. */
| 86 | * Checks if a particular flag is available on current machine. |
| 87 | */ |
| 88 | int |
| 89 | rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature) |
| 90 | { |
| 91 | const struct feature_entry *feat; |
| 92 | hwcap_registers_t regs = {0}; |
| 93 | |
| 94 | if ((unsigned int)feature >= RTE_DIM(rte_cpu_feature_table)) |
| 95 | return -ENOENT; |
| 96 | |
| 97 | feat = &rte_cpu_feature_table[feature]; |
| 98 | if (feat->reg == REG_NONE) |
| 99 | return -EFAULT; |
| 100 | |
| 101 | rte_cpu_get_features(regs); |
| 102 | return (regs[feat->reg] >> feat->bit) & 1; |
| 103 | } |
| 104 | |
| 105 | const char * |
| 106 | rte_cpu_get_flag_name(enum rte_cpu_flag_t feature) |
no test coverage detected