suspend.c 492 B

123456789101112131415161718192021222324
  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>
  5. #include "cxlmem.h"
  6. static atomic_t mem_active;
  7. bool cxl_mem_active(void)
  8. {
  9. return atomic_read(&mem_active) != 0;
  10. }
  11. void cxl_mem_active_inc(void)
  12. {
  13. atomic_inc(&mem_active);
  14. }
  15. EXPORT_SYMBOL_NS_GPL(cxl_mem_active_inc, CXL);
  16. void cxl_mem_active_dec(void)
  17. {
  18. atomic_dec(&mem_active);
  19. }
  20. EXPORT_SYMBOL_NS_GPL(cxl_mem_active_dec, CXL);