psl.h revision 139825
1139825Simp/*-
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 *
3196905Sbenno *	$NetBSD: psl.h,v 1.5 2000/11/19 19:52:37 matt Exp $
3277957Sbenno * $FreeBSD: head/sys/powerpc/include/psl.h 139825 2005-01-07 02:29:27Z imp $
3377957Sbenno */
3477957Sbenno
3577957Sbenno#ifndef	_MACHINE_PSL_H_
3677957Sbenno#define	_MACHINE_PSL_H_
3777957Sbenno
3877957Sbenno/*
3977957Sbenno * Machine State Register (MSR)
4077957Sbenno *
4177957Sbenno * The PowerPC 601 does not implement the following bits:
4277957Sbenno *
4396905Sbenno *	VEC, POW, ILE, BE, RI, LE[*]
4477957Sbenno *
4577957Sbenno * [*] Little-endian mode on the 601 is implemented in the HID0 register.
4677957Sbenno */
4796905Sbenno#define	PSL_VEC		0x02000000	/* AltiVec vector unit available */
4877957Sbenno#define	PSL_POW		0x00040000	/* power management */
4977957Sbenno#define	PSL_ILE		0x00010000	/* interrupt endian mode (1 == le) */
5077957Sbenno#define	PSL_EE		0x00008000	/* external interrupt enable */
5177957Sbenno#define	PSL_PR		0x00004000	/* privilege mode (1 == user) */
5277957Sbenno#define	PSL_FP		0x00002000	/* floating point enable */
5377957Sbenno#define	PSL_ME		0x00001000	/* machine check enable */
5477957Sbenno#define	PSL_FE0		0x00000800	/* floating point interrupt mode 0 */
5577957Sbenno#define	PSL_SE		0x00000400	/* single-step trace enable */
5677957Sbenno#define	PSL_BE		0x00000200	/* branch trace enable */
5777957Sbenno#define	PSL_FE1		0x00000100	/* floating point interrupt mode 1 */
5877957Sbenno#define	PSL_IP		0x00000040	/* interrupt prefix */
5977957Sbenno#define	PSL_IR		0x00000020	/* instruction address relocation */
6077957Sbenno#define	PSL_DR		0x00000010	/* data address relocation */
6177957Sbenno#define	PSL_RI		0x00000002	/* recoverable interrupt */
6277957Sbenno#define	PSL_LE		0x00000001	/* endian mode (1 == le) */
6377957Sbenno
6477957Sbenno#define	PSL_601_MASK	~(PSL_POW|PSL_ILE|PSL_BE|PSL_RI|PSL_LE)
6577957Sbenno
6677957Sbenno/*
6777957Sbenno * Floating-point exception modes:
6877957Sbenno */
6977957Sbenno#define	PSL_FE_DIS	0		/* none */
7077957Sbenno#define	PSL_FE_NONREC	PSL_FE1		/* imprecise non-recoverable */
7177957Sbenno#define	PSL_FE_REC	PSL_FE0		/* imprecise recoverable */
7277957Sbenno#define	PSL_FE_PREC	(PSL_FE0 | PSL_FE1) /* precise */
7377957Sbenno#define	PSL_FE_DFLT	PSL_FE_DIS	/* default == none */
7477957Sbenno
7577957Sbenno/*
7677957Sbenno * Note that PSL_POW and PSL_ILE are not in the saved copy of the MSR
7777957Sbenno */
7877957Sbenno#define	PSL_MBO		0
7977957Sbenno#define	PSL_MBZ		0
8077957Sbenno
81138220Sgrehan#define	PSL_KERNSET	(PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI)
82138220Sgrehan#define	PSL_USERSET	(PSL_KERNSET | PSL_PR)
8377957Sbenno
8477957Sbenno#define	PSL_USERSTATIC	(PSL_USERSET | PSL_IP | 0x87c0008c)
8577957Sbenno
8677957Sbenno#endif	/* _MACHINE_PSL_H_ */
87