blob: be5cfa5a3b570e31dc8cdec19097f1ea6609f689 [file] [log] [blame]
Dan Williams33dd7072019-11-06 17:43:31 -08001// SPDX-License-Identifier: GPL-2.0-only
2/* identifiers for device / performance-differentiated memory regions */
3#include <linux/idr.h>
4#include <linux/types.h>
Jason Yanffa550c2020-09-25 21:19:21 -07005#include <linux/memregion.h>
Dan Williams33dd7072019-11-06 17:43:31 -08006
7static DEFINE_IDA(memregion_ids);
8
9int memregion_alloc(gfp_t gfp)
10{
11 return ida_alloc(&memregion_ids, gfp);
12}
13EXPORT_SYMBOL(memregion_alloc);
14
15void memregion_free(int id)
16{
17 ida_free(&memregion_ids, id);
18}
19EXPORT_SYMBOL(memregion_free);