aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/cavium/bdk/libbdk-arch/bdk-numa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vendorcode/cavium/bdk/libbdk-arch/bdk-numa.c')
-rw-r--r--src/vendorcode/cavium/bdk/libbdk-arch/bdk-numa.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/vendorcode/cavium/bdk/libbdk-arch/bdk-numa.c b/src/vendorcode/cavium/bdk/libbdk-arch/bdk-numa.c
index 33d34ba669..ede3b10170 100644
--- a/src/vendorcode/cavium/bdk/libbdk-arch/bdk-numa.c
+++ b/src/vendorcode/cavium/bdk/libbdk-arch/bdk-numa.c
@@ -37,11 +37,18 @@
* ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
***********************license end**************************************/
#include <bdk.h>
-#include <stdio.h>
+#include <libbdk-hal/bdk-atomic.h>
-int __bdk_numa_master_node = -1; /* Which node is the master */
-static int __bdk_numa_exists_mask = 0; /* Bitmask of nodes that exist */
-static bdk_spinlock_t __bdk_numa_lock;
+/*
+ * FIXME(dhendrix): can't include bdk-spinlock.h, compile complains:
+ * {standard input}:40: Error: selected processor does not support `ldadda x3,x5,[x2]'
+ */
+
+//int __bdk_numa_master_node = -1; /* Which node is the master */
+int __bdk_numa_master_node = 0; /* FIXME(dhendrix): assume 0 */
+//static int __bdk_numa_exists_mask = 0; /* Bitmask of nodes that exist */
+static int __bdk_numa_exists_mask = 1; /* FIXME(dhendrix): assume 0x01 */
+//static bdk_spinlock_t __bdk_numa_lock;
/**
* Get a bitmask of the nodes that exist
@@ -60,11 +67,8 @@ uint64_t bdk_numa_get_exists_mask(void)
*/
void bdk_numa_set_exists(bdk_node_t node)
{
- bdk_spinlock_lock(&__bdk_numa_lock);
- __bdk_numa_exists_mask |= 1 << node;
- if (__bdk_numa_master_node == -1)
- __bdk_numa_master_node = node;
- bdk_spinlock_unlock(&__bdk_numa_lock);
+ /* FIXME(dhendrix): stub. */
+ return;
}
/**
@@ -76,7 +80,8 @@ void bdk_numa_set_exists(bdk_node_t node)
*/
int bdk_numa_exists(bdk_node_t node)
{
- return __bdk_numa_exists_mask & (1 << node);
+ /* FIXME(dhendrix): stub */
+ return node == 0;
}
/**
@@ -86,6 +91,7 @@ int bdk_numa_exists(bdk_node_t node)
*/
extern int bdk_numa_is_only_one()
{
- return __bdk_numa_exists_mask == 1;
+ /* FIXME(dhendrix): stub */
+ return 1;
}