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:
Rahul Pathak
2026-09-05 12:52:39 +05:30
committed by Anup Patel
parent 7774b82e4a
commit 35af7c8c7e
8 changed files with 72 additions and 67 deletions
+4 -4
View File
@@ -1032,7 +1032,7 @@ int sbi_sse_read_attrs(uint32_t event_id, uint32_t base_attr_id,
if (ret)
return ret;
sbi_hart_protection_map_range(output_phys_lo, sizeof(unsigned long) * attr_count);
sbi_hart_protection_temp_map_range(output_phys_lo, sizeof(unsigned long) * attr_count);
/*
* Copy all attributes at once since struct sse_event_attrs is matching
@@ -1045,7 +1045,7 @@ int sbi_sse_read_attrs(uint32_t event_id, uint32_t base_attr_id,
attrs = (unsigned long *)output_phys_lo;
copy_attrs(attrs, &e_attrs[base_attr_id], attr_count);
sbi_hart_protection_unmap_range(output_phys_lo, sizeof(unsigned long) * attr_count);
sbi_hart_protection_temp_unmap_range(output_phys_lo, sizeof(unsigned long) * attr_count);
sse_event_put(e);
@@ -1060,7 +1060,7 @@ static int sse_write_attrs(struct sbi_sse_event *e, uint32_t base_attr_id,
uint32_t id, end_id = base_attr_id + attr_count;
unsigned long *attrs = (unsigned long *)input_phys;
sbi_hart_protection_map_range(input_phys, sizeof(unsigned long) * attr_count);
sbi_hart_protection_temp_map_range(input_phys, sizeof(unsigned long) * attr_count);
for (id = base_attr_id; id < end_id; id++) {
val = attrs[attr++];
@@ -1076,7 +1076,7 @@ static int sse_write_attrs(struct sbi_sse_event *e, uint32_t base_attr_id,
}
out:
sbi_hart_protection_unmap_range(input_phys, sizeof(unsigned long) * attr_count);
sbi_hart_protection_temp_unmap_range(input_phys, sizeof(unsigned long) * attr_count);
return ret;
}