include: Make sbi_hart_id_to_scratch() as macro

The sbi_hart_id_to_scratch() just forwards call to firmware specific
hartid_to_scratch() callback so we make sbi_hart_id_to_scratch() as
macro in sbi_scratch.h instead of regular function in sbi_hart.c.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Anup Patel
2020-03-11 19:08:08 +05:30
committed by Anup Patel
parent baac7e066d
commit f92147c2b2
3 changed files with 6 additions and 11 deletions

View File

@@ -103,6 +103,12 @@ void sbi_scratch_free_offset(unsigned long offset);
#define sbi_scratch_thishart_offset_ptr(offset) \
((void *)sbi_scratch_thishart_ptr() + (offset))
typedef struct sbi_scratch *(*hartid2scratch)(ulong hartid);
/** Get sbi_scratch from HART id */
#define sbi_hart_id_to_scratch(__scratch, __hartid) \
((hartid2scratch)(__scratch)->hartid_to_scratch)(__hartid)
#endif
#endif