Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3dab04e6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-mn10300:
  MN10300: gcc 4.6 vs am33 inline assembly
  MN10300: Deprecate gdbstub
  MN10300: Allow KGDB to use the MN10300 serial ports
  MN10300: Emulate single stepping in KGDB on MN10300
  MN10300: Generalise kernel debugger kernel halt, reboot or power off hook
  KGDB: Notify GDB of machine halt, reboot or power off
  MN10300: Use KGDB
  MN10300: Create generic kernel debugger hooks
  MN10300: Create general kernel debugger cache flushing
  MN10300: Introduce a general config option for kernel debugger hooks
  MN10300: The icache invalidate functions should disable the icache first
  MN10300: gdbstub: Restrict single-stepping to non-preemptable non-SMP configs
parents 6d1e9a42 5a4b65ab
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@ config MN10300
	select HAVE_OPROFILE
	select HAVE_GENERIC_HARDIRQS
	select GENERIC_HARDIRQS_NO_DEPRECATED
	select HAVE_ARCH_TRACEHOOK
	select HAVE_ARCH_KGDB

config AM33_2
	def_bool n
@@ -401,9 +403,9 @@ comment "[!] NOTE: A lower number/level indicates a higher priority (0 is highes
comment "____Non-maskable interrupt levels____"
comment "The following must be set to a higher priority than local_irq_disable() and on-chip serial"

config GDBSTUB_IRQ_LEVEL
	int "GDBSTUB interrupt priority"
	depends on GDBSTUB
config DEBUGGER_IRQ_LEVEL
	int "DEBUGGER interrupt priority"
	depends on KERNEL_DEBUGGER
	range 0 1 if LINUX_CLI_LEVEL = 2
	range 0 2 if LINUX_CLI_LEVEL = 3
	range 0 3 if LINUX_CLI_LEVEL = 4
@@ -437,7 +439,7 @@ config LINUX_CLI_LEVEL
	  EPSW.IM from 7.  Any interrupt is permitted for which the level is
	  lower than EPSW.IM.

	  Certain interrupts, such as GDBSTUB and virtual MN10300 on-chip
	  Certain interrupts, such as DEBUGGER and virtual MN10300 on-chip
	  serial DMA interrupts are allowed to interrupt normal disabled
	  sections.

+16 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ config KPROBES

config GDBSTUB
	bool "Remote GDB kernel debugging"
	depends on DEBUG_KERNEL
	depends on DEBUG_KERNEL && DEPRECATED
	select DEBUG_INFO
	select FRAME_POINTER
	help
@@ -46,6 +46,9 @@ config GDBSTUB
	  RAM to avoid excessive linking time. This is only useful for kernel
	  hackers. If unsure, say N.

	  This is deprecated in favour of KGDB and will be removed in a later
	  version.

config GDBSTUB_IMMEDIATE
	bool "Break into GDB stub immediately"
	depends on GDBSTUB
@@ -54,6 +57,14 @@ config GDBSTUB_IMMEDIATE
	  possible, leaving the program counter at the beginning of
	  start_kernel() in init/main.c.

config GDBSTUB_ALLOW_SINGLE_STEP
	bool "Allow software single-stepping in GDB stub"
	depends on GDBSTUB && !SMP && !PREEMPT
	help
	  Allow GDB stub to perform software single-stepping through the
	  kernel.  This doesn't work very well on SMP or preemptible kernels as
	  it uses temporary breakpoints to emulate single-stepping.

config GDB_CONSOLE
	bool "Console output to GDB"
	depends on GDBSTUB
@@ -142,3 +153,7 @@ config GDBSTUB_ON_TTYSx
	default y

endmenu

config KERNEL_DEBUGGER
	def_bool y
	depends on GDBSTUB || KGDB
+43 −0
Original line number Diff line number Diff line
/* Kernel debugger for MN10300
 *
 * Copyright (C) 2011 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public Licence
 * as published by the Free Software Foundation; either version
 * 2 of the Licence, or (at your option) any later version.
 */

#ifndef _ASM_DEBUGGER_H
#define _ASM_DEBUGGER_H

