diff options
| -rw-r--r-- | arch/tile/kernel/kgdb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/tile/kernel/kgdb.c b/arch/tile/kernel/kgdb.c index a506c2c28943..6ad99925900e 100644 --- a/arch/tile/kernel/kgdb.c +++ b/arch/tile/kernel/kgdb.c | |||
| @@ -126,15 +126,15 @@ void | |||
| 126 | sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task) | 126 | sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task) |
| 127 | { | 127 | { |
| 128 | struct pt_regs *thread_regs; | 128 | struct pt_regs *thread_regs; |
| 129 | const int NGPRS = TREG_LAST_GPR + 1; | ||
| 129 | 130 | ||
| 130 | if (task == NULL) | 131 | if (task == NULL) |
| 131 | return; | 132 | return; |
| 132 | 133 | ||
| 133 | /* Initialize to zero. */ | ||
| 134 | memset(gdb_regs, 0, NUMREGBYTES); | ||
| 135 | |||
| 136 | thread_regs = task_pt_regs(task); | 134 | thread_regs = task_pt_regs(task); |
| 137 | memcpy(gdb_regs, thread_regs, TREG_LAST_GPR * sizeof(unsigned long)); | 135 | memcpy(gdb_regs, thread_regs, NGPRS * sizeof(unsigned long)); |
| 136 | memset(&gdb_regs[NGPRS], 0, | ||
| 137 | (TILEGX_PC_REGNUM - NGPRS) * sizeof(unsigned long)); | ||
| 138 | gdb_regs[TILEGX_PC_REGNUM] = thread_regs->pc; | 138 | gdb_regs[TILEGX_PC_REGNUM] = thread_regs->pc; |
| 139 | gdb_regs[TILEGX_FAULTNUM_REGNUM] = thread_regs->faultnum; | 139 | gdb_regs[TILEGX_FAULTNUM_REGNUM] = thread_regs->faultnum; |
| 140 | } | 140 | } |
