smq.c revision 03831d35f7499c87d51205817c93e9a8d42c4bae
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* smq.c: to provide a message queue system for scadm functions (used in the
* firmware download context where BP messages, received from the service
* processor, are stored in the message queue)
*
* these routines come from the libxposix library
*/
#include <time.h>
#include "xsem.h"
#include "smq.h"
#define SMQ_VALID_SMQ 0x0000003b
#define SMQ_VALID_SMQ_MASK 0x000000FF
int
{
/* allocate local semaphore initialized to 0 */
return (SMQ_ERROR);
return (0);
}
int
{
return (SMQ_INVALID);
smq->smq_control = 0;
return (0);
}
int
{
return (SMQ_INVALID);
/* Wait for message */
return (SMQ_ERROR);
/* Copy messaged into queue */
/* Increment Head */
}
return (0);
}
int
{
return (SMQ_INVALID);
return (SMQ_FULL);
/* Copy messaged into queue */
/* Increment Tail */
}
return (0);
}
int
{
return (SMQ_INVALID);
return (0);
}
int
{
return (SMQ_INVALID);
return (0);
}
int
{
int Status;
return (SMQ_INVALID);
/* Wait for message */
return (SMQ_ETIME);
if (Status != 0)
return (SMQ_ERROR);
return (SMQ_ERROR);
/* Copy messaged into queue */
/* Increment Head */
}
return (0);
}