resource.c (9ca6551ee24368a4d2b09566ea4d10fe87860379) | resource.c (cb8e3c8b4f45e4ed8987a581956dc9c3827a5bcf) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * linux/kernel/resource.c 4 * 5 * Copyright (C) 1999 Linus Torvalds 6 * Copyright (C) 1999 Martin Mares <mj@ucw.cz> 7 * 8 * Arbitrary resource management. --- 1226 unchanged lines hidden (view full) --- 1235 "<%016llx-%016llx>\n", (unsigned long long)start, 1236 (unsigned long long)end); 1237} 1238EXPORT_SYMBOL(__release_region); 1239 1240#ifdef CONFIG_MEMORY_HOTREMOVE 1241/** 1242 * release_mem_region_adjustable - release a previously reserved memory region | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * linux/kernel/resource.c 4 * 5 * Copyright (C) 1999 Linus Torvalds 6 * Copyright (C) 1999 Martin Mares <mj@ucw.cz> 7 * 8 * Arbitrary resource management. --- 1226 unchanged lines hidden (view full) --- 1235 "<%016llx-%016llx>\n", (unsigned long long)start, 1236 (unsigned long long)end); 1237} 1238EXPORT_SYMBOL(__release_region); 1239 1240#ifdef CONFIG_MEMORY_HOTREMOVE 1241/** 1242 * release_mem_region_adjustable - release a previously reserved memory region |
1243 * @parent: parent resource descriptor | |
1244 * @start: resource start address 1245 * @size: resource region size 1246 * 1247 * This interface is intended for memory hot-delete. The requested region 1248 * is released from a currently busy memory resource. The requested region 1249 * must either match exactly or fit into a single busy resource entry. In 1250 * the latter case, the remaining resource is adjusted accordingly. 1251 * Existing children of the busy memory resource must be immutable in the 1252 * request. 1253 * 1254 * Note: 1255 * - Additional release conditions, such as overlapping region, can be 1256 * supported after they are confirmed as valid cases. 1257 * - When a busy memory resource gets split into two entries, the code 1258 * assumes that all children remain in the lower address entry for 1259 * simplicity. Enhance this logic when necessary. 1260 */ | 1243 * @start: resource start address 1244 * @size: resource region size 1245 * 1246 * This interface is intended for memory hot-delete. The requested region 1247 * is released from a currently busy memory resource. The requested region 1248 * must either match exactly or fit into a single busy resource entry. In 1249 * the latter case, the remaining resource is adjusted accordingly. 1250 * Existing children of the busy memory resource must be immutable in the 1251 * request. 1252 * 1253 * Note: 1254 * - Additional release conditions, such as overlapping region, can be 1255 * supported after they are confirmed as valid cases. 1256 * - When a busy memory resource gets split into two entries, the code 1257 * assumes that all children remain in the lower address entry for 1258 * simplicity. Enhance this logic when necessary. 1259 */ |
1261void release_mem_region_adjustable(struct resource *parent, 1262 resource_size_t start, resource_size_t size) | 1260void release_mem_region_adjustable(resource_size_t start, resource_size_t size) |
1263{ | 1261{ |
1262 struct resource *parent = &iomem_resource; |
|
1264 struct resource *new_res = NULL; 1265 bool alloc_nofail = false; 1266 struct resource **p; 1267 struct resource *res; 1268 resource_size_t end; 1269 1270 end = start + size - 1; 1271 if (WARN_ON_ONCE((start < parent->start) || (end > parent->end))) --- 515 unchanged lines hidden --- | 1263 struct resource *new_res = NULL; 1264 bool alloc_nofail = false; 1265 struct resource **p; 1266 struct resource *res; 1267 resource_size_t end; 1268 1269 end = start + size - 1; 1270 if (WARN_ON_ONCE((start < parent->start) || (end > parent->end))) --- 515 unchanged lines hidden --- |