mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-09-08 18:21:29 +01:00
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 <rahul.pathak@oss.qualcomm.com> Reviewed-by: Anup Patel <anup@brainfault.org> Reviewed-by: Pawandeep Oza <pawandeep.oza@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260820121309.2551296-2-rahul.pathak@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -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__ */
|
||||
|
||||
Reference in New Issue
Block a user