* Checks if a particular flag is available on current machine. */
| 135 | * Checks if a particular flag is available on current machine. |
| 136 | */ |
| 137 | int |
| 138 | rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature) |
| 139 | { |
| 140 | const struct feature_entry *feat; |
| 141 | hwcap_registers_t regs = {0}; |
| 142 | |
| 143 | if ((unsigned int)feature >= RTE_DIM(rte_cpu_feature_table)) |
| 144 | return -ENOENT; |
| 145 | |
| 146 | feat = &rte_cpu_feature_table[feature]; |
| 147 | if (feat->reg == REG_NONE) |
| 148 | return -EFAULT; |
| 149 | |
| 150 | rte_cpu_get_features(regs); |
| 151 | return (regs[feat->reg] >> feat->bit) & 1; |
| 152 | } |
| 153 | |
| 154 | const char * |
| 155 | rte_cpu_get_flag_name(enum rte_cpu_flag_t feature) |
nothing calls this directly
no test coverage detected