1178172Simp/* $OpenBSD: proc.h,v 1.2 1998/09/15 10:50:12 pefo Exp $ */ 2178172Simp 3178172Simp/*- 4178172Simp * Copyright (c) 1992, 1993 5178172Simp * The Regents of the University of California. All rights reserved. 6178172Simp * 7178172Simp * This code is derived from software contributed to Berkeley by 8178172Simp * Ralph Campbell. 9178172Simp * 10178172Simp * Redistribution and use in source and binary forms, with or without 11178172Simp * modification, are permitted provided that the following conditions 12178172Simp * are met: 13178172Simp * 1. Redistributions of source code must retain the above copyright 14178172Simp * notice, this list of conditions and the following disclaimer. 15178172Simp * 2. Redistributions in binary form must reproduce the above copyright 16178172Simp * notice, this list of conditions and the following disclaimer in the 17178172Simp * documentation and/or other materials provided with the distribution. 18178172Simp * 4. Neither the name of the University nor the names of its contributors 19178172Simp * may be used to endorse or promote products derived from this software 20178172Simp * without specific prior written permission. 21178172Simp * 22178172Simp * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23178172Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24178172Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25178172Simp * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26178172Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27178172Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28178172Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29178172Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30178172Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31178172Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32178172Simp * SUCH DAMAGE. 33178172Simp * 34178172Simp * @(#)proc.h 8.1 (Berkeley) 6/10/93 35178172Simp * JNPR: proc.h,v 1.7.2.1 2007/09/10 06:25:24 girish 36178172Simp * $FreeBSD: stable/11/sys/mips/include/proc.h 351793 2019-09-03 20:23:58Z kevans $ 37178172Simp */ 38178172Simp 39178172Simp#ifndef _MACHINE_PROC_H_ 40178172Simp#define _MACHINE_PROC_H_ 41178172Simp 42229677Sgonzo#ifdef CPU_CNMIPS 43229677Sgonzo#include <machine/octeon_cop2.h> 44229677Sgonzo#endif 45229677Sgonzo 46178172Simp/* 47178172Simp * Machine-dependent part of the proc structure. 48178172Simp */ 49178172Simpstruct mdthread { 50217354Sjchandra int md_flags; /* machine-dependent flags */ 51217354Sjchandra#if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */ 52217354Sjchandra uint64_t md_upte[KSTACK_PAGES]; /* ptes for mapping u pcb */ 53217354Sjchandra#else 54217354Sjchandra int md_upte[KSTACK_PAGES]; 55217354Sjchandra#endif 56217354Sjchandra int md_ss_addr; /* single step address for ptrace */ 57217354Sjchandra int md_ss_instr; /* single step instruction for ptrace */ 58178172Simp register_t md_saved_intr; 59217354Sjchandra u_int md_spinlock_count; 60178172Simp/* The following is CPU dependent, but kept in for compatibility */ 61217354Sjchandra int md_pc_ctrl; /* performance counter control */ 62217354Sjchandra int md_pc_count; /* performance counter */ 63217354Sjchandra int md_pc_spill; /* performance counter spill */ 64217354Sjchandra void *md_tls; 65229677Sgonzo#ifdef CPU_CNMIPS 66229677Sgonzo struct octeon_cop2_state *md_cop2; /* kernel context */ 67229677Sgonzo struct octeon_cop2_state *md_ucop2; /* userland context */ 68229677Sgonzo#define COP2_OWNER_USERLAND 0x0000 /* Userland owns COP2 */ 69229677Sgonzo#define COP2_OWNER_KERNEL 0x0001 /* Kernel owns COP2 */ 70229677Sgonzo int md_cop2owner; 71229677Sgonzo#endif 72178172Simp}; 73178172Simp 74178172Simp/* md_flags */ 75178172Simp#define MDTD_FPUSED 0x0001 /* Process used the FPU */ 76229677Sgonzo#define MDTD_COP2USED 0x0002 /* Process used the COP2 */ 77178172Simp 78178172Simpstruct mdproc { 79351793Skevans /* Avoid empty structs because they are undefined behavior. */ 80351793Skevans long md_spare; 81178172Simp}; 82178172Simp 83226065Skibstruct syscall_args { 84226065Skib u_int code; 85226065Skib struct sysent *callp; 86226065Skib register_t args[8]; 87226065Skib int narg; 88226065Skib struct trapframe *trapframe; 89226065Skib}; 90226065Skib 91207152Skib#ifdef __mips_n64 92207269Skib#define KINFO_PROC_SIZE 1088 93232449Sjmallett#define KINFO_PROC32_SIZE 816 94207152Skib#else 95207269Skib#define KINFO_PROC_SIZE 816 96207152Skib#endif 97207152Skib 98178172Simp#endif /* !_MACHINE_PROC_H_ */ 99