xref: /netbsd-src/sys/arch/x86/include/psl.h (revision d70d1674fb42e0ebb33cd951295744e60d8b0539)
1*d70d1674Smaxv /*	$NetBSD: psl.h,v 1.10 2017/08/12 12:33:31 maxv Exp $	*/
28375b2d9Sfvdl 
38375b2d9Sfvdl /*-
48375b2d9Sfvdl  * Copyright (c) 1990 The Regents of the University of California.
58375b2d9Sfvdl  * All rights reserved.
68375b2d9Sfvdl  *
78375b2d9Sfvdl  * This code is derived from software contributed to Berkeley by
88375b2d9Sfvdl  * William Jolitz.
98375b2d9Sfvdl  *
108375b2d9Sfvdl  * Redistribution and use in source and binary forms, with or without
118375b2d9Sfvdl  * modification, are permitted provided that the following conditions
128375b2d9Sfvdl  * are met:
138375b2d9Sfvdl  * 1. Redistributions of source code must retain the above copyright
148375b2d9Sfvdl  *    notice, this list of conditions and the following disclaimer.
158375b2d9Sfvdl  * 2. Redistributions in binary form must reproduce the above copyright
168375b2d9Sfvdl  *    notice, this list of conditions and the following disclaimer in the
178375b2d9Sfvdl  *    documentation and/or other materials provided with the distribution.
18aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
198375b2d9Sfvdl  *    may be used to endorse or promote products derived from this software
208375b2d9Sfvdl  *    without specific prior written permission.
218375b2d9Sfvdl  *
228375b2d9Sfvdl  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
238375b2d9Sfvdl  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
248375b2d9Sfvdl  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
258375b2d9Sfvdl  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
268375b2d9Sfvdl  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
278375b2d9Sfvdl  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
288375b2d9Sfvdl  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
298375b2d9Sfvdl  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
308375b2d9Sfvdl  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
318375b2d9Sfvdl  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
328375b2d9Sfvdl  * SUCH DAMAGE.
338375b2d9Sfvdl  *
348375b2d9Sfvdl  *	@(#)psl.h	5.2 (Berkeley) 1/18/91
358375b2d9Sfvdl  */
368375b2d9Sfvdl 
378375b2d9Sfvdl #ifndef _X86_PSL_H_
388375b2d9Sfvdl #define _X86_PSL_H_
398375b2d9Sfvdl 
408375b2d9Sfvdl /*
418375b2d9Sfvdl  * 386 processor status longword.
428375b2d9Sfvdl  */
438375b2d9Sfvdl #define	PSL_C		0x00000001	/* carry flag */
448375b2d9Sfvdl #define	PSL_PF		0x00000004	/* parity flag */
458375b2d9Sfvdl #define	PSL_AF		0x00000010	/* auxiliary carry flag */
468375b2d9Sfvdl #define	PSL_Z		0x00000040	/* zero flag */
478375b2d9Sfvdl #define	PSL_N		0x00000080	/* sign flag */
488375b2d9Sfvdl #define	PSL_T		0x00000100	/* trap flag */
498375b2d9Sfvdl #define	PSL_I		0x00000200	/* interrupt enable flag */
508375b2d9Sfvdl #define	PSL_D		0x00000400	/* direction flag */
518375b2d9Sfvdl #define	PSL_V		0x00000800	/* overflow flag */
528375b2d9Sfvdl #define	PSL_IOPL	0x00003000	/* i/o privilege level */
538375b2d9Sfvdl #define	PSL_NT		0x00004000	/* nested task */
548375b2d9Sfvdl #define	PSL_RF		0x00010000	/* resume flag */
558375b2d9Sfvdl #define	PSL_VM		0x00020000	/* virtual 8086 mode */
568375b2d9Sfvdl #define	PSL_AC		0x00040000	/* alignment check flag */
578375b2d9Sfvdl #define	PSL_VIF		0x00080000	/* virtual interrupt enable flag */
588375b2d9Sfvdl #define	PSL_VIP		0x00100000	/* virtual interrupt pending flag */
598375b2d9Sfvdl #define	PSL_ID		0x00200000	/* identification flag */
608375b2d9Sfvdl 
618375b2d9Sfvdl #define	PSL_MBO		0x00000002	/* must be one bits */
628375b2d9Sfvdl #define	PSL_MBZ		0xffc08028	/* must be zero bits */
638375b2d9Sfvdl 
648375b2d9Sfvdl #define	PSL_USERSET	(PSL_MBO | PSL_I)
658375b2d9Sfvdl #define	PSL_USERSTATIC	(PSL_MBO | PSL_MBZ | PSL_I | PSL_IOPL | PSL_NT | PSL_VM | PSL_VIF | PSL_VIP)
66d1779123Sdsl #define PSL_USER	(PSL_C | PSL_PF | PSL_AF | PSL_Z | PSL_N | \
67e7ffd7b1Sjym     PSL_T | PSL_V | PSL_D | PSL_AC)
6895ffbb8bSchristos #define	PSL_CLEARSIG	(PSL_T | PSL_VM | PSL_AC | PSL_D)
6995ffbb8bSchristos 
708375b2d9Sfvdl 
718375b2d9Sfvdl /*
728375b2d9Sfvdl  * ???
738375b2d9Sfvdl  */
748375b2d9Sfvdl #ifdef _KERNEL
758375b2d9Sfvdl #include <machine/intr.h>
768375b2d9Sfvdl #endif
778375b2d9Sfvdl 
788375b2d9Sfvdl #endif /* !_X86_PSL_H_ */
79