xref: /kernel/linux/linux-5.10/lib/memregion.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/lib/
18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/* identifiers for device / performance-differentiated memory regions */
38c2ecf20Sopenharmony_ci#include <linux/idr.h>
48c2ecf20Sopenharmony_ci#include <linux/types.h>
58c2ecf20Sopenharmony_ci#include <linux/memregion.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cistatic DEFINE_IDA(memregion_ids);
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciint memregion_alloc(gfp_t gfp)
108c2ecf20Sopenharmony_ci{
118c2ecf20Sopenharmony_ci	return ida_alloc(&memregion_ids, gfp);
128c2ecf20Sopenharmony_ci}
138c2ecf20Sopenharmony_ciEXPORT_SYMBOL(memregion_alloc);
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_civoid memregion_free(int id)
168c2ecf20Sopenharmony_ci{
178c2ecf20Sopenharmony_ci	ida_free(&memregion_ids, id);
188c2ecf20Sopenharmony_ci}
198c2ecf20Sopenharmony_ciEXPORT_SYMBOL(memregion_free);
20

Indexes created Thu Nov 07 10:32:03 CST 2024