summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary/hud/hud_nic.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-04-02 10:42:24 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-04-02 10:42:24 +0000
commita3f73acb9d2cdc62692af7ff93c51f910dff2d0d (patch)
tree303d205e8e6ed9676bdcbe006a402c23bf668f6c /lib/mesa/src/gallium/auxiliary/hud/hud_nic.c
parentf54e142455cb3c9d1662dae7e096a32a47e5409b (diff)
Merge Mesa 23.3.6
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/hud/hud_nic.c')
-rw-r--r--lib/mesa/src/gallium/auxiliary/hud/hud_nic.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/hud/hud_nic.c b/lib/mesa/src/gallium/auxiliary/hud/hud_nic.c
index b54af2add..28b000f65 100644
--- a/lib/mesa/src/gallium/auxiliary/hud/hud_nic.c
+++ b/lib/mesa/src/gallium/auxiliary/hud/hud_nic.c
@@ -35,6 +35,7 @@
#include "hud/hud_private.h"
#include "util/list.h"
#include "util/os_time.h"
+#include "util/simple_mtx.h"
#include "util/u_thread.h"
#include "util/u_memory.h"
#include "util/u_string.h"
@@ -68,7 +69,7 @@ struct nic_info
*/
static int gnic_count = 0;
static struct list_head gnic_list;
-static mtx_t gnic_mutex = _MTX_INITIALIZER_NP;
+static simple_mtx_t gnic_mutex = SIMPLE_MTX_INITIALIZER;
static struct nic_info *
find_nic_by_name(const char *n, int mode)
@@ -96,13 +97,13 @@ get_file_value(const char *fname, uint64_t *value)
return 0;
}
-static boolean
+static bool
get_nic_bytes(const char *fn, uint64_t *bytes)
{
if (get_file_value(fn, bytes) < 0)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
static void
@@ -334,9 +335,9 @@ hud_get_num_nics(bool displayhelp)
char name[64];
/* Return the number if network interfaces. */
- mtx_lock(&gnic_mutex);
+ simple_mtx_lock(&gnic_mutex);
if (gnic_count) {
- mtx_unlock(&gnic_mutex);
+ simple_mtx_unlock(&gnic_mutex);
return gnic_count;
}
@@ -346,7 +347,7 @@ hud_get_num_nics(bool displayhelp)
list_inithead(&gnic_list);
DIR *dir = opendir("/sys/class/net/");
if (!dir) {
- mtx_unlock(&gnic_mutex);
+ simple_mtx_unlock(&gnic_mutex);
return 0;
}
@@ -422,7 +423,7 @@ hud_get_num_nics(bool displayhelp)
}
- mtx_unlock(&gnic_mutex);
+ simple_mtx_unlock(&gnic_mutex);
return gnic_count;
}