diff options
author | Thibaut Varene <varenet@parisc-linux.org> | 2005-10-21 22:49:25 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@parisc-linux.org> | 2005-10-21 22:49:25 -0400 |
commit | eba917273eb8579dd8ae36f6645518ca5579a2ab (patch) | |
tree | e2f6e86ea96e42bcfa78661a5d69e4c050218f2c /arch/parisc | |
parent | 74d13f84a9905e02a025d952ced6abb2e064f1c1 (diff) |
[PARISC] Add printing of fpregs state to stack dump
We're using fp regs now in the kernel, so we want to print them
on stack dump
Signed-off-by: Thibaut VARENE <varenet@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/kernel/traps.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index d2e5b229a2f4..15914f0235a0 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c | |||
@@ -74,7 +74,10 @@ void show_regs(struct pt_regs *regs) | |||
74 | char *level; | 74 | char *level; |
75 | unsigned long cr30; | 75 | unsigned long cr30; |
76 | unsigned long cr31; | 76 | unsigned long cr31; |
77 | 77 | /* carlos says that gcc understands better memory in a struct, | |
78 | * and it makes our life easier with fpregs -- T-Bone */ | ||
79 | struct { u32 sw[2]; } s; | ||
80 | |||
78 | level = user_mode(regs) ? KERN_DEBUG : KERN_CRIT; | 81 | level = user_mode(regs) ? KERN_DEBUG : KERN_CRIT; |
79 | 82 | ||
80 | printk("%s\n", level); /* don't want to have that pretty register dump messed up */ | 83 | printk("%s\n", level); /* don't want to have that pretty register dump messed up */ |
@@ -103,11 +106,33 @@ void show_regs(struct pt_regs *regs) | |||
103 | printk("%s\n", buf); | 106 | printk("%s\n", buf); |
104 | } | 107 | } |
105 | 108 | ||
106 | #if RIDICULOUSLY_VERBOSE | 109 | /* FR are 64bit everywhere. Need to use asm to get the content |
107 | for (i = 0; i < 32; i += 2) | 110 | * of fpsr/fper1, and we assume that we won't have a FP Identify |
108 | printk("%sFR%02d : %016lx FR%2d : %016lx", level, i, | 111 | * in our way, otherwise we're screwed. |
109 | regs->fr[i], i+1, regs->fr[i+1]); | 112 | * The fldd is used to restore the T-bit if there was one, as the |
110 | #endif | 113 | * store clears it anyway. |
114 | * BTW, PA2.0 book says "thou shall not use fstw on FPSR/FPERs". */ | ||
115 | __asm__ ( | ||
116 | "fstd %%fr0,0(%1) \n\t" | ||
117 | "fldd 0(%1),%%fr0 \n\t" | ||
118 | : "=m" (s) : "r" (&s) : "%r0" | ||
119 | ); | ||
120 | |||
121 | printk("%s\n", level); | ||
122 | printk("%s VZOUICununcqcqcqcqcqcrmunTDVZOUI\n", level); | ||
123 | printbinary(buf, s.sw[0], 32); | ||
124 | printk("%sFPSR: %s\n", level, buf); | ||
125 | printk("%sFPER1: %08x\n", level, s.sw[1]); | ||
126 | |||
127 | /* here we'll print fr0 again, tho it'll be meaningless */ | ||
128 | for (i = 0; i < 32; i += 4) { | ||
129 | int j; | ||
130 | p = buf; | ||
131 | p += sprintf(p, "%sfr%02d-%02d ", level, i, i + 3); | ||
132 | for (j = 0; j < 4; j++) | ||
133 | p += sprintf(p, " %016llx", (i+j) == 0 ? 0 : regs->fr[i+j]); | ||
134 | printk("%s\n", buf); | ||
135 | } | ||
111 | 136 | ||
112 | cr30 = mfctl(30); | 137 | cr30 = mfctl(30); |
113 | cr31 = mfctl(31); | 138 | cr31 = mfctl(31); |