1280364Sandrew/*-
2280364Sandrew * Copyright (c) 1991 Regents of the University of California.
3280364Sandrew * All rights reserved.
4280364Sandrew *
5280364Sandrew * Redistribution and use in source and binary forms, with or without
6280364Sandrew * modification, are permitted provided that the following conditions
7280364Sandrew * are met:
8280364Sandrew * 1. Redistributions of source code must retain the above copyright
9280364Sandrew *    notice, this list of conditions and the following disclaimer.
10280364Sandrew * 2. Redistributions in binary form must reproduce the above copyright
11280364Sandrew *    notice, this list of conditions and the following disclaimer in the
12280364Sandrew *    documentation and/or other materials provided with the distribution.
13280381Semaste * 3. Neither the name of the University nor the names of its contributors
14280364Sandrew *    may be used to endorse or promote products derived from this software
15280364Sandrew *    without specific prior written permission.
16280364Sandrew *
17280364Sandrew * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18280364Sandrew * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19280364Sandrew * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20280364Sandrew * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21280364Sandrew * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22280364Sandrew * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23280364Sandrew * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24280364Sandrew * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25280364Sandrew * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26280364Sandrew * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27280364Sandrew * SUCH DAMAGE.
28280364Sandrew *
29280364Sandrew *      from: @(#)proc.h        7.1 (Berkeley) 5/15/91
30280364Sandrew *	from: FreeBSD: src/sys/i386/include/proc.h,v 1.11 2001/06/29
31280364Sandrew * $FreeBSD: stable/11/sys/arm64/include/proc.h 334954 2018-06-11 15:43:28Z markj $
32280364Sandrew */
33280364Sandrew
34280364Sandrew#ifndef	_MACHINE_PROC_H_
35280364Sandrew#define	_MACHINE_PROC_H_
36280364Sandrew
37280364Sandrewstruct mdthread {
38280364Sandrew	int	md_spinlock_count;	/* (k) */
39280364Sandrew	register_t md_saved_daif;	/* (k) */
40280364Sandrew};
41280364Sandrew
42280364Sandrewstruct mdproc {
43280364Sandrew	int dummy;
44280364Sandrew};
45280364Sandrew
46280364Sandrew#define	KINFO_PROC_SIZE	1088
47280364Sandrew
48280364Sandrew#define	MAXARGS		8
49280364Sandrewstruct syscall_args {
50280364Sandrew	u_int code;
51280364Sandrew	struct sysent *callp;
52280364Sandrew	register_t args[MAXARGS];
53280364Sandrew	int narg;
54280364Sandrew};
55280364Sandrew
56334954Smarkj#ifdef _KERNEL
57334954Smarkj
58334954Smarkj#include <machine/pcb.h>
59334954Smarkj
60334954Smarkj#define	GET_STACK_USAGE(total, used) do {				\
61334954Smarkj	struct thread *td = curthread;					\
62334954Smarkj	(total) = td->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb);	\
63334954Smarkj	(used) = (char *)td->td_kstack +				\
64334954Smarkj	    td->td_kstack_pages * PAGE_SIZE -				\
65334954Smarkj	    (char *)&td;						\
66334954Smarkj} while (0)
67334954Smarkj
68334954Smarkj#endif
69334954Smarkj
70280364Sandrew#endif /* !_MACHINE_PROC_H_ */
71