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

Commit e8f4aa60 authored by Allen Pais's avatar Allen Pais Committed by David S. Miller
Browse files

sparc64:Support User Probes for sparc

parent 69973b83
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ config KPROBES_ON_FTRACE

config UPROBES
	def_bool n
	depends on ARCH_SUPPORTS_UPROBES
	help
	  Uprobes is the user-space counterpart to kprobes: they
	  enable instrumentation applications (such as 'perf probe')
+3 −0
Original line number Diff line number Diff line
@@ -155,6 +155,9 @@ config PGTABLE_LEVELS
	default 4 if 64BIT
	default 3

config ARCH_SUPPORTS_UPROBES
	def_bool y if SPARC64

source "init/Kconfig"

source "kernel/Kconfig.freezer"
+1 −0
Original line number Diff line number Diff line
@@ -213,6 +213,7 @@ CONFIG_SCHEDSTATS=y
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
CONFIG_SYSCTL_SYSCALL_CHECK=y
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_UPROBE_EVENTS=y
CONFIG_KEYS=y
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_TEST=m
+2 −0
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ enum die_val {
	DIE_OOPS = 1,
	DIE_DEBUG,	/* ta 0x70 */
	DIE_DEBUG_2,	/* ta 0x71 */
	DIE_BPT,	/* ta 0x73 */
	DIE_SSTEP,	/* ta 0x74 */
	DIE_DIE,
	DIE_TRAP,
	DIE_TRAP_TL1,
+34 −1
Original line number Diff line number Diff line
@@ -61,7 +61,10 @@ extern union global_cpu_snapshot global_cpu_snapshot[NR_CPUS];
#define force_successful_syscall_return() set_thread_noerror(1)
#define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV))
#define instruction_pointer(regs) ((regs)->tpc)
#define instruction_pointer_set(regs, val) ((regs)->tpc = (val))
#define instruction_pointer_set(regs, val) do { \
		(regs)->tpc = (val); \
		(regs)->tnpc = (val)+4; \
	} while (0)
#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
static inline int is_syscall_success(struct pt_regs *regs)
{
@@ -77,6 +80,36 @@ unsigned long profile_pc(struct pt_regs *);
#else
#define profile_pc(regs) instruction_pointer(regs)
#endif

#define MAX_REG_OFFSET (offsetof(struct pt_regs, magic))

extern int regs_query_register_offset(const char *name);

/**
 * regs_get_register() - get register value from its offset
 * @regs:	pt_regs from which register value is gotten
 * @offset:	offset number of the register.
 *
 * regs_get_register returns the value of a register whose
 * offset from @regs. The @offset is the offset of the register
 * in struct pt_regs. If @offset is bigger than MAX_REG_OFFSET,
 * this returns 0.
 */
static inline unsigned long regs_get_register(struct pt_regs *regs,
					     unsigned long offset)
{
	if (unlikely(offset >= MAX_REG_OFFSET))
		return 0;
	if (offset == PT_V9_Y)
		return *(unsigned int *)((unsigned long)regs + offset);
	return *(unsigned long *)((unsigned long)regs + offset);
}

/* Valid only for Kernel mode traps. */
static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
{
	return regs->u_regs[UREG_I6];
}
#else /* __ASSEMBLY__ */
#endif /* __ASSEMBLY__ */
#else /* (defined(__sparc__) && defined(__arch64__)) */
Loading