aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/xmon/xmon.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 12:58:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 12:58:09 -0500
commit16e024f30ce96ef5fa651e2914e19d175a924cab (patch)
treed68106151a0b36e22625d7af7b23081a48c92e87 /arch/powerpc/xmon/xmon.c
parentc36e0501ee91d7616a188efbf9714b1fce150032 (diff)
parent376bddd34433065aeb9b9a140870537feecf90ef (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc update from Benjamin Herrenschmidt: "The main highlight is probably some base POWER8 support. There's more to come such as transactional memory support but that will wait for the next one. Overall it's pretty quiet, or rather I've been pretty poor at picking things up from patchwork and reviewing them this time around and Kumar no better on the FSL side it seems..." * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (73 commits) powerpc+of: Rename and fix OF reconfig notifier error inject module powerpc: mpc5200: Add a3m071 board support powerpc/512x: don't compile any platform DIU code if the DIU is not enabled powerpc/mpc52xx: use module_platform_driver macro powerpc+of: Export of_reconfig_notifier_[register,unregister] powerpc/dma/raidengine: add raidengine device powerpc/iommu/fsl: Add PAMU bypass enable register to ccsr_guts struct powerpc/mpc85xx: Change spin table to cached memory powerpc/fsl-pci: Add PCI controller ATMU PM support powerpc/86xx: fsl_pcibios_fixup_bus requires CONFIG_PCI drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS] powerpc/85xx: p1022ds: Use NULL instead of 0 for pointers powerpc: Disable relocation on exceptions when kexecing powerpc: Enable relocation on during exceptions at boot powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function powerpc: Add wrappers to enable/disable relocation on exceptions powerpc: Add set_mode hcall powerpc: Setup relocation on exceptions for bare metal systems powerpc: Move initial mfspr LPCR out of __init_LPCR powerpc: Add relocation on exception vector handlers ...
Diffstat (limited to 'arch/powerpc/xmon/xmon.c')
-rw-r--r--arch/powerpc/xmon/xmon.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 3a56a639a92e..1f8d2f10a432 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -52,9 +52,6 @@
52#include "nonstdio.h" 52#include "nonstdio.h"
53#include "dis-asm.h" 53#include "dis-asm.h"
54 54
55#define scanhex xmon_scanhex
56#define skipbl xmon_skipbl
57
58#ifdef CONFIG_SMP 55#ifdef CONFIG_SMP
59static cpumask_t cpus_in_xmon = CPU_MASK_NONE; 56static cpumask_t cpus_in_xmon = CPU_MASK_NONE;
60static unsigned long xmon_taken = 1; 57static unsigned long xmon_taken = 1;
@@ -169,12 +166,8 @@ extern void xmon_leave(void);
169 166
170#ifdef CONFIG_PPC64 167#ifdef CONFIG_PPC64
171#define REG "%.16lx" 168#define REG "%.16lx"
172#define REGS_PER_LINE 4
173#define LAST_VOLATILE 13
174#else 169#else
175#define REG "%.8lx" 170#define REG "%.8lx"
176#define REGS_PER_LINE 8
177#define LAST_VOLATILE 12
178#endif 171#endif
179 172
180#define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3]) 173#define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3])
@@ -1288,27 +1281,19 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,
1288 catch_memory_errors = 0; 1281 catch_memory_errors = 0;
1289} 1282}
1290 1283
1291static int xmon_depth_to_print = 64;
1292
1293#define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long)) 1284#define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long))
1294#define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long)) 1285#define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long))
1295 1286
1296#ifdef __powerpc64__
1297#define REGS_OFFSET 0x70
1298#else
1299#define REGS_OFFSET 16
1300#endif
1301
1302static void xmon_show_stack(unsigned long sp, unsigned long lr, 1287static void xmon_show_stack(unsigned long sp, unsigned long lr,
1303 unsigned long pc) 1288 unsigned long pc)
1304{ 1289{
1290 int max_to_print = 64;
1305 unsigned long ip; 1291 unsigned long ip;
1306 unsigned long newsp; 1292 unsigned long newsp;
1307 unsigned long marker; 1293 unsigned long marker;
1308 int count = 0;
1309 struct pt_regs regs; 1294 struct pt_regs regs;
1310 1295
1311 do { 1296 while (max_to_print--) {
1312 if (sp < PAGE_OFFSET) { 1297 if (sp < PAGE_OFFSET) {
1313 if (sp != 0) 1298 if (sp != 0)
1314 printf("SP (%lx) is in userspace\n", sp); 1299 printf("SP (%lx) is in userspace\n", sp);
@@ -1362,10 +1347,10 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
1362 an exception frame. */ 1347 an exception frame. */
1363 if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long)) 1348 if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long))
1364 && marker == STACK_FRAME_REGS_MARKER) { 1349 && marker == STACK_FRAME_REGS_MARKER) {
1365 if (mread(sp + REGS_OFFSET, &regs, sizeof(regs)) 1350 if (mread(sp + STACK_FRAME_OVERHEAD, &regs, sizeof(regs))
1366 != sizeof(regs)) { 1351 != sizeof(regs)) {
1367 printf("Couldn't read registers at %lx\n", 1352 printf("Couldn't read registers at %lx\n",
1368 sp + REGS_OFFSET); 1353 sp + STACK_FRAME_OVERHEAD);
1369 break; 1354 break;
1370 } 1355 }
1371 printf("--- Exception: %lx %s at ", regs.trap, 1356 printf("--- Exception: %lx %s at ", regs.trap,
@@ -1379,7 +1364,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
1379 break; 1364 break;
1380 1365
1381 sp = newsp; 1366 sp = newsp;
1382 } while (count++ < xmon_depth_to_print); 1367 }
1383} 1368}
1384 1369
1385static void backtrace(struct pt_regs *excp) 1370static void backtrace(struct pt_regs *excp)
@@ -2943,7 +2928,6 @@ static void xmon_init(int enable)
2943 __debugger_dabr_match = NULL; 2928 __debugger_dabr_match = NULL;
2944 __debugger_fault_handler = NULL; 2929 __debugger_fault_handler = NULL;
2945 } 2930 }
2946 xmon_map_scc();
2947} 2931}
2948 2932
2949#ifdef CONFIG_MAGIC_SYSRQ 2933#ifdef CONFIG_MAGIC_SYSRQ