^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef __UM_PTRACE_GENERIC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define __UM_PTRACE_GENERIC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #ifndef __ASSEMBLY__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <sysdep/ptrace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) struct pt_regs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) struct uml_pt_regs regs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define arch_has_single_step() (1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define PT_REGS_IP(r) UPT_IP(&(r)->regs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define PT_REGS_SP(r) UPT_SP(&(r)->regs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define PT_REGS_RESTART_SYSCALL(r) UPT_RESTART_SYSCALL(&(r)->regs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define PT_REGS_SYSCALL_NR(r) UPT_SYSCALL_NR(&(r)->regs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define instruction_pointer(regs) PT_REGS_IP(regs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define PTRACE_OLDSETOPTIONS 21
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct task_struct;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) extern long subarch_ptrace(struct task_struct *child, long request,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) unsigned long addr, unsigned long data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) extern unsigned long getreg(struct task_struct *child, int regno);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) extern int putreg(struct task_struct *child, int regno, unsigned long value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) extern int arch_set_tls(struct task_struct *new, unsigned long tls);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) extern void clear_flushed_tls(struct task_struct *task);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) extern int syscall_trace_enter(struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) extern void syscall_trace_leave(struct pt_regs *regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #endif