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