1a9643ea8Slogwang /* $OpenBSD: proc.h,v 1.2 1998/09/15 10:50:12 pefo Exp $ */ 2a9643ea8Slogwang 3a9643ea8Slogwang /*- 4*22ce4affSfengbojiang * SPDX-License-Identifier: BSD-3-Clause 5*22ce4affSfengbojiang * 6a9643ea8Slogwang * Copyright (c) 1992, 1993 7a9643ea8Slogwang * The Regents of the University of California. All rights reserved. 8a9643ea8Slogwang * 9a9643ea8Slogwang * This code is derived from software contributed to Berkeley by 10a9643ea8Slogwang * Ralph Campbell. 11a9643ea8Slogwang * 12a9643ea8Slogwang * Redistribution and use in source and binary forms, with or without 13a9643ea8Slogwang * modification, are permitted provided that the following conditions 14a9643ea8Slogwang * are met: 15a9643ea8Slogwang * 1. Redistributions of source code must retain the above copyright 16a9643ea8Slogwang * notice, this list of conditions and the following disclaimer. 17a9643ea8Slogwang * 2. Redistributions in binary form must reproduce the above copyright 18a9643ea8Slogwang * notice, this list of conditions and the following disclaimer in the 19a9643ea8Slogwang * documentation and/or other materials provided with the distribution. 20*22ce4affSfengbojiang * 3. Neither the name of the University nor the names of its contributors 21a9643ea8Slogwang * may be used to endorse or promote products derived from this software 22a9643ea8Slogwang * without specific prior written permission. 23a9643ea8Slogwang * 24a9643ea8Slogwang * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25a9643ea8Slogwang * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26a9643ea8Slogwang * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27a9643ea8Slogwang * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28a9643ea8Slogwang * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29a9643ea8Slogwang * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30a9643ea8Slogwang * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31a9643ea8Slogwang * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32a9643ea8Slogwang * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33a9643ea8Slogwang * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34a9643ea8Slogwang * SUCH DAMAGE. 35a9643ea8Slogwang * 36a9643ea8Slogwang * @(#)proc.h 8.1 (Berkeley) 6/10/93 37a9643ea8Slogwang * JNPR: proc.h,v 1.7.2.1 2007/09/10 06:25:24 girish 38a9643ea8Slogwang * $FreeBSD$ 39a9643ea8Slogwang */ 40a9643ea8Slogwang 41a9643ea8Slogwang #ifndef _MACHINE_PROC_H_ 42a9643ea8Slogwang #define _MACHINE_PROC_H_ 43a9643ea8Slogwang 44a9643ea8Slogwang #ifdef CPU_CNMIPS 45a9643ea8Slogwang #include <machine/octeon_cop2.h> 46a9643ea8Slogwang #endif 47a9643ea8Slogwang 48a9643ea8Slogwang /* 49a9643ea8Slogwang * Machine-dependent part of the proc structure. 50a9643ea8Slogwang */ 51a9643ea8Slogwang struct mdthread { 52a9643ea8Slogwang int md_flags; /* machine-dependent flags */ 53a9643ea8Slogwang #if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */ 54a9643ea8Slogwang uint64_t md_upte[KSTACK_PAGES]; /* ptes for mapping u pcb */ 55a9643ea8Slogwang #else 56a9643ea8Slogwang int md_upte[KSTACK_PAGES]; 57a9643ea8Slogwang #endif 58*22ce4affSfengbojiang uintptr_t md_ss_addr; /* single step address for ptrace */ 59a9643ea8Slogwang int md_ss_instr; /* single step instruction for ptrace */ 60a9643ea8Slogwang register_t md_saved_intr; 61a9643ea8Slogwang u_int md_spinlock_count; 62a9643ea8Slogwang /* The following is CPU dependent, but kept in for compatibility */ 63a9643ea8Slogwang int md_pc_ctrl; /* performance counter control */ 64a9643ea8Slogwang int md_pc_count; /* performance counter */ 65a9643ea8Slogwang int md_pc_spill; /* performance counter spill */ 66a9643ea8Slogwang void *md_tls; 67a9643ea8Slogwang #ifdef CPU_CNMIPS 68a9643ea8Slogwang struct octeon_cop2_state *md_cop2; /* kernel context */ 69a9643ea8Slogwang struct octeon_cop2_state *md_ucop2; /* userland context */ 70a9643ea8Slogwang #define COP2_OWNER_USERLAND 0x0000 /* Userland owns COP2 */ 71a9643ea8Slogwang #define COP2_OWNER_KERNEL 0x0001 /* Kernel owns COP2 */ 72a9643ea8Slogwang int md_cop2owner; 73a9643ea8Slogwang #endif 74a9643ea8Slogwang }; 75a9643ea8Slogwang 76a9643ea8Slogwang /* md_flags */ 77a9643ea8Slogwang #define MDTD_FPUSED 0x0001 /* Process used the FPU */ 78a9643ea8Slogwang #define MDTD_COP2USED 0x0002 /* Process used the COP2 */ 79a9643ea8Slogwang 80a9643ea8Slogwang struct mdproc { 81*22ce4affSfengbojiang size_t md_tls_tcb_offset; /* TCB offset */ 82a9643ea8Slogwang }; 83a9643ea8Slogwang 84*22ce4affSfengbojiang #define MAXARGS 8 85a9643ea8Slogwang struct syscall_args { 86a9643ea8Slogwang u_int code; 87a9643ea8Slogwang struct sysent *callp; 88*22ce4affSfengbojiang register_t args[MAXARGS]; 89a9643ea8Slogwang }; 90a9643ea8Slogwang 91a9643ea8Slogwang #ifdef __mips_n64 92a9643ea8Slogwang #define KINFO_PROC_SIZE 1088 93a9643ea8Slogwang #define KINFO_PROC32_SIZE 816 94a9643ea8Slogwang #else 95a9643ea8Slogwang #define KINFO_PROC_SIZE 816 96a9643ea8Slogwang #endif 97a9643ea8Slogwang 98a9643ea8Slogwang #endif /* !_MACHINE_PROC_H_ */ 99