static void __devinit mlx4_enable_msi_x(struct mlx4_dev *dev)
{
- int i, n_cpus;
- u64 cpus;
-
- /* calculate the number of processors */
- cpus = (u64)KeQueryActiveProcessors();
- for (i=0,n_cpus=0; i<(sizeof(KAFFINITY)<<3); i++) {
- if ((1I64<<i) & cpus)
- n_cpus++;
- }
+ int n_cpus = num_possible_cpus();
/* decide on the mode */
if (dev->pdev->n_msi_vectors_alloc >= (n_cpus+2))
dev->flags |= MLX4_FLAG_MSI_X;
MLX4_PRINT(TRACE_LEVEL_WARNING ,MLX4_DBG_LOW ,
- ("Interrupt mode '%s', n_vectors %d, n_cpus %d, Affinity %#I64x\n",
+ ("Interrupt mode '%s', n_vectors %d, n_cpus %d\n",
(dev->flags & MLX4_FLAG_MSI_X) ? "MSI-X" : "Legacy",
- dev->pdev->n_msi_vectors_alloc, n_cpus, cpus));
+ dev->pdev->n_msi_vectors_alloc, n_cpus));
}
// various
#define __always_inline inline
-#define num_possible_cpus KeQueryMaximumProcessorCount
+
+#if (WINVER < _WIN32_WINNT_WIN6)
+#define num_possible_cpus() KeNumberProcessors
+#else
+#define num_possible_cpus() KeQueryMaximumProcessorCount()
+#endif
+
////////////////////////////////////////////////////////
//