From 2dfed32c463eef80a0eea7108117ce18dc80c527 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Tue, 21 May 2019 11:51:01 +0530 Subject: lib: Add a simple brain-dead allocator to manage extra scratch space We have extra space above scratch space (sbi_scratch) which we are currently using to manage per-HART IPI data and TLB request management. In future, more parts of OpenSBI will use the extra scratch space so it will become difficult to manage extra scratch space using just defines and macros. This patch adds a simple brain-dead allocator to manage extra scratch space. This allocator never expects anything to be free-ed hence it keeps incrementing to next allocation offset until it runs-out of space. In future, we can have more sophisticated allocator which will allow us to re-claim free-ed space and also allows us to track owner of allocated space. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- lib/objects.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/objects.mk') diff --git a/lib/objects.mk b/lib/objects.mk index 137d7f06..bfa5a3c4 100644 --- a/lib/objects.mk +++ b/lib/objects.mk @@ -21,6 +21,7 @@ lib-objs-y += sbi_illegal_insn.o lib-objs-y += sbi_init.o lib-objs-y += sbi_ipi.o lib-objs-y += sbi_misaligned_ldst.o +lib-objs-y += sbi_scratch.o lib-objs-y += sbi_system.o lib-objs-y += sbi_timer.o lib-objs-y += sbi_trap.o -- cgit v1.3.1