/*
* 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 2001 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SGSBBC_MAILBOX_PRIV_H
#define _SYS_SGSBBC_MAILBOX_PRIV_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sgsbbc_mailbox.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Internal flags for message processing
*/
#define MBOX_MSGIN_INTR 0
#define SBBC_INBOX 0
/* Number of bytes the mailbox messages align at */
"temperature exceeding limits.\n"
/*
* This struct is used internally by both the SC & OS mailbox
* handlers. Every message in the mailbox is made up
* of a fragment struct followed immediately by some optional
* user data. (We will allow zero-length messages.)
*
* Note: ID == 0 => unsolicited
*
* make them all 32-bit ints and add a bit of
* user-data padding to make life easy for the SC
*/
struct sbbc_fragment {
};
/*
*/
typedef struct sbbc_mbox {
/*
* If the mailbox is full, we can either block waiting
* for space or just return an error. We will make this
* dependent on the message flag
*/
} sbbc_mbox_t;
/*
* When a message requires a reply, it is put on a waitlist
* until a message of that type with a matching ID comes in.
*/
struct sbbc_msg_waiter {
};
/*
* this struct describes the mailbox as seen by the OS
*/
typedef struct sbbc_mailbox {
/*
* Two mailboxes, SC -> OS mbox_in
* OS -> SC mbox_out
*/
/*
* Interrupt handlers. Mailbox registers itself with
* the SBBC for the following interrupt types
*
* SBBC_MAILBOX_IN
* SBBC_MAILBOX_OUT
* SBBC_MAILBOX_SPACE_IN
* SBBC_MAILBOX_SPACE_OUT
*
* Of course, we should only ever see the *-IN interrupts
* but we will register the *-OUT ones as ours anyway to ensure
* no-one else tries to overload these interrupt types.
*
*/
struct {
/*
* Message handlers - one per message type
* These are used for incoming unsolicited messages
*/
/*
* Next message ID
*/
/*
* List of 'waiters' for each incoming message type
*/
/*
* This data will be written by the SC at the
* start of the mailbox in IOSRAM.
* This is read from offset 0 with key SBBC_MAILBOX_KEY
*
* make them all 32-bit ints and add a bit of
* user-data padding to make life easy for the SC
*/
struct sbbc_mbox_header {
struct mbox {
/* SRAM area */
/* start of this mailbox */
/* start of this mailbox */
};
extern void sbbc_mbox_init();
extern void sbbc_mbox_fini();
extern int sbbc_mbox_create(sbbc_softstate_t *);
extern int sbbc_mbox_switch(sbbc_softstate_t *);
extern sbbc_mailbox_t *master_mbox;
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SGSBBC_MAILBOX_PRIV_H */