On Wed, Apr 15, 2020 at 6:59 PM Sumit Garg <sumit.g...@linaro.org> wrote: > > On Sun, 12 Apr 2020 at 08:19, Vincent Chen <vincent.c...@sifive.com> wrote: > > > > The skeleton of RISC-V KGDB port. > > > > Signed-off-by: Vincent Chen <vincent.c...@sifive.com> > > Reviewed-by: Palmer Dabbelt <palmerdabb...@google.com> > > --- > > arch/riscv/Kconfig | 1 + > > arch/riscv/include/asm/kdebug.h | 12 +++ > > arch/riscv/include/asm/kgdb.h | 107 +++++++++++++++++++++ > > arch/riscv/kernel/Makefile | 1 + > > arch/riscv/kernel/kgdb.c | 200 > > ++++++++++++++++++++++++++++++++++++++++ > > arch/riscv/kernel/traps.c | 5 + > > 6 files changed, 326 insertions(+) > > create mode 100644 arch/riscv/include/asm/kdebug.h > > create mode 100644 arch/riscv/include/asm/kgdb.h > > create mode 100644 arch/riscv/kernel/kgdb.c > > > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > > index a197258595ef..7db9a81cda75 100644 > > --- a/arch/riscv/Kconfig > > +++ b/arch/riscv/Kconfig > > @@ -68,6 +68,7 @@ config RISCV > > select ARCH_HAS_GCOV_PROFILE_ALL > > select HAVE_COPY_THREAD_TLS > > select HAVE_ARCH_KASAN if MMU && 64BIT > > + select HAVE_ARCH_KGDB > > > > config ARCH_MMAP_RND_BITS_MIN > > default 18 if 64BIT > > diff --git a/arch/riscv/include/asm/kdebug.h > > b/arch/riscv/include/asm/kdebug.h > > new file mode 100644 > > index 000000000000..85ac00411f6e > > --- /dev/null > > +++ b/arch/riscv/include/asm/kdebug.h > > @@ -0,0 +1,12 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > + > > +#ifndef _ASM_ARC_KDEBUG_H > > +#define _ASM_ARC_KDEBUG_H > > + > > +enum die_val { > > + DIE_UNUSED, > > + DIE_TRAP, > > + DIE_OOPS > > +}; > > + > > +#endif > > diff --git a/arch/riscv/include/asm/kgdb.h b/arch/riscv/include/asm/kgdb.h > > new file mode 100644 > > index 000000000000..69bc6a03081d > > --- /dev/null > > +++ b/arch/riscv/include/asm/kgdb.h > > @@ -0,0 +1,107 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > + > > +#ifndef __ASM_KGDB_H_ > > +#define __ASM_KGDB_H_ > > + > > +#ifdef __KERNEL__ > > + > > +#define GDB_SIZEOF_REG sizeof(unsigned long) > > + > > +#define DBG_MAX_REG_NUM (33) > > +#define NUMREGBYTES ((DBG_MAX_REG_NUM) * GDB_SIZEOF_REG) > > +#define CACHE_FLUSH_IS_SAFE 1 > > [...] > > > +#define BUFMAX 2048 > > +#ifdef CONFIG_RISCV_ISA_C > > +#define BREAK_INSTR_SIZE 2 > > +#else > > +#define BREAK_INSTR_SIZE 4 > > +#endif > > +#define CACHE_FLUSH_IS_SAFE 1 > > double macro definition? > Sorry for my neglect. I will remove the duplicated one in the next version patch. Thanks for your reminder.
_______________________________________________ Kgdb-bugreport mailing list Kgdb-bugreport@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport