summaryrefslogtreecommitdiff
path: root/include/sbi/sbi_platform.h
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-01-03 07:21:58 +0300
committerAnup Patel <anup.patel@wdc.com>2020-01-07 09:41:19 +0300
commit1993182f032b71a4d16e39bff12c142dd25dd67e (patch)
tree7735c259ea79e56d2d2e7a9dc27d7a88349ae909 /include/sbi/sbi_platform.h
parentb325f6baefeafcee169e5f8a529882fdc0f47dc5 (diff)
downloadopensbi-1993182f032b71a4d16e39bff12c142dd25dd67e.tar.xz
lib: Add irqchip exit API
We add an optional platform irqchip exit hook for exit path handling in sbi_exit() implementation. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'include/sbi/sbi_platform.h')
-rw-r--r--include/sbi/sbi_platform.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h
index 21082fc..0de8be4 100644
--- a/include/sbi/sbi_platform.h
+++ b/include/sbi/sbi_platform.h
@@ -109,6 +109,8 @@ struct sbi_platform_operations {
/** Initialize the platform interrupt controller for current HART */
int (*irqchip_init)(bool cold_boot);
+ /** Exit the platform interrupt controller for current HART */
+ void (*irqchip_exit)(void);
/** Send IPI to a target HART */
void (*ipi_send)(u32 target_hart);
@@ -460,6 +462,17 @@ static inline int sbi_platform_irqchip_init(const struct sbi_platform *plat,
}
/**
+ * Exit the platform interrupt controller for current HART
+ *
+ * @param plat pointer to struct sbi_platform
+ */
+static inline void sbi_platform_irqchip_exit(const struct sbi_platform *plat)
+{
+ if (plat && sbi_platform_ops(plat)->irqchip_exit)
+ sbi_platform_ops(plat)->irqchip_exit();
+}
+
+/**
* Send IPI to a target HART
*
* @param plat pointer to struct sbi_platform