tee_private.h 942 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015-2016, Linaro Limited
  4. */
  5. #ifndef TEE_PRIVATE_H
  6. #define TEE_PRIVATE_H
  7. #include <linux/cdev.h>
  8. #include <linux/completion.h>
  9. #include <linux/device.h>
  10. #include <linux/dma-buf.h>
  11. #include <linux/kref.h>
  12. #include <linux/mutex.h>
  13. #include <linux/types.h>
  14. /* extra references appended to shm object for registered shared memory */
  15. struct tee_shm_dmabuf_ref {
  16. struct tee_shm shm;
  17. size_t offset;
  18. struct dma_buf *dmabuf;
  19. struct tee_shm *parent_shm;
  20. };
  21. int tee_shm_get_fd(struct tee_shm *shm);
  22. struct tee_shm *tee_shm_alloc_user_buf(struct tee_context *ctx, size_t size);
  23. struct tee_shm *tee_shm_register_user_buf(struct tee_context *ctx,
  24. unsigned long addr, size_t length);
  25. int tee_heap_update_from_dma_buf(struct tee_device *teedev,
  26. struct dma_buf *dmabuf, size_t *offset,
  27. struct tee_shm *shm,
  28. struct tee_shm **parent_shm);
  29. #endif /*TEE_PRIVATE_H*/