mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-09-09 10:31:58 +01:00
lib: sbi_domain: Rename per-domain data to per-domain state
The per-domain sbi_domain_data hold each domain associated state like hart context in sbi_domain_context, mpxy state in sbi_mpxy, and others like each domain backed by the corresponding MPT (SMMPT). DATA reads as a generic name, while every use stores state. Rename functions and macros appropriately. There are no functional changes. Signed-off-by: Rahul Pathak <rahul.pathak@oss.qualcomm.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260820121309.2551296-3-rahul.pathak@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -64,14 +64,14 @@ struct hart_context {
|
||||
bool initialized;
|
||||
};
|
||||
|
||||
static struct sbi_domain_data dcpriv;
|
||||
static struct sbi_domain_state dcstate;
|
||||
|
||||
static inline struct hart_context *hart_context_get(struct sbi_domain *dom,
|
||||
u32 hartindex)
|
||||
{
|
||||
struct hart_context **dom_hartindex_to_context_table;
|
||||
|
||||
dom_hartindex_to_context_table = sbi_domain_data_ptr(dom, &dcpriv);
|
||||
dom_hartindex_to_context_table = sbi_domain_state_ptr(dom, &dcstate);
|
||||
if (!dom_hartindex_to_context_table || !sbi_hartindex_valid(hartindex))
|
||||
return NULL;
|
||||
|
||||
@@ -83,7 +83,7 @@ static void hart_context_set(struct sbi_domain *dom, u32 hartindex,
|
||||
{
|
||||
struct hart_context **dom_hartindex_to_context_table;
|
||||
|
||||
dom_hartindex_to_context_table = sbi_domain_data_ptr(dom, &dcpriv);
|
||||
dom_hartindex_to_context_table = sbi_domain_state_ptr(dom, &dcstate);
|
||||
if (!dom_hartindex_to_context_table || !sbi_hartindex_valid(hartindex))
|
||||
return;
|
||||
|
||||
@@ -314,15 +314,15 @@ int sbi_domain_context_init(void)
|
||||
/**
|
||||
* Allocate per-domain and per-hart context data.
|
||||
* The data type is "struct hart_context **" whose memory space will be
|
||||
* dynamically allocated by domain_setup_data_one(). Calculate needed
|
||||
* dynamically allocated by domain_setup_state_one(). Calculate needed
|
||||
* size of memory space here.
|
||||
*/
|
||||
dcpriv.data_size = sizeof(struct hart_context *) * sbi_hart_count();
|
||||
dcstate.state_size = sizeof(struct hart_context *) * sbi_hart_count();
|
||||
|
||||
return sbi_domain_register_data(&dcpriv);
|
||||
return sbi_domain_register_state(&dcstate);
|
||||
}
|
||||
|
||||
void sbi_domain_context_deinit(void)
|
||||
{
|
||||
sbi_domain_unregister_data(&dcpriv);
|
||||
sbi_domain_unregister_state(&dcstate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user