summaryrefslogtreecommitdiffstats
path: root/src/ppe/pk/gpe/gpe_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ppe/pk/gpe/gpe_common.h')
-rw-r--r--src/ppe/pk/gpe/gpe_common.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/ppe/pk/gpe/gpe_common.h b/src/ppe/pk/gpe/gpe_common.h
index debae8e..2b6b99b 100644
--- a/src/ppe/pk/gpe/gpe_common.h
+++ b/src/ppe/pk/gpe/gpe_common.h
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015 */
+/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -42,17 +42,20 @@
// -*- the PMX area as your edits will be lost. -*-
#ifndef __ASSEMBLER__
-#include <stdint.h>
+ #include <stdint.h>
#endif
#include "occhw_common.h"
/// Each GPE instance has it's own interrupt status register these macros
/// are added for convenience in accessing the correct register
-#define GPE_GISR0(instance_id) (OCB_G0ISR0 + (instance_id * 8))
-#define GPE_GISR1(instance_id) (OCB_G0ISR1 + (instance_id * 8))
+#ifndef UNIFIED_IRQ_HANDLER_GPE
+ #define GPE_GISR0(instance_id) (OCB_G0ISR0 + (instance_id * 8))
+ #define GPE_GISR1(instance_id) (OCB_G0ISR1 + (instance_id * 8))
+#endif
#ifdef __ASSEMBLER__
+// *INDENT-OFF*
/// This macro contains GPE specific code for determining what IRQ caused the
/// external exception handler to be invoked by the PPE
@@ -62,16 +65,28 @@
///
/// r1, r2, r3, and r13 must not be modified. All other registers may be used.
///
+/// The pk_unified_irq_prty_mask_handler routine MUST return the task priority
+/// interrupt vector in d5.
+///
.macro hwmacro_get_ext_irq
-
+
+#ifdef UNIFIED_IRQ_HANDLER_GPE
+ // Unified approach.
+ _liw r5, pk_unified_irq_prty_mask_handler
+ mtlr r5
+ blrl // On return, d5 contains task prty irq vec.
+#else
_lwzi %r5, %r5, GPE_GISR0(APPCFG_OCC_INSTANCE_ID)
+#endif
cntlzw %r4, %r5
cmpwible %r4, 31, call_external_irq_handler #branch if irq is lt or eq to 31
-
+
## No IRQ pending in interrupt set 0. Try set 1.
## Note: irq # will be 64 (EXTERNAL_IRQS) if no bits were set in either register
-
+
+#ifndef UNIFIED_IRQ_HANDLER_GPE
_lwzi %r6, %r6, GPE_GISR1(APPCFG_OCC_INSTANCE_ID)
+#endif
cntlzw %r4, %r6
addi %r4, %r4, 32
@@ -84,6 +99,8 @@
.macro .hwmacro_irq_cfg_bitmaps
.occhw_irq_cfg_bitmaps
.endm
+
+// *INDENT-ON*
#endif /* __ASSEMBLER__ */
#endif /* __GPE_COMMON_H__ */
OpenPOWER on IntegriCloud