mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 21:54:11 +08:00
f324fa5832
When setting the instruction pointer on PA-RISC we also need
to set the back of the instruction queue to the new offset, otherwise
we will execute on instruction from the new location, and jumping
back to the old location stored in iaoq_b.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Fixes: 75ebedf1d2
("parisc: Add HAVE_REGS_AND_STACK_ACCESS_API feature")
Cc: stable@vger.kernel.org # 4.19+
41 lines
1.2 KiB
C
41 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* written by Philipp Rumpf, Copyright (C) 1999 SuSE GmbH Nuernberg
|
|
** Copyright (C) 2000 Grant Grundler, Hewlett-Packard
|
|
*/
|
|
#ifndef _PARISC_PTRACE_H
|
|
#define _PARISC_PTRACE_H
|
|
|
|
#include <uapi/asm/ptrace.h>
|
|
|
|
|
|
#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
|
|
|
|
#define arch_has_single_step() 1
|
|
#define arch_has_block_step() 1
|
|
|
|
/* XXX should we use iaoq[1] or iaoq[0] ? */
|
|
#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0)
|
|
#define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0)
|
|
#define instruction_pointer(regs) ((regs)->iaoq[0] & ~3)
|
|
#define user_stack_pointer(regs) ((regs)->gr[30])
|
|
unsigned long profile_pc(struct pt_regs *);
|
|
|
|
static inline unsigned long regs_return_value(struct pt_regs *regs)
|
|
{
|
|
return regs->gr[28];
|
|
}
|
|
|
|
static inline void instruction_pointer_set(struct pt_regs *regs,
|
|
unsigned long val)
|
|
{
|
|
regs->iaoq[0] = val;
|
|
regs->iaoq[1] = val + 4;
|
|
}
|
|
|
|
/* Query offset/name of register from its name/offset */
|
|
extern int regs_query_register_offset(const char *name);
|
|
extern const char *regs_query_register_name(unsigned int offset);
|
|
#define MAX_REG_OFFSET (offsetof(struct pt_regs, ipsw))
|
|
|
|
#endif
|