From df8d23ff217dfb3736fe5fac9e707a57825e97d2 Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Fri, 12 Sep 2014 15:13:25 -0400 Subject: [PATCH] Fix the CPU timer and clock comparator output for the "bt -a" command on S390X machines. The output of CPU timer and clock comparator has always been incorrect because: - We added S390X_WORD_SIZE (8) instead of 4 to get the second word - We did not left shift the clock comparator by 8 The fix gets the complete 64 bit values and by shifting the clock comparator correctly. (holzheu@linux.vnet.ibm.com) --- s390x.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/s390x.c b/s390x.c index 82fd7f1..5bd7a81 100644 --- a/s390x.c +++ b/s390x.c @@ -1243,14 +1243,16 @@ s390x_print_lowcore(char* lc, struct bt_info *bt,int show_symbols) fprintf(fp," -prefix : %#010lx\n", tmp[0]); ptr = lc + MEMBER_OFFSET(lc_struct, "cpu_timer_save_area"); - tmp[0]=UINT(ptr); - tmp[1]=UINT(ptr + S390X_WORD_SIZE); - fprintf(fp," -cpu timer: %#010lx %#010lx\n", tmp[0],tmp[1]); + tmp[0]=ULONG(ptr); + fprintf(fp," -cpu timer: %#018lx\n", tmp[0]); ptr = lc + MEMBER_OFFSET(lc_struct, "clock_comp_save_area"); - tmp[0]=UINT(ptr); - tmp[1]=UINT(ptr + S390X_WORD_SIZE); - fprintf(fp," -clock cmp: %#010lx %#010lx\n", tmp[0], tmp[1]); + /* + * Shift clock comparator by 8 because we got bit positions 0-55 + * in byte 1 to 8. The first byte is always zero. + */ + tmp[0]=ULONG(ptr) << 8; + fprintf(fp," -clock cmp: %#018lx\n", tmp[0]); fprintf(fp," -general registers:\n"); ptr = lc + MEMBER_OFFSET(lc_struct, "gpregs_save_area");