summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <[email protected]>2022-11-23 11:46:16 +0530
committerAnup Patel <[email protected]>2023-02-10 09:14:58 +0530
commiteab48c33a12d5cdb01e36d0078c9f79764055952 (patch)
tree40f5d70ba7aeb0efb067a8b7a31afcbd3a2dcc45 /include
parent4e0572f57bc832b13f6e813dcdaebb1bf4d1172a (diff)
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 <[email protected]> Reviewed-by: Atish Patra <[email protected]> Reviewed-by: Xiang W <[email protected]> Reviewed-by: Bin Meng <[email protected]> Reviewed-by: Andrew Jones <[email protected]>
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 bbb3effa..ab1a944b 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);