#if defined(CONFIG_KERNEL_DEBUGGER)

extern int debugger_intercept(enum exception_code, int, int, struct pt_regs *);
extern int at_debugger_breakpoint(struct pt_regs *);

#ifndef CONFIG_MN10300_DEBUGGER_CACHE_NO_FLUSH
extern void debugger_local_cache_flushinv(void);
extern void debugger_local_cache_flushinv_one(u8 *);
#else
static inline void debugger_local_cache_flushinv(void) {}
static inline void debugger_local_cache_flushinv_one(u8 *addr) {}
#endif

#else /* CONFIG_KERNEL_DEBUGGER */

static inline int debugger_intercept(enum exception_code excep,
				     int signo, int si_code,
				     struct pt_regs *regs)
{
	return 0;
}

static inline int at_debugger_breakpoint(struct pt_regs *regs)
{
	return 0;
}

#endif /* CONFIG_KERNEL_DEBUGGER */
#endif /* _ASM_DEBUGGER_H */
+17 −4
Original line number Diff line number Diff line
@@ -15,6 +15,19 @@

extern void ____unhandled_size_in_do_div___(void);

/*
 * Beginning with gcc 4.6, the MDR register is represented explicitly.  We
 * must, therefore, at least explicitly clobber the register when we make
 * changes to it.  The following assembly fragments *could* be rearranged in
 * order to leave the moves to/from the MDR register to the compiler, but the
 * gains would be minimal at best.
 */
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
# define CLOBBER_MDR_CC		"mdr", "cc"
#else
# define CLOBBER_MDR_CC		"cc"
#endif

/*
 * divide n by base, leaving the result in n and returning the remainder
 * - we can do this quite efficiently on the MN10300 by cascading the divides
@@ -29,7 +42,7 @@ extern void ____unhandled_size_in_do_div___(void);
		    "mov	mdr,%1	\n"				\
		    : "+r"(n), "=d"(__rem)				\
		    : "r"(base), "1"(__rem)				\
		    : "cc"						\
		    : CLOBBER_MDR_CC					\
		    );							\
	} else if (sizeof(n) <= 8) {					\
		union {							\
@@ -48,7 +61,7 @@ extern void ____unhandled_size_in_do_div___(void);
		    : "=d"(__rem), "=r"(__quot.w[1]), "=r"(__quot.w[0])	\
		    : "r"(base), "0"(__rem), "1"(__quot.w[1]),		\
		      "2"(__quot.w[0])					\
		    : "cc"						\
		    : CLOBBER_MDR_CC					\
		    );							\
		n = __quot.l;						\
	} else {							\
@@ -72,7 +85,7 @@ unsigned __muldiv64u(unsigned val, unsigned mult, unsigned div)
					 * MDR = MDR:val%div */
	    : "=r"(result)
	    : "0"(val), "ir"(mult), "r"(div)
	    : "cc"
	    : CLOBBER_MDR_CC
	    );

	return result;
@@ -93,7 +106,7 @@ signed __muldiv64s(signed val, signed mult, signed div)
					 * MDR = MDR:val%div */
	    : "=r"(result)
	    : "0"(val), "ir"(mult), "r"(div)
	    : "cc"
	    : CLOBBER_MDR_CC
	    );

	return result;
+0 −2
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ static inline void clear_using_fpu(struct task_struct *tsk)

extern asmlinkage void fpu_kill_state(struct task_struct *);
extern asmlinkage void fpu_exception(struct pt_regs *, enum exception_code);
extern asmlinkage void fpu_invalid_op(struct pt_regs *, enum exception_code);
extern asmlinkage void fpu_init_state(void);
extern asmlinkage void fpu_save(struct fpu_state_struct *);
extern int fpu_setup_sigcontext(struct fpucontext *buf);
@@ -113,7 +112,6 @@ static inline void flush_fpu(void)

extern asmlinkage
void unexpected_fpu_exception(struct pt_regs *, enum exception_code);
#define fpu_invalid_op unexpected_fpu_exception
#define fpu_exception unexpected_fpu_exception

struct task_struct;
Loading