summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2020-05-25 00:03:14 +0200
committerMartin L Roth <gaumless@gmail.com>2022-09-04 16:35:22 +0000
commit526c64249a0a0c7b83d1914b88d4f938ede7dc1c (patch)
tree639322f2e32b0c11e629cc329e16c5c681c54781 /src/include
parent38688519cf4bca485c41b48ac5c0cc334daa8ba7 (diff)
allocator_v4: Introduce RESOURCE_ALLOCATION_TOP_DOWN
Add option to resource allocator v4 that restores the top-down allocation approach at the domain level. This makes it easier to handle 64-bit resources natively. With the top-down approach, resources that can be placed either above or below 4G would be placed above, to save precious space below the 4G boundary. Change-Id: Iaf463d3e6b37d52e46761d8e210034fded58a8a4 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41957 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Subrata Banik <subratabanik@google.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/memrange.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/include/memrange.h b/src/include/memrange.h
index a8a8de9c2d..f7c5bfce1e 100644
--- a/src/include/memrange.h
+++ b/src/include/memrange.h
@@ -161,15 +161,17 @@ struct range_entry *memranges_next_entry(struct memranges *ranges,
const struct range_entry *r);
/* Steals memory from the available list in given ranges as per the constraints:
- * limit = Upper bound for the memory range to steal (Inclusive).
- * size = Requested size for the stolen memory.
- * align = Required alignment(log 2) for the starting address of the stolen memory.
- * tag = Use a range that matches the given tag.
+ * limit = Upper bound for the memory range to steal (Inclusive).
+ * size = Requested size for the stolen memory.
+ * align = Required alignment(log 2) for the starting address of the stolen memory.
+ * tag = Use a range that matches the given tag.
+ * from_top = Steal the highest possible range.
*
* If the constraints can be satisfied, this function creates a hole in the memrange,
* writes the base address of that hole to stolen_base and returns true. Otherwise it returns
* false. */
bool memranges_steal(struct memranges *ranges, resource_t limit, resource_t size,
- unsigned char align, unsigned long tag, resource_t *stolen_base);
+ unsigned char align, unsigned long tag, resource_t *stolen_base,
+ bool from_top);
#endif /* MEMRANGE_H_ */