-
-static inline void
-BV (clib_bihash_update_lru) (BVT (clib_bihash_bucket) * b, u8 slot)
-{
-#if BIHASH_KVP_CACHE_SIZE > 1
- u16 value, tmp, mask;
- u8 found_lru_pos;
- u16 save_hi;
-
- ASSERT (slot < BIHASH_KVP_CACHE_SIZE);
-
- /* First, find the slot in cache_lru */
- mask = slot;
- if (BIHASH_KVP_CACHE_SIZE > 1)
- mask |= slot << 3;
- if (BIHASH_KVP_CACHE_SIZE > 2)
- mask |= slot << 6;
- if (BIHASH_KVP_CACHE_SIZE > 3)
- mask |= slot << 9;
- if (BIHASH_KVP_CACHE_SIZE > 4)
- mask |= slot << 12;
-
- value = b->cache_lru;
- tmp = value ^ mask;
-
- /* Already the most-recently used? */
- if ((tmp & 7) == 0)
- return;
-
- found_lru_pos = ((tmp & (7 << 3)) == 0) ? 1 : 0;
- if (BIHASH_KVP_CACHE_SIZE > 2)
- found_lru_pos = ((tmp & (7 << 6)) == 0) ? 2 : found_lru_pos;
- if (BIHASH_KVP_CACHE_SIZE > 3)
- found_lru_pos = ((tmp & (7 << 9)) == 0) ? 3 : found_lru_pos;
- if (BIHASH_KVP_CACHE_SIZE > 4)
- found_lru_pos = ((tmp & (7 << 12)) == 0) ? 4 : found_lru_pos;
-
- ASSERT (found_lru_pos);
-
- /* create a mask to kill bits in or above slot */
- mask = 0xFFFF << found_lru_pos;
- mask <<= found_lru_pos;
- mask <<= found_lru_pos;
- mask ^= 0xFFFF;
- tmp = value & mask;
-
- /* Save bits above slot */
- mask ^= 0xFFFF;
- mask <<= 3;
- save_hi = value & mask;
-
- value = save_hi | (tmp << 3) | slot;
-
- b->cache_lru = value;
+#if BIHASH_32_64_SVM
+#undef alloc_arena_next
+#undef alloc_arena_size
+#undef alloc_arena
+#undef CLIB_BIHASH_READY_MAGIC
+#define alloc_arena_next(h) (((h)->sh)->alloc_arena_next)
+#define alloc_arena_size(h) (((h)->sh)->alloc_arena_size)
+#define alloc_arena(h) ((h)->alloc_arena)
+#define CLIB_BIHASH_READY_MAGIC 0xFEEDFACE
+#else
+#undef alloc_arena_next
+#undef alloc_arena_size
+#undef alloc_arena
+#undef CLIB_BIHASH_READY_MAGIC
+#define alloc_arena_next(h) ((h)->sh.alloc_arena_next)
+#define alloc_arena_size(h) ((h)->sh.alloc_arena_size)
+#define alloc_arena(h) ((h)->alloc_arena)
+#define CLIB_BIHASH_READY_MAGIC 0