diff --git a/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_msr.h b/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_msr.h index 5fdbf3149..1806ee2e1 100644 --- a/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_msr.h +++ b/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_msr.h @@ -74,8 +74,8 @@ /// Move From MSR #define mfmsr() \ - ({volatile uint32_t __msr; \ - asm volatile ("mfmsr %0" : "=r" (__msr)); \ + ({uint32_t __msr; \ + asm volatile ("mfmsr %0" : "=r" (__msr) : : "memory"); \ __msr;}) diff --git a/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_spr.h b/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_spr.h index 1abe348df..3aeb8a187 100644 --- a/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_spr.h +++ b/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_spr.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -134,8 +134,8 @@ typedef union /// Note that \a sprn must be a compile-time constant. #define mfspr(sprn) \ - ({volatile uint32_t __value; \ - asm volatile ("mfspr %0, %1" : "=r" (__value) : "i" (sprn)); \ + ({uint32_t __value; \ + asm volatile ("mfspr %0, %1" : "=r" (__value) : "i" (sprn) : "memory"); \ __value;}) @@ -144,8 +144,8 @@ typedef union /// Note that \a sprn must be a compile-time constant. #define mtspr(sprn, value) \ - ({volatile uint32_t __value = (value); \ - asm volatile ("mtspr %0, %1" : : "i" (sprn), "r" (__value)); \ + ({uint32_t __value = (value); \ + asm volatile ("mtspr %0, %1" : : "i" (sprn), "r" (__value) : "memory"); \ }) diff --git a/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_big.c b/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_big.c index 319407aff..cebaba1c0 100644 --- a/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_big.c +++ b/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_big.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -34,7 +34,7 @@ #include "pk.h" #include "pk_trace.h" -#if (PK_TRACE_SUPPORT && PK_TIMER_SUPPORT) +#if (PK_TRACE_SUPPORT) void pk_trace_big(uint32_t i_hash_and_count, uint64_t i_parm1, uint64_t i_parm2) { diff --git a/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_binary.c b/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_binary.c index a61366b6e..ef5f5bfcf 100644 --- a/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_binary.c +++ b/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_binary.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -33,7 +33,7 @@ #include "pk.h" #include "pk_trace.h" -#if (PK_TRACE_SUPPORT && PK_TIMER_SUPPORT) +#if (PK_TRACE_SUPPORT) void pk_trace_binary(uint32_t i_hash_and_size, void* bufp) { PkTraceBinary footer; diff --git a/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_core.c b/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_core.c index 2f510b09b..a119d52cb 100644 --- a/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_core.c +++ b/src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_core.c @@ -36,9 +36,10 @@ #include "pk.h" #include "pk_trace.h" -void pk_trace_timer_callback(void* arg); -#if (PK_TRACE_SUPPORT && PK_TIMER_SUPPORT) +#if (PK_TRACE_SUPPORT) +#if (PK_TIMER_SUPPORT) +void pk_trace_timer_callback(void* arg); extern PkTimer g_pk_trace_timer __attribute__((section (".sdata"))); //Static initialization of the trace timer @@ -49,6 +50,7 @@ PkTimer g_pk_trace_timer __attribute__ ((section (".sdata"))) = .callback = pk_trace_timer_callback, .arg = 0, }; +#endif //Static initialization of the pk trace buffer PkTraceBuffer g_pk_trace_buf __attribute__ ((section (".sdata"))) = @@ -56,10 +58,11 @@ PkTraceBuffer g_pk_trace_buf __attribute__ ((section (".sdata"))) = .version = PK_TRACE_VERSION, .image_str = PPE_IMG_STRING, .hash_prefix = PK_TRACE_HASH_PREFIX, - .partial_trace_hash = trace_ppe_hash("PARTIAL TRACE ENTRY. HASH_ID = %d", PK_TRACE_HASH_PREFIX), + .partial_trace_hash = + trace_ppe_hash("PARTIAL TRACE ENTRY. HASH_ID = %d", PK_TRACE_HASH_PREFIX), .size = PK_TRACE_SZ, .max_time_change = PK_TRACE_MTBT, - .hz = 500000000, //default value. Actual value is set in pk_init.c + .hz = 500000000, //default. Actual is set in pk_init.c .time_adj64 = 0, .state.word64 = 0, .cb = {0} @@ -124,7 +127,7 @@ void pk_trace_tiny(uint32_t i_parm) pk_critical_section_exit(&ctx); } - +#if (PK_TIMER_SUPPORT) // This function is called periodically in order to ensure that the max ticks // between trace entries is no more than what will fit inside a 32bit value. #ifndef PK_TRACE_TIMER_OUTPUT @@ -151,5 +154,5 @@ void pk_trace_set_timebase(PkTimebase timebase) { g_pk_trace_buf.time_adj64 = timebase - pk_timebase_get(); } - -#endif +#endif // PK_TIMER_SUPPORT +#endif // PK_TRACE_SUPPORT