mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
lib: Introduce SBI_TLB_INFO_INIT() helper macro
We introduce SBI_TLB_INFO_INIT() helper macro to help easy initialization of struct sbi_tlb_info which is passed to the sbi_tlb_request() API. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
@@ -41,7 +41,16 @@ struct sbi_tlb_info {
|
||||
unsigned long shart_mask;
|
||||
};
|
||||
|
||||
#define SBI_TLB_INFO_SIZE sizeof(struct sbi_tlb_info)
|
||||
#define SBI_TLB_INFO_INIT(__ptr, __start, __size, __asid, __type, __src_hart) \
|
||||
do { \
|
||||
(__ptr)->start = (__start); \
|
||||
(__ptr)->size = (__size); \
|
||||
(__ptr)->asid = (__asid); \
|
||||
(__ptr)->type = (__type); \
|
||||
(__ptr)->shart_mask = 1UL << (__src_hart); \
|
||||
} while (0)
|
||||
|
||||
#define SBI_TLB_INFO_SIZE sizeof(struct sbi_tlb_info)
|
||||
|
||||
int sbi_tlb_request(struct sbi_scratch *scratch, ulong hmask,
|
||||
ulong hbase, struct sbi_tlb_info *tinfo);
|
||||
|
Reference in New Issue
Block a user