| 914 | } |
| 915 | |
| 916 | static void |
| 917 | est_identify(driver_t *driver, device_t parent) |
| 918 | { |
| 919 | device_t child; |
| 920 | |
| 921 | /* |
| 922 | * Defer to hwpstate if it is present. This priority logic |
| 923 | * should be replaced with normal newbus probing in the |
| 924 | * future. |
| 925 | */ |
| 926 | intel_hwpstate_identify(NULL, parent); |
| 927 | if (device_find_child(parent, "hwpstate_intel", -1) != NULL) |
| 928 | return; |
| 929 | |
| 930 | /* Make sure we're not being doubly invoked. */ |
| 931 | if (device_find_child(parent, "est", -1) != NULL) |
| 932 | return; |
| 933 | |
| 934 | /* Check that CPUID is supported and the vendor is Intel.*/ |
| 935 | if (cpu_high == 0 || (cpu_vendor_id != CPU_VENDOR_INTEL && |
| 936 | cpu_vendor_id != CPU_VENDOR_CENTAUR)) |
| 937 | return; |
| 938 | |
| 939 | /* |
| 940 | * Check if the CPU supports EST. |
| 941 | */ |
| 942 | if (!(cpu_feature2 & CPUID2_EST)) |
| 943 | return; |
| 944 | |
| 945 | /* |
| 946 | * We add a child for each CPU since settings must be performed |
| 947 | * on each CPU in the SMP case. |
| 948 | */ |
| 949 | child = BUS_ADD_CHILD(parent, 10, "est", -1); |
| 950 | if (child == NULL) |
| 951 | device_printf(parent, "add est child failed\n"); |
| 952 | } |
| 953 | |
| 954 | static int |
| 955 | est_probe(device_t dev) |
nothing calls this directly
no test coverage detected