qcom_carveout_heap.h 949 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _QCOM_CARVEOUT_HEAP_H
  7. #define _QCOM_CARVEOUT_HEAP_H
  8. #include "qcom_dt_parser.h"
  9. #ifdef CONFIG_QCOM_DMABUF_HEAPS_CARVEOUT
  10. int qcom_secure_carveout_heap_create(struct platform_heap *heap_data);
  11. int qcom_carveout_heap_create(struct platform_heap *heap_data);
  12. int qcom_secure_carveout_heap_freeze(void);
  13. int qcom_secure_carveout_heap_restore(void);
  14. #else
  15. static inline int qcom_secure_carveout_heap_create(struct platform_heap *heap_data)
  16. {
  17. return -EINVAL;
  18. }
  19. static inline int qcom_carveout_heap_create(struct platform_heap *heap_data)
  20. {
  21. return -EINVAL;
  22. }
  23. static inline int qcom_secure_carveout_heap_freeze(void) { return 0; }
  24. static inline int qcom_secure_carveout_heap_restore(void) { return 0; }
  25. #endif
  26. #endif /* _QCOM_CARVEOUT_HEAP_H */