diff options
| author | Rahul Pathak <[email protected]> | 2026-08-20 17:43:08 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2026-09-05 12:52:39 +0530 |
| commit | 35af7c8c7ee00869afc6e9e0aca64086888bd03f (patch) | |
| tree | 2fdcb7c940c5e32308a941dea354f2a23c7606ba /include | |
| parent | 7774b82e4aaa6fa98d1430b02d614eadd339a8a2 (diff) | |
lib: sbi: Rename map_range/unmap_range functions
*_map_range and *_unmap_range functions are required
in M-Mode to get the temporary access to S-Mode and U-Mode
regions. Thse functions only operate using the TYPE_MEMORY
memory protection mechanisms. Rename them to reflect the
actual usage of these functions and let generic map/unmap_range
names to implement generic functions
Signed-off-by: Rahul Pathak <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Reviewed-by: Pawandeep Oza <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi/sbi_hart_protection.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/include/sbi/sbi_hart_protection.h b/include/sbi/sbi_hart_protection.h index cafe6ee7..bdcad008 100644 --- a/include/sbi/sbi_hart_protection.h +++ b/include/sbi/sbi_hart_protection.h @@ -40,13 +40,17 @@ struct sbi_hart_protection { /** Unconfigure protection for current HART (Optional) */ void (*unconfigure)(struct sbi_scratch *scratch, struct sbi_domain *dom); - /** Create temporary mapping to access address range on current HART (Optional) */ - int (*map_range)(struct sbi_scratch *scratch, - unsigned long base, unsigned long size); + /** + * Give temporary M-mode access to an S/U-mode address range on current + * HART (Optional). Only applicable for the TYPE_MEMORY and the TYPE_ID + * mechanisms are not invoked. + */ + int (*temp_map_range)(struct sbi_scratch *scratch, + unsigned long base, unsigned long size); - /** Destroy temporary mapping on current HART (Optional) */ - int (*unmap_range)(struct sbi_scratch *scratch, - unsigned long base, unsigned long size); + /** Remove the temporary M-mode access on the current HART (Optional) */ + int (*temp_unmap_range)(struct sbi_scratch *scratch, + unsigned long base, unsigned long size); }; /** @@ -111,23 +115,24 @@ int sbi_hart_protection_reconfigure(struct sbi_scratch *scratch, struct sbi_domain *next_dom); /** - * Create temporary mapping to access address range on current HART + * Give temporary M-mode access to an S/U-mode address range on the + * current HART. Only valid for TYPE_MEMORY. * * @param base base address of the temporary mapping * @param size size of the temporary mapping * * @return 0 on success and negative error code on failure */ -int sbi_hart_protection_map_range(unsigned long base, unsigned long size); +int sbi_hart_protection_temp_map_range(unsigned long base, unsigned long size); /** - * Destroy temporary mapping to access address range on current HART + * Remove the temporary M-mode access on the current HART * * @param base base address of the temporary mapping * @param size size of the temporary mapping * * @return 0 on success and negative error code on failure */ -int sbi_hart_protection_unmap_range(unsigned long base, unsigned long size); +int sbi_hart_protection_temp_unmap_range(unsigned long base, unsigned long size); #endif /* __SBI_HART_PROTECTION_H__ */ |
