1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Copyright(c) 2022 Intel Corporation. All rights reserved. */
3 #include <linux/atomic.h>
4 #include <linux/export.h>
7 static atomic_t mem_active
;
9 bool cxl_mem_active(void)
11 return atomic_read(&mem_active
) != 0;
14 void cxl_mem_active_inc(void)
16 atomic_inc(&mem_active
);
18 EXPORT_SYMBOL_NS_GPL(cxl_mem_active_inc
, "CXL");
20 void cxl_mem_active_dec(void)
22 atomic_dec(&mem_active
);
24 EXPORT_SYMBOL_NS_GPL(cxl_mem_active_dec
, "CXL");