~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/firmware/qcom/qcom_tzmem.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright (C) 2023-2024 Linaro Ltd.
  4  */
  5 
  6 #ifndef __QCOM_TZMEM_H
  7 #define __QCOM_TZMEM_H
  8 
  9 #include <linux/cleanup.h>
 10 #include <linux/gfp.h>
 11 #include <linux/types.h>
 12 
 13 struct device;
 14 struct qcom_tzmem_pool;
 15 
 16 /**
 17  * enum qcom_tzmem_policy - Policy for pool growth.
 18  */
 19 enum qcom_tzmem_policy {
 20         /**< Static pool, never grow above initial size. */
 21         QCOM_TZMEM_POLICY_STATIC = 1,
 22         /**< When out of memory, add increment * current size of memory. */
 23         QCOM_TZMEM_POLICY_MULTIPLIER,
 24         /**< When out of memory add as much as is needed until max_size. */
 25         QCOM_TZMEM_POLICY_ON_DEMAND,
 26 };
 27 
 28 /**
 29  * struct qcom_tzmem_pool_config - TZ memory pool configuration.
 30  * @initial_size: Number of bytes to allocate for the pool during its creation.
 31  * @policy: Pool size growth policy.
 32  * @increment: Used with policies that allow pool growth.
 33  * @max_size: Size above which the pool will never grow.
 34  */
 35 struct qcom_tzmem_pool_config {
 36         size_t initial_size;
 37         enum qcom_tzmem_policy policy;
 38         size_t increment;
 39         size_t max_size;
 40 };
 41 
 42 struct qcom_tzmem_pool *
 43 qcom_tzmem_pool_new(const struct qcom_tzmem_pool_config *config);
 44 void qcom_tzmem_pool_free(struct qcom_tzmem_pool *pool);
 45 struct qcom_tzmem_pool *
 46 devm_qcom_tzmem_pool_new(struct device *dev,
 47                          const struct qcom_tzmem_pool_config *config);
 48 
 49 void *qcom_tzmem_alloc(struct qcom_tzmem_pool *pool, size_t size, gfp_t gfp);
 50 void qcom_tzmem_free(void *ptr);
 51 
 52 DEFINE_FREE(qcom_tzmem, void *, if (_T) qcom_tzmem_free(_T))
 53 
 54 phys_addr_t qcom_tzmem_to_phys(void *ptr);
 55 
 56 #endif /* __QCOM_TZMEM */
 57 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php