blob: 5b18ec124e513b6476e2dcc8d808b25bbe1abe7a [file] [log] [blame]
Michal Simek2b438452009-03-27 14:25:27 +01001/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
Michal Simek2b438452009-03-27 14:25:27 +01008#ifndef _ASM_MICROBLAZE_PTRACE_H
9#define _ASM_MICROBLAZE_PTRACE_H
10
David Howells3cb0eab2012-10-09 09:47:10 +010011#include <uapi/asm/ptrace.h>
12
Michal Simek2b438452009-03-27 14:25:27 +010013#ifndef __ASSEMBLY__
Michal Simekac3efab2009-04-16 10:58:47 +020014#define kernel_mode(regs) ((regs)->pt_mode)
Michal Simek2b438452009-03-27 14:25:27 +010015#define user_mode(regs) (!kernel_mode(regs))
16
17#define instruction_pointer(regs) ((regs)->pc)
18#define profile_pc(regs) instruction_pointer(regs)
Al Viro5208ba22012-12-14 01:50:19 -050019#define user_stack_pointer(regs) ((regs)->r1)
Michal Simek2b438452009-03-27 14:25:27 +010020
Eric Parisd7e75282012-01-03 14:23:06 -050021static inline long regs_return_value(struct pt_regs *regs)
22{
23 return regs->r3;
24}
25
Michal Simek2b438452009-03-27 14:25:27 +010026#endif /* __ASSEMBLY__ */
Michal Simek2b438452009-03-27 14:25:27 +010027#endif /* _ASM_MICROBLAZE_PTRACE_H */