2019-11-06 18:43:31 -07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
/* identifiers for device / performance-differentiated memory regions */
|
|
|
|
#include <linux/idr.h>
|
|
|
|
#include <linux/types.h>
|
2020-09-25 21:19:21 -07:00
|
|
|
#include <linux/memregion.h>
|
2019-11-06 18:43:31 -07:00
|
|
|
|
|
|
|
static DEFINE_IDA(memregion_ids);
|
|
|
|
|
|
|
|
int memregion_alloc(gfp_t gfp)
|
|
|
|
{
|
|
|
|
return ida_alloc(&memregion_ids, gfp);
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(memregion_alloc);
|
|
|
|
|
|
|
|
void memregion_free(int id)
|
|
|
|
{
|
|
|
|
ida_free(&memregion_ids, id);
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(memregion_free);
|