diff options
Diffstat (limited to 'arch/h8300/include/asm')
-rw-r--r-- | arch/h8300/include/asm/io.h | 8 | ||||
-rw-r--r-- | arch/h8300/include/asm/kgdb.h | 45 | ||||
-rw-r--r-- | arch/h8300/include/asm/traps.h | 2 |
3 files changed, 50 insertions, 5 deletions
diff --git a/arch/h8300/include/asm/io.h b/arch/h8300/include/asm/io.h index f0e14f3a800d..2e221c5f0203 100644 --- a/arch/h8300/include/asm/io.h +++ b/arch/h8300/include/asm/io.h @@ -44,17 +44,17 @@ static inline void __raw_writel(u32 b, const volatile void __iomem *addr) static inline void ctrl_bclr(int b, void __iomem *addr) { if (__builtin_constant_p(b)) - __asm__("bclr %1,%0" : "+WU"(*addr): "i"(b)); + __asm__("bclr %1,%0" : "+WU"(*(u8 *)addr): "i"(b)); else - __asm__("bclr %w1,%0" : "+WU"(*addr): "r"(b)); + __asm__("bclr %w1,%0" : "+WU"(*(u8 *)addr): "r"(b)); } static inline void ctrl_bset(int b, void __iomem *addr) { if (__builtin_constant_p(b)) - __asm__("bset %1,%0" : "+WU"(*addr): "i"(b)); + __asm__("bset %1,%0" : "+WU"(*(u8 *)addr): "i"(b)); else - __asm__("bset %w1,%0" : "+WU"(*addr): "r"(b)); + __asm__("bset %w1,%0" : "+WU"(*(u8 *)addr): "r"(b)); } #include <asm-generic/io.h> diff --git a/arch/h8300/include/asm/kgdb.h b/arch/h8300/include/asm/kgdb.h new file mode 100644 index 000000000000..726ff8fdfc18 --- /dev/null +++ b/arch/h8300/include/asm/kgdb.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2015 Yoshinori Sato <ysato@users.sourceforge.jp> + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#ifndef _ASM_H8300_KGDB_H +#define _ASM_H8300_KGDB_H + +#define CACHE_FLUSH_IS_SAFE 1 +#define BUFMAX 2048 + +enum regnames { + GDB_ER0, GDB_ER1, GDB_ER2, GDB_ER3, + GDB_ER4, GDB_ER5, GDB_ER6, GDB_SP, + GDB_CCR, GDB_PC, + GDB_CYCLLE, +#if defined(CONFIG_CPU_H8S) + GDB_EXR, +#endif + GDB_TICK, GDB_INST, +#if defined(CONFIG_CPU_H8S) + GDB_MACH, GDB_MACL, +#endif + /* do not change the last entry or anything below! */ + GDB_NUMREGBYTES, /* number of registers */ +}; + +#define GDB_SIZEOF_REG sizeof(u32) +#if defined(CONFIG_CPU_H8300H) +#define DBG_MAX_REG_NUM (13) +#elif defined(CONFIG_CPU_H8S) +#define DBG_MAX_REG_NUM (14) +#endif +#define NUMREGBYTES (DBG_MAX_REG_NUM * GDB_SIZEOF_REG) + +#define BREAK_INSTR_SIZE 2 +static inline void arch_kgdb_breakpoint(void) +{ + __asm__ __volatile__("trapa #2"); +} + +#endif /* _ASM_H8300_KGDB_H */ diff --git a/arch/h8300/include/asm/traps.h b/arch/h8300/include/asm/traps.h index aa34e75fd767..15e701130b27 100644 --- a/arch/h8300/include/asm/traps.h +++ b/arch/h8300/include/asm/traps.h @@ -36,6 +36,6 @@ extern unsigned long *_interrupt_redirect_table; extern char _start, _etext; #define check_kernel_text(addr) \ ((addr >= (unsigned long)(&_start)) && \ - (addr < (unsigned long)(&_etext))) + (addr < (unsigned long)(&_etext)) && !(addr & 1)) #endif /* _H8300_TRAPS_H */ |