xref: /titanic_54/usr/src/uts/sun4/sys/intreg.h (revision a10abbb48301520aaa9158a9d71fac18fc269159)
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
5b0fc0e77Sgovinda  * Common Development and Distribution License (the "License").
6b0fc0e77Sgovinda  * 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*a10abbb4Slm66018  * Copyright 2007 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 */
39b0fc0e77Sgovinda #define	MAX_IGN		(1 << IGN_SIZE) /* Max Interrupt Group Number size */
40b0fc0e77Sgovinda #define	MAX_INO		(1 << INO_SIZE) /* Max Interrupt Number per group */
41*a10abbb4Slm66018 #define	MAXDEVINTRS	(MAX_IGN * MAX_INO) /* Max hardware intrs allowed */
42*a10abbb4Slm66018 
43*a10abbb4Slm66018 /*
44*a10abbb4Slm66018  * A platform may require use of the system interrupt table beyond
45*a10abbb4Slm66018  * the maximum hardware interrupts specified above for virtual device
46*a10abbb4Slm66018  * interrupts. If the platform does not specify MAXVINTRS we default to 0.
47*a10abbb4Slm66018  */
48*a10abbb4Slm66018 #ifndef MAXVINTRS
49*a10abbb4Slm66018 #define	MAXVINTRS	0
50*a10abbb4Slm66018 #endif
51*a10abbb4Slm66018 
52*a10abbb4Slm66018 /*
53*a10abbb4Slm66018  * maximum system interrupts allowed
54*a10abbb4Slm66018  */
55*a10abbb4Slm66018 #define	MAXIVNUM	(MAXDEVINTRS + MAXVINTRS)
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate /*
587c478bd9Sstevel@tonic-gate  * Interrupt State Machine
597c478bd9Sstevel@tonic-gate  *	Each interrupt source has a 2-bit state machine which ensures that
607c478bd9Sstevel@tonic-gate  *	software sees exactly one interrupt packet per assertion of the
617c478bd9Sstevel@tonic-gate  *	interrupt signal.
627c478bd9Sstevel@tonic-gate  */
637c478bd9Sstevel@tonic-gate #define	ISM_IDLE	0x0	/* not asserted or pending */
647c478bd9Sstevel@tonic-gate #define	ISM_TRANSMIT	0x1	/* asserted but is not dispatched */
657c478bd9Sstevel@tonic-gate #define	ISM_PENDING	0x2	/* dispatched to a processor or is in transit */
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate /*
687c478bd9Sstevel@tonic-gate  * Per-Processor Soft Interrupt Register
697c478bd9Sstevel@tonic-gate  * XXX use %asr when the new assembler supports them
707c478bd9Sstevel@tonic-gate  */
717c478bd9Sstevel@tonic-gate #define	SET_SOFTINT	%asr20		/* ASR 0x14 */
727c478bd9Sstevel@tonic-gate #define	CLEAR_SOFTINT	%asr21		/* ASR 0x15 */
737c478bd9Sstevel@tonic-gate #define	SOFTINT		%asr22		/* ASR 0x16 */
747c478bd9Sstevel@tonic-gate #define	SOFTINT_MASK	0xFFFE		/* <15:1> */
757c478bd9Sstevel@tonic-gate #define	TICK_INT_MASK	0x1		/* <0> */
767c478bd9Sstevel@tonic-gate #define	STICK_INT_MASK	0x10000		/* <0> */
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate /*
797c478bd9Sstevel@tonic-gate  * Per-Processor TICK Register and TICK_Compare registers
807c478bd9Sstevel@tonic-gate  *
817c478bd9Sstevel@tonic-gate  */
827c478bd9Sstevel@tonic-gate #define	TICK_COMPARE	%asr23		/* ASR 0x17 */
837c478bd9Sstevel@tonic-gate #define	STICK		%asr24		/* ASR 0x18 */
847c478bd9Sstevel@tonic-gate #define	STICK_COMPARE	%asr25		/* ASR 0x19 */
857c478bd9Sstevel@tonic-gate #define	TICKINT_DIS_SHFT	0x3f
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate #ifndef _ASM
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate /*
907c478bd9Sstevel@tonic-gate  * Interrupt Packet (mondo)
917c478bd9Sstevel@tonic-gate  */
927c478bd9Sstevel@tonic-gate struct intr_packet {
937c478bd9Sstevel@tonic-gate 	uint64_t intr_data0; /* can be an interrupt number or a pc */
947c478bd9Sstevel@tonic-gate 	uint64_t intr_data1;
957c478bd9Sstevel@tonic-gate 	uint64_t intr_data2;
967c478bd9Sstevel@tonic-gate };
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate /*
997c478bd9Sstevel@tonic-gate  * Leftover bogus stuff; removed them later
1007c478bd9Sstevel@tonic-gate  */
1017c478bd9Sstevel@tonic-gate struct cpu_intreg {
1027c478bd9Sstevel@tonic-gate 	uint_t	pend;
1037c478bd9Sstevel@tonic-gate 	uint_t	clr_pend;
1047c478bd9Sstevel@tonic-gate 	uint_t	set_pend;
1057c478bd9Sstevel@tonic-gate 	uchar_t	filler[0x1000 - 0xc];
1067c478bd9Sstevel@tonic-gate };
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate struct sys_intreg {
1097c478bd9Sstevel@tonic-gate 	uint_t	sys_pend;
1107c478bd9Sstevel@tonic-gate 	uint_t	sys_m;
1117c478bd9Sstevel@tonic-gate 	uint_t	sys_mclear;
1127c478bd9Sstevel@tonic-gate 	uint_t	sys_mset;
1137c478bd9Sstevel@tonic-gate 	uint_t	itr;
1147c478bd9Sstevel@tonic-gate };
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate #endif  /* _ASM */
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1197c478bd9Sstevel@tonic-gate }
1207c478bd9Sstevel@tonic-gate #endif
1217c478bd9Sstevel@tonic-gate 
1227c478bd9Sstevel@tonic-gate #endif	/* _SYS_INTREG_H */
123