/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Stuff for mucking about with properties
*
* XXX: There is no distinction between intefer and non-integer properties
* XXX: and no functions included for decoding properties. As is, this
* XXX: file is suitable for a big-endian machine, since properties are
* XXX: encoded using an XDR-like property encoding mechanism, which is
* XXX: big-endian native ordering. To fix this, you need to add type-
* XXX: sensitive decoding mechanisms and have the consumer of the data
* XXX: decode the data, since only the consumer can claim to know the
* XXX: the type of the data. (It can't be done automatically.)
*/
#include <sys/promimpl.h>
#include <sys/platform_module.h>
static void prom_setprop_null(void);
/*
* prom_setprop_{enter,exit} are set to plat_setprop_{enter,exit} on
* platforms which require access to the seeproms to be serialized.
* Otherwise these default to null functions. These functions must be
* called before promif_preprom, since it can sleep and change CPU's,
* thereby failing the assert in promif_postprom().
*/
int
{
(void) p1275_cif_handler(&ci);
}
int
{
(void) p1275_cif_handler(&ci);
}
int
{
int rv;
if (rv != 0)
return (-1);
}
int
{
int rv;
if (rv != 0)
return (-1);
}
int
char *reason, int reason_len)
{
int rv;
return (rv);
}
int
{
int rv;
return (rv);
}
static void
prom_setprop_null(void)
{
}
int
{
(void) p1275_cif_handler(&ci);
}
int
{
/*
* This function assumes the buffer is large enough to
* hold the result, so in 1275 mode, we pass in the length
* of the property as the length of the buffer, since we
* have no way of knowing the size of the buffer. Pre-1275
* OpenBoot(tm) PROMs did not have a bounded getprop.
*
* Note that we ignore the "length" result of the service.
*/
return (len);
if (rv != 0)
return (-1);
return (len); /* Return known length */
}
int
{
(void) p1275_cif_handler(&ci);
}
{
(void) p1275_cif_handler(&ci);
return (next);
}
int
{
#ifdef PROM_32BIT_ADDRS
return (-1);
}
}
#endif
(void) p1275_cif_handler(&ci);
#ifdef PROM_32BIT_ADDRS
#endif
}
/*
* prom_decode_composite_string:
*
* Returns successive strings in a composite string property.
* A composite string property is a buffer containing one or more
* NULL terminated strings contained within the length of the buffer.
*
* Always call with the base address and length of the property buffer.
* On the first call, call with prev == 0, call successively
* with prev == to the last value returned from this function
* until the routine returns zero which means no more string values.
*/
char *
{
return ((char *)0);
if (prev == 0)
return ((char *)buf);
return ((char *)0);
return (prev);
}