diff options
author | Anup Patel <anup.patel@wdc.com> | 2019-05-21 11:51:01 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2019-05-24 08:22:47 +0530 |
commit | 2dfed32c463eef80a0eea7108117ce18dc80c527 (patch) | |
tree | cd6244af046665795aaa7eed4f2181623868a41a /include/sbi/sbi_error.h | |
parent | 4e2cd478208531c47343290f15b577d40c82649c (diff) |
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.h | 1 |
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 */ |