xref: /titanic_53/usr/src/uts/sun4/sys/intreg.h (revision b0fc0e77220f1fa4c933fd58a4e1dedcd650b0f1)
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*b0fc0e77Sgovinda  * Common Development and Distribution License (the "License").
6*b0fc0e77Sgovinda  * 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*b0fc0e77Sgovinda  * Copyright 2006 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_INTREG_H
277c478bd9Sstevel@tonic-gate #define	_SYS_INTREG_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #include <sys/machintreg.h>
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
347c478bd9Sstevel@tonic-gate extern "C" {
357c478bd9Sstevel@tonic-gate #endif
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #define	INO_SIZE	6		/* Interrupt Number Offset bit size */
387c478bd9Sstevel@tonic-gate #define	INR_SIZE	(IGN_SIZE + INO_SIZE)	/* Interrupt Number bit size */
39*b0fc0e77Sgovinda #define	MAX_IGN		(1 << IGN_SIZE) /* Max Interrupt Group Number size */
40*b0fc0e77Sgovinda #define	MAX_INO		(1 << INO_SIZE) /* Max Interrupt Number per group */
41*b0fc0e77Sgovinda #define	MAXIVNUM	(MAX_IGN * MAX_INO) /* Max hardware intrs allowed */
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate /*
447c478bd9Sstevel@tonic-gate  * Interrupt State Machine
457c478bd9Sstevel@tonic-gate  *	Each interrupt source has a 2-bit state machine which ensures that
467c478bd9Sstevel@tonic-gate  *	software sees exactly one interrupt packet per assertion of the
477c478bd9Sstevel@tonic-gate  *	interrupt signal.
487c478bd9Sstevel@tonic-gate  */
497c478bd9Sstevel@tonic-gate #define	ISM_IDLE	0x0	/* not asserted or pending */
507c478bd9Sstevel@tonic-gate #define	ISM_TRANSMIT	0x1	/* asserted but is not dispatched */
517c478bd9Sstevel@tonic-gate #define	ISM_PENDING	0x2	/* dispatched to a processor or is in transit */
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate /*
547c478bd9Sstevel@tonic-gate  * Per-Processor Soft Interrupt Register
557c478bd9Sstevel@tonic-gate  * XXX use %asr when the new assembler supports them
567c478bd9Sstevel@tonic-gate  */
577c478bd9Sstevel@tonic-gate #define	SET_SOFTINT	%asr20		/* ASR 0x14 */
587c478bd9Sstevel@tonic-gate #define	CLEAR_SOFTINT	%asr21		/* ASR 0x15 */
597c478bd9Sstevel@tonic-gate #define	SOFTINT		%asr22		/* ASR 0x16 */
607c478bd9Sstevel@tonic-gate #define	SOFTINT_MASK	0xFFFE		/* <15:1> */
617c478bd9Sstevel@tonic-gate #define	TICK_INT_MASK	0x1		/* <0> */
627c478bd9Sstevel@tonic-gate #define	STICK_INT_MASK	0x10000		/* <0> */
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate /*
657c478bd9Sstevel@tonic-gate  * Per-Processor TICK Register and TICK_Compare registers
667c478bd9Sstevel@tonic-gate  *
677c478bd9Sstevel@tonic-gate  */
687c478bd9Sstevel@tonic-gate #define	TICK_COMPARE	%asr23		/* ASR 0x17 */
697c478bd9Sstevel@tonic-gate #define	STICK		%asr24		/* ASR 0x18 */
707c478bd9Sstevel@tonic-gate #define	STICK_COMPARE	%asr25		/* ASR 0x19 */
717c478bd9Sstevel@tonic-gate #define	TICKINT_DIS_SHFT	0x3f
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate #ifndef _ASM
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate /*
767c478bd9Sstevel@tonic-gate  * Interrupt Packet (mondo)
777c478bd9Sstevel@tonic-gate  */
787c478bd9Sstevel@tonic-gate struct intr_packet {
797c478bd9Sstevel@tonic-gate 	uint64_t intr_data0; /* can be an interrupt number or a pc */
807c478bd9Sstevel@tonic-gate 	uint64_t intr_data1;
817c478bd9Sstevel@tonic-gate 	uint64_t intr_data2;
827c478bd9Sstevel@tonic-gate };
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate /*
857c478bd9Sstevel@tonic-gate  * Leftover bogus stuff; removed them later
867c478bd9Sstevel@tonic-gate  */
877c478bd9Sstevel@tonic-gate struct cpu_intreg {
887c478bd9Sstevel@tonic-gate 	uint_t	pend;
897c478bd9Sstevel@tonic-gate 	uint_t	clr_pend;
907c478bd9Sstevel@tonic-gate 	uint_t	set_pend;
917c478bd9Sstevel@tonic-gate 	uchar_t	filler[0x1000 - 0xc];
927c478bd9Sstevel@tonic-gate };
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate struct sys_intreg {
957c478bd9Sstevel@tonic-gate 	uint_t	sys_pend;
967c478bd9Sstevel@tonic-gate 	uint_t	sys_m;
977c478bd9Sstevel@tonic-gate 	uint_t	sys_mclear;
987c478bd9Sstevel@tonic-gate 	uint_t	sys_mset;
997c478bd9Sstevel@tonic-gate 	uint_t	itr;
1007c478bd9Sstevel@tonic-gate };
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate #endif  /* _ASM */
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1057c478bd9Sstevel@tonic-gate }
1067c478bd9Sstevel@tonic-gate #endif
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate #endif	/* _SYS_INTREG_H */
109