11.16Skamil/* $NetBSD: ptrace.h,v 1.16 2020/09/14 09:47:43 kamil Exp $ */ 21.4Sderaadt 31.1Sderaadt/* 41.1Sderaadt * Copyright (c) 1992, 1993 51.1Sderaadt * The Regents of the University of California. All rights reserved. 61.1Sderaadt * 71.1Sderaadt * This software was developed by the Computer Systems Engineering group 81.1Sderaadt * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 91.1Sderaadt * contributed to Berkeley. 101.1Sderaadt * 111.1Sderaadt * All advertising materials mentioning features or use of this software 121.1Sderaadt * must display the following acknowledgement: 131.1Sderaadt * This product includes software developed by the University of 141.1Sderaadt * California, Lawrence Berkeley Laboratory. 151.1Sderaadt * 161.1Sderaadt * Redistribution and use in source and binary forms, with or without 171.1Sderaadt * modification, are permitted provided that the following conditions 181.1Sderaadt * are met: 191.1Sderaadt * 1. Redistributions of source code must retain the above copyright 201.1Sderaadt * notice, this list of conditions and the following disclaimer. 211.1Sderaadt * 2. Redistributions in binary form must reproduce the above copyright 221.1Sderaadt * notice, this list of conditions and the following disclaimer in the 231.1Sderaadt * documentation and/or other materials provided with the distribution. 241.5Sagc * 3. Neither the name of the University nor the names of its contributors 251.1Sderaadt * may be used to endorse or promote products derived from this software 261.1Sderaadt * without specific prior written permission. 271.1Sderaadt * 281.1Sderaadt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 291.1Sderaadt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 301.1Sderaadt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 311.1Sderaadt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 321.1Sderaadt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 331.1Sderaadt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 341.1Sderaadt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 351.1Sderaadt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 361.1Sderaadt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 371.1Sderaadt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 381.1Sderaadt * SUCH DAMAGE. 391.1Sderaadt * 401.1Sderaadt * @(#)ptrace.h 8.1 (Berkeley) 6/11/93 411.1Sderaadt */ 421.1Sderaadt 431.1Sderaadt/* 441.1Sderaadt * SPARC-dependent ptrace definitions. 451.1Sderaadt */ 461.1Sderaadt#define PT_GETREGS (PT_FIRSTMACH + 0) 471.1Sderaadt#define PT_SETREGS (PT_FIRSTMACH + 1) 481.3Spk#define PT_GETFPREGS (PT_FIRSTMACH + 2) 491.3Spk#define PT_SETFPREGS (PT_FIRSTMACH + 3) 501.7Sskrll 511.7Sskrll#define PT_MACHDEP_STRINGS \ 521.7Sskrll "PT_GETREGS", \ 531.7Sskrll "PT_SETREGS", \ 541.7Sskrll "PT_GETFPREGS", \ 551.7Sskrll "PT_SETFPREGS", 561.8Schristos 571.8Schristos#include <machine/reg.h> 581.16Skamil#define PTRACE_REG_PC(r) ((unsigned long int)(r)->r_pc) 591.14Skamil#define PTRACE_REG_FP(r) 0 /* not stored in struct reg */ 601.8Schristos#define PTRACE_REG_SET_PC(r, v) do { \ 611.8Schristos (r)->r_pc = (v); \ 621.8Schristos (r)->r_npc = (v) + 4; \ 631.8Schristos } while (/*CONSTCOND*/0) 641.16Skamil#define PTRACE_REG_SP(r) ((unsigned long int)(r)->r_out[6]) 651.16Skamil#define PTRACE_REG_INTRV(r) ((unsigned long int)(r)->r_out[0]) 661.9Schristos 671.13Smartin#define PTRACE_ILLEGAL_ASM __asm __volatile (".word 0" : : : "memory") 681.12Smartin 691.9Schristos#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0x91, 0xd0, 0x20, 0x01 }) 701.11Skamil#define PTRACE_BREAKPOINT_ASM __asm __volatile("ta 1") 711.9Schristos#define PTRACE_BREAKPOINT_SIZE 4 721.15Skamil 731.15Skamil#ifdef _KERNEL 741.15Skamil#define PTRACE_LWP_GETPRIVATE(l) (l)->l_md.md_tf->tf_global[7] 751.15Skamil#endif 76