#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
-
+#include <emmintrin.h>
/*********** Macros to eliminate unused variable warnings ********/
* power-of-two value.
*/
#define RTE_ALIGN_FLOOR(val, align) \
- (typeof(val))(val & (~((typeof(val))(align - 1))))
+ (typeof(val))((val) & (~((typeof(val))((align) - 1))))
/**
* Macro to align a pointer to a given power-of-two. The resultant
* must be a power-of-two value.
*/
#define RTE_PTR_ALIGN_CEIL(ptr, align) \
- RTE_PTR_ALIGN_FLOOR(RTE_PTR_ADD(ptr, align - 1), align)
+ RTE_PTR_ALIGN_FLOOR(RTE_PTR_ADD(ptr, (align) - 1), align)
/**
* Macro to align a value to a given power-of-two. The resultant value
* value.
*/
#define RTE_ALIGN_CEIL(val, align) \
- RTE_ALIGN_FLOOR((val + ((typeof(val)) align - 1)), align)
+ RTE_ALIGN_FLOOR(((val) + ((typeof(val)) (align) - 1)), align)
/**
* Macro to align a pointer to a given power-of-two. The resultant
static inline void
rte_pause (void)
{
- asm volatile ("pause");
+ _mm_pause();
}
/**
* Searches the input parameter for the least significant set bit
* (starting from zero).
* If a least significant 1 bit is found, its bit index is returned.
- * If the content of the input paramer is zero, then the content of the return
+ * If the content of the input parameter is zero, then the content of the return
* value is undefined.
* @param v
* input parameter, should not be zero.