sgcn.h revision 03831d35f7499c87d51205817c93e9a8d42c4bae
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SGCN_H
#define _SGCN_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Console driver
*
* There is no hardware serial port is provided. A standalone
* co-processor SC acts as console device. The communication
* between SC and a domain is via SRAM on the choosen I/O board.
*
* This driver manipulates SRAM from domain Solaris side.
*/
/*
* Logically there are two sets of interfaces defined here.
* The first part describes IOSRAM structures and will be
* exposed to all relevant clients, like SC, OBP.
* The second part defines internal driver data structure
* used by sgcn dirver.
*/
/*
* IOSRAM structure
*
* Solaris and OBP use separate console buffers. But they share
* the same console buffer structure.
*
* +---------------+ <- console buffer base address (BASE)
* | header |
* +---------------+ <- cnsram_in_begin + BASE
* | input |
* | buffer | <- cnsram_in_rdptr + BASE
* | | <- cnsram_in_wrptr + BASE
* | |
* +---------------+ <- cnsram_in_end + BASE
* |///////////////|
* |///////////////| <- reserved for future expansion
* |///////////////|
* +---------------+ <- cnsram_out_begin + BASE
* | output |
* | buffer | <- cnsram_out_rdptr + BASE
* | | <- cnsram_out_wrptr + BASE
* +---------------+ <- cnsram_out_end + BASE
* |///////////////|
* |///////////////| <- reserved for future expansion
* |///////////////|
* +---------------+ <- cnsram_size + BASE
*/
/*
* Console IOSRAM header structure
* The header size is fixed, despite of 32-bit or 64-bit Solaris
*/
typedef struct {
/*
* the followings are all relative to beginning of console buffer
*/
#define CNSRAM_VERSION_1 1
/*
* sgcn driver's soft state structure
*/
typedef struct sgcn {
/* mutexes */
/* these are required by sbbc driver */
/* stream queues */
/* pre-allocated console input buffer */
char *sgcn_inbuf; /* console input buffer */
/* dev info */
/* for handling IOCTL messages */
/* for console output timeout */
} sgcn_t;
/* Constants used by promif routines */
#define SGCN_CLNT_STR "CON_CLNT"
#define SGCN_OBP_STR "CON_OBP"
/* alternate break sequence */
extern void (*abort_seq_handler)();
extern struct mod_ops mod_driverops;
#ifdef __cplusplus
}
#endif
#endif /* _SGCN_H */