From 191caf46ac962e6fb93bb32ce449b6154256b034 Mon Sep 17 00:00:00 2001 From: Harish Kasiviswanathan Date: Sun, 25 Feb 2024 17:37:56 -0500 Subject: [PATCH] libhsakmt: Move global zfb_support to globals.c zfb_support needs to accessed from multiple places, so move to globals.c file Change-Id: I40b487c26a13e7cc6fc01b671d6166e7114e02d2 Signed-off-by: Harish Kasiviswanathan --- src/globals.c | 2 ++ src/libhsakmt.h | 1 + src/memory.c | 2 -- src/openclose.c | 3 --- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/globals.c b/src/globals.c index c2fbd4f02e..771eb6758b 100644 --- a/src/globals.c +++ b/src/globals.c @@ -37,3 +37,5 @@ int PAGE_SHIFT; /* whether to check all dGPUs in the topology support SVM API */ bool is_svm_api_supported; +/* zfb is mainly used during emulation */ +int zfb_support; diff --git a/src/libhsakmt.h b/src/libhsakmt.h index 656800dae6..62f65d01a4 100644 --- a/src/libhsakmt.h +++ b/src/libhsakmt.h @@ -38,6 +38,7 @@ extern bool hsakmt_forked; extern pthread_mutex_t hsakmt_mutex; extern bool is_dgpu; extern bool is_svm_api_supported; +extern int zfb_support; extern HsaVersionInfo kfd_version_info; diff --git a/src/memory.c b/src/memory.c index b95fb1b303..5eeaa9fecc 100644 --- a/src/memory.c +++ b/src/memory.c @@ -34,8 +34,6 @@ #include #include "fmm.h" -extern int zfb_support; - HSAKMT_STATUS HSAKMTAPI hsaKmtSetMemoryPolicy(HSAuint32 Node, HSAuint32 DefaultPolicy, HSAuint32 AlternatePolicy, diff --git a/src/openclose.c b/src/openclose.c index bc513c6a03..0e5c10c065 100644 --- a/src/openclose.c +++ b/src/openclose.c @@ -49,9 +49,6 @@ static pid_t parent_pid = -1; int hsakmt_debug_level; bool hsakmt_forked; -/* zfb is mainly used during emulation */ -int zfb_support; - /* is_forked_child detects when the process has forked since the last * time this function was called. We cannot rely on pthread_atfork * because the process can fork without calling the fork function in