topo_prop.c revision 0eb822a1c0c2bea495647510b75f77f0e57633eb
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <strings.h>
#include <assert.h>
#include <topo_prop.h>
#include <topo_string.h>
#include <topo_alloc.h>
#include <topo_error.h>
static topo_pgroup_t *
{
/*
* Check for an existing pgroup
*/
return (pg);
}
}
return (NULL);
}
static topo_propval_t *
{
}
return (NULL);
}
static topo_propval_t *
{
*err = ETOPO_PROP_NOENT;
return (NULL);
}
*err = ETOPO_PROP_NOENT;
return (NULL);
}
return (pv);
}
static int
{
int ret = 0;
return (-1);
case TOPO_TYPE_INT32:
{
TOPO_PROP_VAL_VAL, &val)) < 0)
break;
}
break;
case TOPO_TYPE_UINT32:
{
TOPO_PROP_VAL_VAL, &val)) < 0)
break;
}
break;
case TOPO_TYPE_INT64:
{
TOPO_PROP_VAL_VAL, &val)) < 0)
break;
}
break;
case TOPO_TYPE_UINT64:
{
TOPO_PROP_VAL_VAL, &val)) < 0)
break;
}
break;
case TOPO_TYPE_STRING:
{
char *val;
TOPO_PROP_VAL_VAL, &val)) < 0)
break;
}
break;
case TOPO_TYPE_FMRI:
{
TOPO_PROP_VAL_VAL, &val)) < 0)
break;
}
break;
case TOPO_TYPE_INT32_ARRAY:
{
break;
}
break;
case TOPO_TYPE_UINT32_ARRAY:
{
break;
}
break;
case TOPO_TYPE_INT64_ARRAY:
{
break;
}
break;
case TOPO_TYPE_UINT64_ARRAY:
{
break;
}
break;
case TOPO_TYPE_STRING_ARRAY:
{
char **val;
break;
}
break;
case TOPO_TYPE_FMRI_ARRAY:
{
break;
}
break;
default:
}
if (ret != 0) {
*err = ETOPO_NOMEM;
else
*err = ETOPO_PROP_NVL;
return (-1);
}
return (0);
}
nvlist_t *
{
return (NULL);
}
nvlist_t *
{
int ret;
}
!= 0) {
ETOPO_NOMEM));
}
}
}
pvnvl)) != 0) {
}
}
!= 0) {
}
}
return (nvl);
}
static int
{
return (-1);
}
static int
{
int i, j, ret = 0;
== NULL)
switch (type) {
case TOPO_TYPE_INT32:
break;
case TOPO_TYPE_UINT32:
break;
case TOPO_TYPE_INT64:
break;
case TOPO_TYPE_UINT64:
break;
case TOPO_TYPE_STRING: {
char *str;
TOPO_PROP_VAL_VAL, &str);
if (ret == 0)
break;
}
case TOPO_TYPE_FMRI: {
TOPO_PROP_VAL_VAL, &nvl);
if (ret == 0)
break;
}
case TOPO_TYPE_INT32_ARRAY: {
break;
ret = ETOPO_NOMEM;
break;
}
for (i = 0; i < *nelems; ++i)
break;
}
case TOPO_TYPE_UINT32_ARRAY: {
break;
ret = ETOPO_NOMEM;
break;
}
for (i = 0; i < *nelems; ++i)
break;
}
case TOPO_TYPE_INT64_ARRAY: {
break;
ret = ETOPO_NOMEM;
break;
}
for (i = 0; i < *nelems; ++i)
break;
}
case TOPO_TYPE_UINT64_ARRAY: {
break;
ret = ETOPO_NOMEM;
break;
}
for (i = 0; i < *nelems; ++i)
break;
}
case TOPO_TYPE_STRING_ARRAY: {
break;
ret = ETOPO_NOMEM;
break;
}
for (i = 0; i < *nelems; ++i) {
== NULL) {
for (j = 0; j < i; ++j)
sizeof (char *));
sizeof (char *) * *nelems);
break;
}
}
break;
}
case TOPO_TYPE_FMRI_ARRAY: {
break;
ret = ETOPO_NOMEM;
break;
}
for (i = 0; i < *nelems; ++i) {
for (j = 0; j < i; ++j)
nvlist_free(a1[j]);
break;
}
}
break;
}
default:
}
if (ret != 0)
else if (ret < ETOPO_UNKNOWN)
else
return (0);
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
static int
{
}
}
return (-1);
}
static int
{
/*
* Replace existing prop value with new one
*/
} else {
/*
* Property values may be a shared resources among
* different nodes. We will allocate resources
* on a per-handle basis.
*/
== NULL)
== NULL)
== NULL)
new_prop++;
}
ret = 0;
switch (type) {
case TOPO_TYPE_INT32:
break;
case TOPO_TYPE_UINT32:
break;
case TOPO_TYPE_INT64:
break;
case TOPO_TYPE_UINT64:
break;
case TOPO_TYPE_STRING:
(char *)val);
break;
case TOPO_TYPE_FMRI:
break;
case TOPO_TYPE_INT32_ARRAY:
break;
case TOPO_TYPE_UINT32_ARRAY:
break;
case TOPO_TYPE_INT64_ARRAY:
break;
case TOPO_TYPE_UINT64_ARRAY:
break;
case TOPO_TYPE_STRING_ARRAY:
break;
case TOPO_TYPE_FMRI_ARRAY:
break;
default:
}
if (ret != 0) {
else
}
if (new_prop > 0)
return (0);
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
static int
{
return (-1);
}
int
{
/*
* Check for an existing property group and prop val
*/
/*
* Can this propval be inherited?
*/
/*
* Property group should already exist: bump the ref count for this
* propval and add it to the node's property group
*/
== NULL)
return (0);
}
{
sizeof (topo_pgroup_info_t))) == NULL)
return (NULL);
*err = ETOPO_PROP_NOMEM;
sizeof (topo_pgroup_info_t));
return (NULL);
}
return (info);
}
}
*err = ETOPO_PROP_NOENT;
return (NULL);
}
static int
int *err)
{
}
*err = ETOPO_NOMEM;
return (-1);
}
int
{
*err = 0;
/*
* Check for an existing pgroup
*/
*err = ETOPO_PROP_DEFD;
return (-1);
}
}
*err = ETOPO_NOMEM;
return (-1);
}
== NULL)
== NULL)
return (0);
}
void
{
break;
}
}
return;
}
}
}
}
void
{
}
}
}
}
static void
{
}
void
{
}
void
{
}