Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /* Copyright(c) 2022 Intel Corporation. All rights reserved. */
0003 #include <linux/atomic.h>
0004 #include <linux/export.h>
0005 #include "cxlmem.h"
0006 
0007 static atomic_t mem_active;
0008 
0009 bool cxl_mem_active(void)
0010 {
0011     return atomic_read(&mem_active) != 0;
0012 }
0013 
0014 void cxl_mem_active_inc(void)
0015 {
0016     atomic_inc(&mem_active);
0017 }
0018 EXPORT_SYMBOL_NS_GPL(cxl_mem_active_inc, CXL);
0019 
0020 void cxl_mem_active_dec(void)
0021 {
0022     atomic_dec(&mem_active);
0023 }
0024 EXPORT_SYMBOL_NS_GPL(cxl_mem_active_dec, CXL);