diff options
4 files changed, 33 insertions, 16 deletions
diff --git a/import/chips/p9/procedures/ppe/iota/iota_panic_codes.h b/import/chips/p9/procedures/ppe/iota/iota_panic_codes.h index bf23b4b1..318cebe9 100644 --- a/import/chips/p9/procedures/ppe/iota/iota_panic_codes.h +++ b/import/chips/p9/procedures/ppe/iota/iota_panic_codes.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HCODE Project */ /* */ -/* COPYRIGHT 2016,2017 */ +/* COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -44,12 +44,12 @@ typedef enum IOTA_NULLPTR_TASK = 0x0001, IOTA_MACHINE_STATE_STACK_OVERFLOW = 0x0002, IOTA_MACHINE_STATE_STACK_UNDERFLOW = 0x0003, - IOTA_UNUSED_0004 = 0x0004, - IOTA_UNUSED_0005 = 0x0005, - IOTA_UNUSED_0006 = 0x0006, - IOTA_UNUSED_0007 = 0x0007, - IOTA_UNUSED_0008 = 0x0008, - IOTA_UNUSED_0009 = 0x0009, + IOTA_MACHINE_CHECK_PANIC = 0x0004, + IOTA_DATA_STORAGE_PANIC = 0x0005, + IOTA_INSTRUCTION_STORAGE_PANIC = 0x0006, + IOTA_DATA_ALIGNMENT_PANIC = 0x0007, + IOTA_ILLEGAL_INSTRUCTION = 0x0008, + IOTA_SOFTWARE_HALT = 0x0009, IOTA_UNUSED_000a = 0x000a, IOTA_UNUSED_000d = 0x000d, IOTA_UNUSED_001c = 0x001c, @@ -256,5 +256,15 @@ typedef enum IOTA_UNUSED_0d1f = 0x0d1f } iotaPanicCode_t; +#else + +/// Assembler specific panic codes +#define IOTA_MACHINE_CHECK_PANIC 0x0004 +#define IOTA_DATA_STORAGE_PANIC 0x0005 +#define IOTA_INSTRUCTION_STORAGE_PANIC 0x0006 +#define IOTA_DATA_ALIGNMENT_PANIC 0x0007 +#define IOTA_ILLEGAL_INSTRUCTION 0x0008 +#define IOTA_SOFTWARE_HALT 0x0009 + #endif // __ASSEMBLER__ #endif diff --git a/import/chips/p9/procedures/ppe/iota/iota_ppe42.S b/import/chips/p9/procedures/ppe/iota/iota_ppe42.S index f00fab4d..58ee0491 100644 --- a/import/chips/p9/procedures/ppe/iota/iota_ppe42.S +++ b/import/chips/p9/procedures/ppe/iota/iota_ppe42.S @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HCODE Project */ /* */ -/* COPYRIGHT 2017 */ +/* COPYRIGHT 2017,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -25,6 +25,7 @@ #include "iota.h" #include "iota_ppe42.h" #include "std_irq_config.h" +#include "iota_panic_codes.h" .global g_iota_execution_stack @@ -134,7 +135,7 @@ __iota_save_interrupt_state_and_schedule: .global __iota_halt __iota_halt: - trap + _pk_panic IOTA_SOFTWARE_HALT ## pull in the macro that calculates all the external interrupt config ## defined in pk/std/std_irq_config.h diff --git a/import/chips/p9/procedures/ppe/iota/iota_ppe42.h b/import/chips/p9/procedures/ppe/iota/iota_ppe42.h index 2779962f..aa9a26a7 100644 --- a/import/chips/p9/procedures/ppe/iota/iota_ppe42.h +++ b/import/chips/p9/procedures/ppe/iota/iota_ppe42.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HCODE Project */ /* */ -/* COPYRIGHT 2017 */ +/* COPYRIGHT 2017,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -66,6 +66,11 @@ #ifdef __ASSEMBLER__ // *INDENT-OFF* +# halt ppe with panic code macro +.macro _pk_panic, code + tw 31,(\code)/256, (\code)%256 +.endm + # This routine is called on any exception or interrupt and saves some state # prior to setting up the call to and calling __iota_save_interrupt_state_and_schedule # Note: must be <=8 instructions! diff --git a/import/chips/p9/procedures/ppe/iota/iota_ppe42_vectors.S b/import/chips/p9/procedures/ppe/iota/iota_ppe42_vectors.S index 271a3384..f7dade09 100644 --- a/import/chips/p9/procedures/ppe/iota/iota_ppe42_vectors.S +++ b/import/chips/p9/procedures/ppe/iota/iota_ppe42_vectors.S @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HCODE Project */ /* */ -/* COPYRIGHT 2017 */ +/* COPYRIGHT 2017,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -23,6 +23,7 @@ /* */ /* IBM_PROLOG_END_TAG */ #include "iota_ppe42.h" +#include "iota_panic_codes.h" .section .vectors, "ax", @progbits @@ -31,7 +32,7 @@ __vectors: .global __machine_check __machine_check: - trap + _pk_panic IOTA_MACHINE_CHECK_PANIC .global __set_msr .org __vectors + 0x0028 @@ -47,12 +48,12 @@ __system_reset: .global __data_storage .org __vectors + 0x0060 __data_storage: - trap + _pk_panic IOTA_DATA_STORAGE_PANIC .global __instruction_storage .org __vectors + 0x0080 __instruction_storage: - trap + _pk_panic IOTA_INSTRUCTION_STORAGE_PANIC .global ppe42_64bit_timebase .global __external_interrupt @@ -63,12 +64,12 @@ __external_interrupt: .global __alignment_exception .org __vectors + 0x00c0 __alignment_exception: - trap + _pk_panic IOTA_DATA_ALIGNMENT_PANIC .global __program_exception .org __vectors + 0x00e0 __program_exception: - trap + _pk_panic IOTA_ILLEGAL_INSTRUCTION .global __dec_interrupt .org __vectors + 0x0100 |

