xref: /titanic_51/usr/src/uts/sun4u/serengeti/sys/sgsbbc.h (revision 03831d35f7499c87d51205817c93e9a8d42c4bae)
1*03831d35Sstevel /*
2*03831d35Sstevel  * CDDL HEADER START
3*03831d35Sstevel  *
4*03831d35Sstevel  * The contents of this file are subject to the terms of the
5*03831d35Sstevel  * Common Development and Distribution License (the "License").
6*03831d35Sstevel  * You may not use this file except in compliance with the License.
7*03831d35Sstevel  *
8*03831d35Sstevel  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*03831d35Sstevel  * or http://www.opensolaris.org/os/licensing.
10*03831d35Sstevel  * See the License for the specific language governing permissions
11*03831d35Sstevel  * and limitations under the License.
12*03831d35Sstevel  *
13*03831d35Sstevel  * When distributing Covered Code, include this CDDL HEADER in each
14*03831d35Sstevel  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*03831d35Sstevel  * If applicable, add the following below this CDDL HEADER, with the
16*03831d35Sstevel  * fields enclosed by brackets "[]" replaced with your own identifying
17*03831d35Sstevel  * information: Portions Copyright [yyyy] [name of copyright owner]
18*03831d35Sstevel  *
19*03831d35Sstevel  * CDDL HEADER END
20*03831d35Sstevel  */
21*03831d35Sstevel 
22*03831d35Sstevel /*
23*03831d35Sstevel  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*03831d35Sstevel  * Use is subject to license terms.
25*03831d35Sstevel  */
26*03831d35Sstevel 
27*03831d35Sstevel #ifndef	_SYS_SGSBBC_H
28*03831d35Sstevel #define	_SYS_SGSBBC_H
29*03831d35Sstevel 
30*03831d35Sstevel #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*03831d35Sstevel 
32*03831d35Sstevel #ifdef	__cplusplus
33*03831d35Sstevel extern "C" {
34*03831d35Sstevel #endif
35*03831d35Sstevel 
36*03831d35Sstevel /*
37*03831d35Sstevel  * Serengeti SBBC Driver
38*03831d35Sstevel  *
39*03831d35Sstevel  * The Serengeti SBBC driver handles communication between the
40*03831d35Sstevel  * System Controller Software (ScApp) and Solaris via SBBC
41*03831d35Sstevel  * registers and IOSRAM.
42*03831d35Sstevel  *
43*03831d35Sstevel  */
44*03831d35Sstevel #include <sys/serengeti.h>
45*03831d35Sstevel 
46*03831d35Sstevel /*
47*03831d35Sstevel  * OS <-> SC Interrupt Reasons
48*03831d35Sstevel  */
49*03831d35Sstevel #define	SBBC_CONSOLE_IN			0x1 	/* console input available */
50*03831d35Sstevel #define	SBBC_CONSOLE_OUT		0x2	/* console output available */
51*03831d35Sstevel #define	SBBC_CONSOLE_BRK		0x4	/* break */
52*03831d35Sstevel #define	SBBC_CONSOLE_SPACE_IN		0x8	/* console has in space */
53*03831d35Sstevel #define	SBBC_CONSOLE_SPACE_OUT		0x10	/* console has out space */
54*03831d35Sstevel #define	SBBC_MAILBOX_IN 		0x20	/* mailbox message in */
55*03831d35Sstevel #define	SBBC_MAILBOX_OUT		0x40	/* mailbox message out */
56*03831d35Sstevel #define	SBBC_MAILBOX_SPACE_IN		0x80	/* mailbox has in space */
57*03831d35Sstevel #define	SBBC_MAILBOX_SPACE_OUT		0x100	/* mailbox has out space */
58*03831d35Sstevel 
59*03831d35Sstevel /*
60*03831d35Sstevel  * SBBC needs to know what softint handlers are doing
61*03831d35Sstevel  */
62*03831d35Sstevel #define	SBBC_INTR_IDLE			0
63*03831d35Sstevel #define	SBBC_INTR_RUNNING		1
64*03831d35Sstevel 
65*03831d35Sstevel typedef const char *const fn_t;
66*03831d35Sstevel 
67*03831d35Sstevel typedef uint_t (*sbbc_intrfunc_t)(caddr_t);
68*03831d35Sstevel 
69*03831d35Sstevel /* For printing out warning and panic messages */
70*03831d35Sstevel #define	SBBC_ERR(err, msg) \
71*03831d35Sstevel 	{ prom_printf(msg); cmn_err(err, msg); }
72*03831d35Sstevel #define	SBBC_ERR1(err, msg, arg) \
73*03831d35Sstevel 	{ prom_printf(msg, arg); cmn_err(err, msg, arg); }
74*03831d35Sstevel 
75*03831d35Sstevel 
76*03831d35Sstevel #ifdef	__cplusplus
77*03831d35Sstevel }
78*03831d35Sstevel #endif
79*03831d35Sstevel 
80*03831d35Sstevel #endif	/* _SYS_SGSBBC_H */
81