xref: /illumos-gate/usr/src/uts/sun4v/sys/machasi.h (revision 125be069)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*125be069SJason Beloro  * Common Development and Distribution License (the "License").
6*125be069SJason Beloro  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*125be069SJason Beloro  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef _SYS_MACHASI_H
277c478bd9Sstevel@tonic-gate #define	_SYS_MACHASI_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate /*
307c478bd9Sstevel@tonic-gate  * alternate address space identifiers
317c478bd9Sstevel@tonic-gate  *
327c478bd9Sstevel@tonic-gate  * 0x00 - 0x2F are privileged
337c478bd9Sstevel@tonic-gate  * 0x30 - 0x7f are hyperprivileged
347c478bd9Sstevel@tonic-gate  * 0x80 - 0xFF can be used by users
357c478bd9Sstevel@tonic-gate  */
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate /*
387c478bd9Sstevel@tonic-gate  * ASIs specific to sun4v compliant  processors.
397c478bd9Sstevel@tonic-gate  */
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate #ifdef __cplusplus
427c478bd9Sstevel@tonic-gate extern "C" {
437c478bd9Sstevel@tonic-gate #endif
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate #define	ASI_BLK_AIUP		0x16	/* block as if user primary */
467c478bd9Sstevel@tonic-gate #define	ASI_BLK_AIUS		0x17	/* block as if user secondary */
477c478bd9Sstevel@tonic-gate #define	ASI_BLK_AIUPL		0x1E	/* block as if user primary little */
487c478bd9Sstevel@tonic-gate #define	ASI_BLK_AIUSL		0x1F	/* block as if user secondary little */
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #define	ASI_NQUAD_LD		0x24	/* 128-bit atomic load */
517c478bd9Sstevel@tonic-gate #define	ASI_NQUAD_LD_L		0x2C	/* 128-bit atomic load little */
527c478bd9Sstevel@tonic-gate #define	ASI_QUAD_LDD_PHYS	0x26	/* 128-bit physical atomic load */
537c478bd9Sstevel@tonic-gate #define	ASI_QUAD_LDD_PHYS_L	0x2E	/* 128-bit phys. atomic load little */
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #define	ASI_SCRATCHPAD		0x20	/* sun4v scratch pad registers ASI */
567c478bd9Sstevel@tonic-gate #define	ASI_MMU			0x21	/* sun4v ctx register ASI */
577c478bd9Sstevel@tonic-gate #define	ASI_MMU_CTX		ASI_MMU
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate #define	ASI_QUEUE		0x25
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate /*
627c478bd9Sstevel@tonic-gate  * MMU fault status area (see sys/hypervisor_api.h for layout)
637c478bd9Sstevel@tonic-gate  */
647c478bd9Sstevel@tonic-gate #define	MMU_FAULT_STATUS_AREA(REG)	\
657c478bd9Sstevel@tonic-gate 	ldxa	[%g0]ASI_SCRATCHPAD, REG
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate /*
687c478bd9Sstevel@tonic-gate  * Scratch pad registers
697c478bd9Sstevel@tonic-gate  * (0x0 through 0x18 guaranteed fast, rest may be slow)
707c478bd9Sstevel@tonic-gate  */
717c478bd9Sstevel@tonic-gate #define	SCRATCHPAD_MMUMISSAREA	0x0	/* Shared with OBP - set by OBP */
727c478bd9Sstevel@tonic-gate #define	SCRATCHPAD_CPUID	0x8	/* Shared with OBP - set by HV */
737c478bd9Sstevel@tonic-gate #define	SCRATCHPAD_UTSBREG1	0x10
747c478bd9Sstevel@tonic-gate #define	SCRATCHPAD_UTSBREG2	0x18
757c478bd9Sstevel@tonic-gate 					/* 0x20 & 0x28 HV only */
767c478bd9Sstevel@tonic-gate #define	SCRATCHPAD_UNUSED1	0x30
777c478bd9Sstevel@tonic-gate #define	SCRATCHPAD_UNUSED2	0x38	/* reserved for OBP */
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate /*
807c478bd9Sstevel@tonic-gate  * Ancillary state registers, for asrset_t
817c478bd9Sstevel@tonic-gate  */
827c478bd9Sstevel@tonic-gate #define	ASR_GSR	(3)
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate #ifdef __cplusplus
857c478bd9Sstevel@tonic-gate }
867c478bd9Sstevel@tonic-gate #endif
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate #endif /* _SYS_MACHASI_H */
89