summaryrefslogtreecommitdiff
path: root/include/sbi/sbi_error.h
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2019-05-21 09:21:01 +0300
committerAnup Patel <anup@brainfault.org>2019-05-24 05:52:47 +0300
commit2dfed32c463eef80a0eea7108117ce18dc80c527 (patch)
treecd6244af046665795aaa7eed4f2181623868a41a /include/sbi/sbi_error.h
parent4e2cd478208531c47343290f15b577d40c82649c (diff)
downloadopensbi-2dfed32c463eef80a0eea7108117ce18dc80c527.tar.xz
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 <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'include/sbi/sbi_error.h')
-rw-r--r--include/sbi/sbi_error.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sbi/sbi_error.h b/include/sbi/sbi_error.h
index 39a3864..db3d6dd 100644
--- a/include/sbi/sbi_error.h
+++ b/include/sbi/sbi_error.h
@@ -24,6 +24,7 @@
#define SBI_EIO -9
#define SBI_EILL -10
#define SBI_ENOSPC -11
+#define SBI_ENOMEM -12
/* clang-format on */