xref: /netbsd-src/sys/arch/amd64/include/proc.h (revision 8e7ee4c1cbaefeb35deb8b4bc77093841db8f596)
1*8e7ee4c1Sad /*	$NetBSD: proc.h,v 1.25 2020/06/13 23:58:51 ad Exp $	*/
281918bf8Sfvdl 
381918bf8Sfvdl /*
481918bf8Sfvdl  * Copyright (c) 1991 Regents of the University of California.
581918bf8Sfvdl  * All rights reserved.
681918bf8Sfvdl  *
781918bf8Sfvdl  * Redistribution and use in source and binary forms, with or without
881918bf8Sfvdl  * modification, are permitted provided that the following conditions
981918bf8Sfvdl  * are met:
1081918bf8Sfvdl  * 1. Redistributions of source code must retain the above copyright
1181918bf8Sfvdl  *    notice, this list of conditions and the following disclaimer.
1281918bf8Sfvdl  * 2. Redistributions in binary form must reproduce the above copyright
1381918bf8Sfvdl  *    notice, this list of conditions and the following disclaimer in the
1481918bf8Sfvdl  *    documentation and/or other materials provided with the distribution.
15aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
1681918bf8Sfvdl  *    may be used to endorse or promote products derived from this software
1781918bf8Sfvdl  *    without specific prior written permission.
1881918bf8Sfvdl  *
1981918bf8Sfvdl  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2081918bf8Sfvdl  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2181918bf8Sfvdl  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2281918bf8Sfvdl  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2381918bf8Sfvdl  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2481918bf8Sfvdl  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2581918bf8Sfvdl  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2681918bf8Sfvdl  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2781918bf8Sfvdl  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2881918bf8Sfvdl  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2981918bf8Sfvdl  * SUCH DAMAGE.
3081918bf8Sfvdl  *
3181918bf8Sfvdl  *	@(#)proc.h	7.1 (Berkeley) 5/15/91
3281918bf8Sfvdl  */
3381918bf8Sfvdl 
3481918bf8Sfvdl #ifndef _AMD64_PROC_H
3581918bf8Sfvdl #define _AMD64_PROC_H
3681918bf8Sfvdl 
37433b5ddeSmrg #ifdef __x86_64__
38433b5ddeSmrg 
3981918bf8Sfvdl #include <machine/frame.h>
407146b2f6Srmind #include <machine/pcb.h>
4181918bf8Sfvdl 
4281918bf8Sfvdl /*
4374c813c4Sskrll  * Machine-dependent part of the lwp structure for amd64.
4481918bf8Sfvdl  */
45d1b2ddc7Sad struct pmap;
46d1b2ddc7Sad struct vm_page;
47d1b2ddc7Sad 
4881918bf8Sfvdl struct mdlwp {
49*8e7ee4c1Sad 	volatile uint64_t md_tsc;	/* last TSC reading */
5081918bf8Sfvdl 	struct	trapframe *md_regs;	/* registers on current frame */
5181918bf8Sfvdl 	int	md_flags;		/* machine-dependent flags */
52b07ec3fcSad 	volatile int md_astpending;
5381918bf8Sfvdl };
5481918bf8Sfvdl 
55c578e8d2Sdsl #define	MDL_COMPAT32		0x0008	/* i386, always return via iret */
56c578e8d2Sdsl #define	MDL_IRET		0x0010	/* force return via iret, not sysret */
57560337f7Smaxv #define	MDL_FPU_IN_CPU		0x0020	/* the FPU state is in the CPU */
58d2228640Sdsl 
5981918bf8Sfvdl struct mdproc {
6081918bf8Sfvdl 	int	md_flags;
6181918bf8Sfvdl 					/* Syscall handling function */
6202cdf4d2Sdsl 	void	(*md_syscall)(struct trapframe *);
6381918bf8Sfvdl };
6481918bf8Sfvdl 
6581918bf8Sfvdl /* md_flags */
6681918bf8Sfvdl #define MDP_USEDMTRR	0x0008	/* has set volatile MTRRs */
6781918bf8Sfvdl 
68433b5ddeSmrg #else	/*	__x86_64__	*/
69433b5ddeSmrg 
70433b5ddeSmrg #include <i386/proc.h>
71433b5ddeSmrg 
72433b5ddeSmrg #endif	/*	__x86_64__	*/
73433b5ddeSmrg 
7481918bf8Sfvdl #endif /* _AMD64_PROC_H */
75