net/bnxt: add conditional processing of templates
[dpdk.git] / drivers / net / bnxt / tf_core / bitalloc.h
index 563c853..e3b389e 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2020 Broadcom
+ * Copyright(c) 2019-2021 Broadcom
  * All rights reserved.
  */
 
@@ -7,6 +7,7 @@
 #define _BITALLOC_H_
 
 #include <stdint.h>
+#include <stdbool.h>
 
 /* Bitalloc works on uint32_t as its word size */
 typedef uint32_t bitalloc_word_t;
@@ -64,7 +65,7 @@ struct bitalloc {
  * Returns 0 on success, -1 on failure.  Size is arbitrary up to
  * BITALLOC_MAX_SIZE
  */
-int ba_init(struct bitalloc *pool, int size);
+int ba_init(struct bitalloc *pool, int size, bool free);
 
 /**
  * Returns -1 on failure, or index of allocated entry
@@ -72,6 +73,11 @@ int ba_init(struct bitalloc *pool, int size);
 int ba_alloc(struct bitalloc *pool);
 int ba_alloc_index(struct bitalloc *pool, int index);
 
+/**
+ * Returns -1 on failure, or index of allocated entry
+ */
+int ba_alloc_reverse(struct bitalloc *pool);
+
 /**
  * Query a particular index in a pool to check if its in use.
  *