Any comment on that change? Best Regards Michal Frynas
-----Original Message----- From: [email protected] [mailto:[email protected]] Sent: 9 marca 2012 12:10 To: [email protected] Subject: [Kgdb-bugreport] KGDB: Extension to arch specific KGDB interface Hi, I've tried to lunch KGDB on Qualcomm's platform MSM-8255 and after few days finally succeeded. Because of the fact that platform is based on two ARM processors (radio/modem based on ARM9 and Linux/apps based on ARM11) I needed to provide a few modifications on the Linux side to secure modem MCU while suspending Linux on the breakpoint. In particular it was necessary to handle modem watchdog while hanging on breakpoint to avoid resetting the platform. What I wanted to achieve was suspending the modem watchdog when entering breakpoint and resuming it when leaving breakpoint. For that I have extended the architecture specific part of KGDB for two new hooks which are intended to be set in arch/arm code. I think the arch code should have a chance to prepare for breakpoint/exception and cleanup after it. Best Regards Michal Frynas >From 9b7ccd2b1508c4a4b2e8af90fa3510de21e02499 Mon Sep 17 00:00:00 2001 From: Michal Frynas <[email protected]> Date: Fri, 9 Mar 2012 11:29:11 +0100 Subject: [PATCH] KGDB: arch specific pre_exception and post_exception hooks Structure kgdb_arch extends for two new architecture specific hooks: pre_exception being invoked before hitting a breakpoint and post_exception called just after leaving the breakpoint. --- include/linux/kgdb.h | 6 ++++++ kernel/debug/debug_core.c | 8 ++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index fa39183..90812c2 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h @@ -239,6 +239,10 @@ extern void kgdb_arch_late(void); * hardware breakpoints. * @correct_hw_break: Allow an architecture to specify how to correct the * hardware debug registers. + * @pre_exception: Allow an architecture to do any prep work before the + * exception handler + * @post_exception: Allow an architecture to do any cleanup after returning + * from exception handler */ struct kgdb_arch { unsigned char gdb_bpt_instr[BREAK_INSTR_SIZE]; @@ -251,6 +255,8 @@ struct kgdb_arch { void (*disable_hw_break)(struct pt_regs *regs); void (*remove_all_hw_break)(void); void (*correct_hw_break)(void); + void (*pre_exception)(void); + void (*post_exception)(void); }; /** diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 0d7c087..cdb1a62 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -568,6 +568,10 @@ return_normal: if (dbg_io_ops->pre_exception) dbg_io_ops->pre_exception(); + /* Call architecture specific pre_exception routine */ + if (arch_kgdb_ops.pre_exception) + arch_kgdb_ops.pre_exception(); + /* * Get the passive CPU lock which will hold all the non-primary * CPU in a spin state while the debugger is active @@ -624,6 +628,10 @@ cpu_master_loop: } } + /* Call architecture specific post_exception routine */ + if (arch_kgdb_ops.post_exception) + arch_kgdb_ops.post_exception(); + /* Call the I/O driver's post_exception routine */ if (dbg_io_ops->post_exception) dbg_io_ops->post_exception(); -- 1.7.8.3 ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Kgdb-bugreport mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Kgdb-bugreport mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport
