summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <apatel@ventanamicro.com>2022-11-23 09:16:16 +0300
committerAnup Patel <anup@brainfault.org>2023-02-10 06:44:58 +0300
commiteab48c33a12d5cdb01e36d0078c9f79764055952 (patch)
tree40f5d70ba7aeb0efb067a8b7a31afcbd3a2dcc45 /include
parent4e0572f57bc832b13f6e813dcdaebb1bf4d1172a (diff)
downloadopensbi-eab48c33a12d5cdb01e36d0078c9f79764055952.tar.xz
lib: sbi: Add sbi_domain_check_addr_range() function
We add sbi_domain_check_addr_range() helper function to check whether a given address range is accessible under a particular domain. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_domain.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h
index bbb3eff..ab1a944 100644
--- a/include/sbi/sbi_domain.h
+++ b/include/sbi/sbi_domain.h
@@ -196,6 +196,21 @@ bool sbi_domain_check_addr(const struct sbi_domain *dom,
unsigned long addr, unsigned long mode,
unsigned long access_flags);
+/**
+ * Check whether we can access specified address range for given mode and
+ * memory region flags under a domain
+ * @param dom pointer to domain
+ * @param addr the start of the address range to be checked
+ * @param size the size of the address range to be checked
+ * @param mode the privilege mode of access
+ * @param access_flags bitmask of domain access types (enum sbi_domain_access)
+ * @return TRUE if access allowed otherwise FALSE
+ */
+bool sbi_domain_check_addr_range(const struct sbi_domain *dom,
+ unsigned long addr, unsigned long size,
+ unsigned long mode,
+ unsigned long access_flags);
+
/** Dump domain details on the console */
void sbi_domain_dump(const struct sbi_domain *dom, const char *suffix);