summaryrefslogtreecommitdiff
path: root/include/sbi/sbi_tlb.h
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-03-03 17:11:09 +0300
committerAnup Patel <anup@brainfault.org>2020-03-11 12:59:55 +0300
commita4a6a81b7d69b39f4d806e96e6b54a9e0e36d3f3 (patch)
treee176a44772efabfc73b110fdbd80a8c295dc8fdb /include/sbi/sbi_tlb.h
parentd6d7e18d1d12c8eda2591f21a70d31dd95c2d32e (diff)
downloadopensbi-a4a6a81b7d69b39f4d806e96e6b54a9e0e36d3f3.tar.xz
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>
Diffstat (limited to 'include/sbi/sbi_tlb.h')
-rw-r--r--include/sbi/sbi_tlb.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/sbi/sbi_tlb.h b/include/sbi/sbi_tlb.h
index eb3d925..3d52636 100644
--- a/include/sbi/sbi_tlb.h
+++ b/include/sbi/sbi_tlb.h
@@ -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);