1 // SPDX-License-Identifier: GPL-2.0-only 1 // SPDX-License-Identifier: GPL-2.0-only 2 /* identifiers for device / performance-differ 2 /* identifiers for device / performance-differentiated memory regions */ 3 #include <linux/idr.h> 3 #include <linux/idr.h> 4 #include <linux/types.h> 4 #include <linux/types.h> 5 #include <linux/memregion.h> 5 #include <linux/memregion.h> 6 6 7 static DEFINE_IDA(memregion_ids); 7 static DEFINE_IDA(memregion_ids); 8 8 9 int memregion_alloc(gfp_t gfp) 9 int memregion_alloc(gfp_t gfp) 10 { 10 { 11 return ida_alloc(&memregion_ids, gfp); 11 return ida_alloc(&memregion_ids, gfp); 12 } 12 } 13 EXPORT_SYMBOL(memregion_alloc); 13 EXPORT_SYMBOL(memregion_alloc); 14 14 15 void memregion_free(int id) 15 void memregion_free(int id) 16 { 16 { 17 ida_free(&memregion_ids, id); 17 ida_free(&memregion_ids, id); 18 } 18 } 19 EXPORT_SYMBOL(memregion_free); 19 EXPORT_SYMBOL(memregion_free); 20 20
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.