lib: sbi: Add sbi_domain_root_add_memregion() API

We should allow platform support to add more root memory regions
before domains are finalized. This will help platform support to
protect critical M-mode only resources.

This patch adds sbi_domain_root_add_memregion() API for above
described purpose.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
Anup Patel
2021-04-09 10:01:11 +05:30
committed by Anup Patel
parent 7495bce6f9
commit 4dc0001b09
2 changed files with 80 additions and 11 deletions

View File

@@ -170,6 +170,14 @@ void sbi_domain_dump_all(const char *suffix);
int sbi_domain_register(struct sbi_domain *dom,
const struct sbi_hartmask *assign_mask);
/**
* Add a memory region to the root domain
* @param reg pointer to the memory region to be added
*
* @return 0 on success and negative error code on failure
*/
int sbi_domain_root_add_memregion(const struct sbi_domain_memregion *reg);
/** Finalize domain tables and startup non-root domains */
int sbi_domain_finalize(struct sbi_scratch *scratch, u32 cold_hartid);