diff options
author | Anup Patel <anup.patel@wdc.com> | 2018-12-26 15:57:35 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2018-12-27 07:05:09 +0300 |
commit | e34aa8a6719dd6c225e576e0617d05735776af6f (patch) | |
tree | 59b041b592b1f139cb7850a522813f392a28c70b /include | |
parent | 7b59571758a5dec75c89928a60d982b29629cee6 (diff) | |
download | opensbi-e34aa8a6719dd6c225e576e0617d05735776af6f.tar.xz |
lib: Simplify sbi_platform irqchip_init() hooks
Instead of having separate irqchip_init() hooks for cold and
warm boot, this patch updates struct sbi_platform to have just
one irqchip_init() hook. The type of boot (cold or warm) is now
a boolean flag parameter for the updated irqchip_init() hook.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sbi/sbi_platform.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index e5c1896..503669b 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -42,8 +42,7 @@ struct sbi_platform { void (*console_putc)(char ch); char (*console_getc)(void); int (*console_init)(void); - int (*cold_irqchip_init)(void); - int (*warm_irqchip_init)(u32 target_hart); + int (*irqchip_init)(u32 hartid, bool cold_boot); void (*ipi_inject)(u32 target_hart, u32 source_hart); void (*ipi_sync)(u32 target_hart, u32 source_hart); void (*ipi_clear)(u32 target_hart); @@ -159,18 +158,11 @@ static inline int sbi_platform_console_init(struct sbi_platform *plat) return 0; } -static inline int sbi_platform_warm_irqchip_init(struct sbi_platform *plat, - u32 target_hart) -{ - if (plat && plat->warm_irqchip_init) - return plat->warm_irqchip_init(target_hart); - return 0; -} - -static inline int sbi_platform_cold_irqchip_init(struct sbi_platform *plat) +static inline int sbi_platform_irqchip_init(struct sbi_platform *plat, + u32 hartid, bool cold_boot) { - if (plat && plat->cold_irqchip_init) - return plat->cold_irqchip_init(); + if (plat && plat->irqchip_init) + return plat->irqchip_init(hartid, cold_boot); return 0; } |