* Checks if a particular flag is available on current machine. */
| 62 | * Checks if a particular flag is available on current machine. |
| 63 | */ |
| 64 | int |
| 65 | rte_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 | |
| 81 | const char * |
| 82 | rte_cpu_get_flag_name(enum rte_cpu_flag_t feature) |
nothing calls this directly
no test coverage detected