xref: /openbsd-src/sys/arch/powerpc/include/psl.h (revision 0dcf4312d797d675fb9f9b86c9612adb75b25014)
1*0dcf4312Sdrahn /*	$OpenBSD: psl.h,v 1.5 2001/11/13 14:31:52 drahn Exp $	*/
247bc79e1Srahnds /*	$NetBSD: psl.h,v 1.1 1996/09/30 16:34:32 ws Exp $	*/
347bc79e1Srahnds 
447bc79e1Srahnds /*
547bc79e1Srahnds  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
647bc79e1Srahnds  * Copyright (C) 1995, 1996 TooLs GmbH.
747bc79e1Srahnds  * All rights reserved.
847bc79e1Srahnds  *
947bc79e1Srahnds  * Redistribution and use in source and binary forms, with or without
1047bc79e1Srahnds  * modification, are permitted provided that the following conditions
1147bc79e1Srahnds  * are met:
1247bc79e1Srahnds  * 1. Redistributions of source code must retain the above copyright
1347bc79e1Srahnds  *    notice, this list of conditions and the following disclaimer.
1447bc79e1Srahnds  * 2. Redistributions in binary form must reproduce the above copyright
1547bc79e1Srahnds  *    notice, this list of conditions and the following disclaimer in the
1647bc79e1Srahnds  *    documentation and/or other materials provided with the distribution.
1747bc79e1Srahnds  * 3. All advertising materials mentioning features or use of this software
1847bc79e1Srahnds  *    must display the following acknowledgement:
1947bc79e1Srahnds  *	This product includes software developed by TooLs GmbH.
2047bc79e1Srahnds  * 4. The name of TooLs GmbH may not be used to endorse or promote products
2147bc79e1Srahnds  *    derived from this software without specific prior written permission.
2247bc79e1Srahnds  *
2347bc79e1Srahnds  * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
2447bc79e1Srahnds  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2547bc79e1Srahnds  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2647bc79e1Srahnds  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2747bc79e1Srahnds  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2847bc79e1Srahnds  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
2947bc79e1Srahnds  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
3047bc79e1Srahnds  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
3147bc79e1Srahnds  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
3247bc79e1Srahnds  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3347bc79e1Srahnds  */
3452c13d20Sdrahn #ifndef	_POWERPC_PSL_H_
3552c13d20Sdrahn #define	_POWERPC_PSL_H_
3647bc79e1Srahnds 
3747bc79e1Srahnds /*
3847bc79e1Srahnds  * Flags in MSR:
3947bc79e1Srahnds  */
40*0dcf4312Sdrahn #define PSL_VEC		0x02000000	/* AltiVec vector unit available */
4147bc79e1Srahnds #define	PSL_POW		0x00040000
4247bc79e1Srahnds #define	PSL_ILE		0x00010000
4347bc79e1Srahnds #define	PSL_EE		0x00008000
4447bc79e1Srahnds #define	PSL_PR		0x00004000
4547bc79e1Srahnds #define	PSL_FP		0x00002000
4647bc79e1Srahnds #define	PSL_ME		0x00001000
4747bc79e1Srahnds #define	PSL_FE0		0x00000800
4847bc79e1Srahnds #define	PSL_SE		0x00000400
4947bc79e1Srahnds #define	PSL_BE		0x00000200
5047bc79e1Srahnds #define	PSL_FE1		0x00000100
5147bc79e1Srahnds #define	PSL_IP		0x00000040
5247bc79e1Srahnds #define	PSL_IR		0x00000020
5347bc79e1Srahnds #define	PSL_DR		0x00000010
5447bc79e1Srahnds #define	PSL_RI		0x00000002
5547bc79e1Srahnds #define	PSL_LE		0x00000001
5647bc79e1Srahnds 
5747bc79e1Srahnds /*
5847bc79e1Srahnds  * Floating-point exception modes:
5947bc79e1Srahnds  */
6047bc79e1Srahnds #define	PSL_FE_DIS	0
6147bc79e1Srahnds #define	PSL_FE_NONREC	PSL_FE1
6247bc79e1Srahnds #define	PSL_FE_REC	PSL_FE0
6347bc79e1Srahnds #define	PSL_FE_PREC	(PSL_FE0 | PSL_FE1)
6447bc79e1Srahnds #define	PSL_FE_DFLT	PSL_FE_DIS
6547bc79e1Srahnds 
6647bc79e1Srahnds /*
6747bc79e1Srahnds  * Note that PSL_POW and PSL_ILE are not in the saved copy of the MSR
6847bc79e1Srahnds  */
6947bc79e1Srahnds #define	PSL_MBO		0
7047bc79e1Srahnds #define	PSL_MBZ		0
7147bc79e1Srahnds 
7247bc79e1Srahnds #define	PSL_USERSET	(PSL_EE | PSL_PR | PSL_ME | PSL_IR | PSL_DR | PSL_RI)
7347bc79e1Srahnds 
7447bc79e1Srahnds #define	PSL_USERSTATIC	(PSL_USERSET | PSL_IP | 0x87c0008c)
7547bc79e1Srahnds 
76f33a460bSpefo #include <machine/intr.h>
7747bc79e1Srahnds 
7852c13d20Sdrahn #endif	/* _POWERPC_PSL_H_ */
79