177957Sbenno/*- 277957Sbenno * Copyright (C) 1995, 1996 Wolfgang Solfrank. 377957Sbenno * Copyright (C) 1995, 1996 TooLs GmbH. 477957Sbenno * All rights reserved. 577957Sbenno * 677957Sbenno * Redistribution and use in source and binary forms, with or without 777957Sbenno * modification, are permitted provided that the following conditions 877957Sbenno * are met: 977957Sbenno * 1. Redistributions of source code must retain the above copyright 1077957Sbenno * notice, this list of conditions and the following disclaimer. 1177957Sbenno * 2. Redistributions in binary form must reproduce the above copyright 1277957Sbenno * notice, this list of conditions and the following disclaimer in the 1377957Sbenno * documentation and/or other materials provided with the distribution. 1477957Sbenno * 3. All advertising materials mentioning features or use of this software 1577957Sbenno * must display the following acknowledgement: 1677957Sbenno * This product includes software developed by TooLs GmbH. 1777957Sbenno * 4. The name of TooLs GmbH may not be used to endorse or promote products 1877957Sbenno * derived from this software without specific prior written permission. 1977957Sbenno * 2077957Sbenno * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 2177957Sbenno * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2277957Sbenno * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2377957Sbenno * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2477957Sbenno * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 2577957Sbenno * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 2677957Sbenno * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 2777957Sbenno * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 2877957Sbenno * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 2977957Sbenno * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3077957Sbenno * 3177957Sbenno * $NetBSD: proc.h,v 1.2 1997/04/16 22:57:48 thorpej Exp $ 3277957Sbenno * $FreeBSD: stable/11/sys/powerpc/include/proc.h 321324 2017-07-21 06:56:06Z kib $ 3377957Sbenno */ 3477957Sbenno 3587454Sjhb#ifndef _MACHINE_PROC_H_ 3687454Sjhb#define _MACHINE_PROC_H_ 3787454Sjhb 3877957Sbenno/* 3977957Sbenno * Machine-dependent part of the proc structure 4077957Sbenno */ 4183366Sjulianstruct mdthread { 42144637Sjhb int md_spinlock_count; /* (k) */ 43144637Sjhb register_t md_saved_msr; /* (k) */ 4483366Sjulian}; 4583366Sjulian 4677957Sbennostruct mdproc { 4777957Sbenno}; 4887454Sjhb 49209975Snwhitehorn#ifdef __powerpc64__ 50209975Snwhitehorn#define KINFO_PROC_SIZE 1088 51209975Snwhitehorn#define KINFO_PROC32_SIZE 768 52209975Snwhitehorn#else 53207269Skib#define KINFO_PROC_SIZE 768 54209975Snwhitehorn#endif 55207152Skib 56321324Skibstruct syscall_args { 57321324Skib u_int code; 58321324Skib struct sysent *callp; 59321324Skib register_t args[10]; 60321324Skib int narg; 61321324Skib}; 62321324Skib 63208453Skib#ifdef _KERNEL 64256007Snwhitehorn 65256007Snwhitehorn#include <machine/pcb.h> 66256007Snwhitehorn 67256007Snwhitehorn/* Get the current kernel thread stack usage. */ 68256007Snwhitehorn#define GET_STACK_USAGE(total, used) do { \ 69256007Snwhitehorn struct thread *td = curthread; \ 70256007Snwhitehorn (total) = td->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb); \ 71256007Snwhitehorn (used) = (char *)td->td_kstack + \ 72256007Snwhitehorn td->td_kstack_pages * PAGE_SIZE - \ 73256007Snwhitehorn (char *)&td; \ 74256007Snwhitehorn} while (0) 75208453Skib#endif 76208453Skib 7787454Sjhb#endif /* !_MACHINE_PROC_H_ */ 78