18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef __UM_PTRACE_GENERIC_H 78c2ecf20Sopenharmony_ci#define __UM_PTRACE_GENERIC_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#include <sysdep/ptrace.h> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_cistruct pt_regs { 148c2ecf20Sopenharmony_ci struct uml_pt_regs regs; 158c2ecf20Sopenharmony_ci}; 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#define arch_has_single_step() (1) 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS } 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#define PT_REGS_IP(r) UPT_IP(&(r)->regs) 228c2ecf20Sopenharmony_ci#define PT_REGS_SP(r) UPT_SP(&(r)->regs) 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#define PT_REGS_RESTART_SYSCALL(r) UPT_RESTART_SYSCALL(&(r)->regs) 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci#define PT_REGS_SYSCALL_NR(r) UPT_SYSCALL_NR(&(r)->regs) 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci#define instruction_pointer(regs) PT_REGS_IP(regs) 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#define PTRACE_OLDSETOPTIONS 21 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_cistruct task_struct; 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciextern long subarch_ptrace(struct task_struct *child, long request, 358c2ecf20Sopenharmony_ci unsigned long addr, unsigned long data); 368c2ecf20Sopenharmony_ciextern unsigned long getreg(struct task_struct *child, int regno); 378c2ecf20Sopenharmony_ciextern int putreg(struct task_struct *child, int regno, unsigned long value); 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciextern int arch_set_tls(struct task_struct *new, unsigned long tls); 408c2ecf20Sopenharmony_ciextern void clear_flushed_tls(struct task_struct *task); 418c2ecf20Sopenharmony_ciextern int syscall_trace_enter(struct pt_regs *regs); 428c2ecf20Sopenharmony_ciextern void syscall_trace_leave(struct pt_regs *regs); 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci#endif 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci#endif 47