usr/src/lib/fm/topo/libtopo/common/libtopo.h
author robj
Mon, 17 Sep 2007 12:24:38 -0700
changeset 5068 06d88145c7f7
parent 4087 b986877655d2
child 6292 964ff070e569
permissions -rw-r--r--
6492246 x64 cpu/mem topology/diagnosis should include FRU labels 6552234 Add propset/propmethod/propmap support to topology XML schema and libtopo parsing engine 6562046 libtopo dcmds cause mdb crash 6577125 fmtopo coredumps in print_fmri_props 6577127 wrong topo_method_invoke return code when method versions mismatch 6578581 using fmsim in root account. The fmsim can not be started. 6601280 add interfaces to libipmi to simplify access to fru inventory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
     1
/*
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
     2
 * CDDL HEADER START
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
     3
 *
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
     5
 * Common Development and Distribution License (the "License").
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
     6
 * You may not use this file except in compliance with the License.
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
     7
 *
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    11
 * and limitations under the License.
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    12
 *
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    18
 *
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    19
 * CDDL HEADER END
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    20
 */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    21
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    22
/*
3681
d93cfde2f771 6519375 refactored the mdesc code in cpu scheme, platform-cpu.so and chip.so into a single code base
vn83148
parents: 3670
diff changeset
    23
 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    24
 * Use is subject to license terms.
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    25
 */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    26
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    27
#ifndef _LIBTOPO_H
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    28
#define	_LIBTOPO_H
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    29
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    30
#pragma ident	"%Z%%M%	%I%	%E% SMI"
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    31
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    32
#include <sys/nvpair.h>
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
    33
#include <stdio.h>
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    34
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    35
#ifdef __cplusplus
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    36
extern "C" {
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    37
#endif
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    38
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    39
#define	TOPO_VERSION	1	/* Library ABI Interface Version */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    40
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    41
typedef struct topo_hdl topo_hdl_t;
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    42
typedef struct topo_node tnode_t;
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    43
typedef struct topo_walk topo_walk_t;
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    44
typedef int32_t topo_instance_t;
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    45
typedef uint32_t topo_version_t;
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    46
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    47
/*
4087
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
    48
 * The following functions, error codes and data structures are private
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
    49
 * to libtopo snapshot consumers and enumerator modules.
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    50
 */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    51
extern topo_hdl_t *topo_open(int, const char *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    52
extern void topo_close(topo_hdl_t *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    53
extern char *topo_snap_hold(topo_hdl_t *, const char *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    54
extern void topo_snap_release(topo_hdl_t *);
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
    55
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
    56
/*
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
    57
 * Snapshot walker support
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
    58
 */
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
    59
typedef int (*topo_walk_cb_t)(topo_hdl_t *, tnode_t *, void *);
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
    60
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    61
extern topo_walk_t *topo_walk_init(topo_hdl_t *, const char *, topo_walk_cb_t,
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    62
    void *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    63
extern int topo_walk_step(topo_walk_t *, int);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    64
extern void topo_walk_fini(topo_walk_t *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    65
4087
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
    66
/*
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
    67
 * Walk status returned from walker
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
    68
 */
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    69
#define	TOPO_WALK_ERR		-1
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    70
#define	TOPO_WALK_NEXT		0
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    71
#define	TOPO_WALK_TERMINATE	1
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    72
4087
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
    73
/*
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
    74
 * Types of walks: depth-first (child) or breadth-first (sibling)
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
    75
 */
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    76
#define	TOPO_WALK_CHILD		0x0001
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    77
#define	TOPO_WALK_SIBLING	0x0002
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    78
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
    79
/*
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
    80
 * FMRI helper routines
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
    81
 */
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    82
extern int topo_fmri_present(topo_hdl_t *, nvlist_t *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    83
extern int topo_fmri_contains(topo_hdl_t *, nvlist_t *, nvlist_t *, int *);
3681
d93cfde2f771 6519375 refactored the mdesc code in cpu scheme, platform-cpu.so and chip.so into a single code base
vn83148
parents: 3670
diff changeset
    84
extern int topo_fmri_expand(topo_hdl_t *, nvlist_t *, int *);
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    85
extern int topo_fmri_unusable(topo_hdl_t *, nvlist_t *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    86
extern int topo_fmri_nvl2str(topo_hdl_t *, nvlist_t *, char **, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    87
extern int topo_fmri_str2nvl(topo_hdl_t *, const char *, nvlist_t **, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    88
extern int topo_fmri_asru(topo_hdl_t *, nvlist_t *, nvlist_t **, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    89
extern int topo_fmri_fru(topo_hdl_t *, nvlist_t *, nvlist_t **,
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    90
    int *);
3323
3cff27a475a5 PSARC 2006/679 Fault Event Extension
cindi
parents: 3062
diff changeset
    91
extern int topo_fmri_label(topo_hdl_t *, nvlist_t *, char **, int *);
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    92
extern int topo_fmri_compare(topo_hdl_t *, nvlist_t *, nvlist_t *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    93
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    94
/*
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    95
 * Topo node utilities: callable from topo_walk_step() callback or module
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    96
 * enumeration, topo_mod_enumerate()
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    97
 */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    98
extern char *topo_node_name(tnode_t *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
    99
extern topo_instance_t topo_node_instance(tnode_t *);
5068
06d88145c7f7 6492246 x64 cpu/mem topology/diagnosis should include FRU labels
robj
parents: 4087
diff changeset
   100
extern tnode_t *topo_node_parent(tnode_t *);
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   101
extern void *topo_node_private(tnode_t *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   102
extern int topo_node_asru(tnode_t *, nvlist_t **, nvlist_t *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   103
extern int topo_node_fru(tnode_t *, nvlist_t **, nvlist_t *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   104
extern int topo_node_resource(tnode_t *, nvlist_t **, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   105
extern int topo_node_label(tnode_t *, char **, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   106
extern int topo_method_invoke(tnode_t *node, const char *, topo_version_t,
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   107
    nvlist_t *, nvlist_t **, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   108
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   109
extern int topo_prop_get_int32(tnode_t *, const char *, const char *,
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   110
    int32_t *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   111
extern int topo_prop_get_uint32(tnode_t *, const char *, const char *,
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   112
    uint32_t *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   113
extern int topo_prop_get_int64(tnode_t *, const char *, const char *,
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   114
    int64_t *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   115
extern int topo_prop_get_uint64(tnode_t *, const char *, const char *,
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   116
    uint64_t *, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   117
extern int topo_prop_get_string(tnode_t *, const char *, const char *,
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   118
    char **, int *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   119
extern int topo_prop_get_fmri(tnode_t *, const char *, const char *,
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   120
    nvlist_t **, int *);
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   121
extern int topo_prop_get_int32_array(tnode_t *, const char *, const char *,
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   122
    int32_t **, uint_t *, int *);
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   123
extern int topo_prop_get_uint32_array(tnode_t *, const char *, const char *,
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   124
    uint32_t **, uint_t *, int *);
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   125
extern int topo_prop_get_int64_array(tnode_t *, const char *, const char *,
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   126
    int64_t **, uint_t *, int *);
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   127
extern int topo_prop_get_uint64_array(tnode_t *, const char *, const char *,
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   128
    uint64_t **, uint_t *, int *);
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   129
extern int topo_prop_get_string_array(tnode_t *, const char *, const char *,
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   130
    char ***, uint_t *, int *);
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   131
extern int topo_prop_get_fmri_array(tnode_t *, const char *, const char *,
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   132
    nvlist_t ***, uint_t *, int *);
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   133
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   134
#define	TOPO_PROP_IMMUTABLE	0
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   135
#define	TOPO_PROP_MUTABLE	1
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   136
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   137
/* Protocol property group and property names */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   138
#define	TOPO_PGROUP_PROTOCOL	"protocol"	/* Required property group */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   139
#define	TOPO_PROP_RESOURCE	"resource"	/* resource FMRI */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   140
#define	TOPO_PROP_ASRU		"ASRU"		/* ASRU FMRI */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   141
#define	TOPO_PROP_FRU		"FRU"		/* FRU FMRI */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   142
#define	TOPO_PROP_MOD		"module"	/* software module FMRI */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   143
#define	TOPO_PROP_PKG		"package"	/* software package FMRI */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   144
#define	TOPO_PROP_LABEL		"label"		/*  property LABEL */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   145
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   146
/*
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   147
 * System property group
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   148
 */
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   149
#define	TOPO_PGROUP_SYSTEM	"system"
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   150
#define	TOPO_PROP_ISA		"isa"
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   151
#define	TOPO_PROP_MACHINE	"machine"
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   152
4087
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   153
/*
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   154
 * These enum definitions are used to define a set of error tags associated with
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   155
 * libtopo error conditions occuring during the adminstration of
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   156
 * properties, invocation of methods and fmri-based queries.  The shell script
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   157
 * mkerror.sh is used to parse this file and create a corresponding topo_error.c
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   158
 * source file.
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   159
 *
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   160
 * If you do something other than add a new error tag here, you may need to
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   161
 * update the mkerror shell script as it is based upon simple regexps.
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   162
 */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   163
typedef enum topo_prop_errno {
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   164
    ETOPO_PROP_UNKNOWN = 3000, /* unknown topo prop error */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   165
    ETOPO_PROP_NOENT,   /* undefined property or property group */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   166
    ETOPO_PROP_DEFD,    /* static property already defined */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   167
    ETOPO_PROP_NOMEM,   /* memory limit exceeded during property allocation */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   168
    ETOPO_PROP_TYPE,    /* invalid property type */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   169
    ETOPO_PROP_NAME,    /* invalid property name */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   170
    ETOPO_PROP_NOINHERIT, /* can not inherit property */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   171
    ETOPO_PROP_NVL,	/* malformed property nvlist */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   172
    ETOPO_PROP_METHOD,	/* get property method failed */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   173
    ETOPO_PROP_END	/* end of prop errno list (to ease auto-merge) */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   174
} topo_prop_errno_t;
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   175
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   176
typedef enum topo_method_errno {
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   177
    ETOPO_METHOD_UNKNOWN = 3100, /* unknown topo method error */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   178
    ETOPO_METHOD_INVAL,		/* invalid method registration */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   179
    ETOPO_METHOD_NOTSUP,	/* method not supported */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   180
    ETOPO_METHOD_FAIL,		/* method failed */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   181
    ETOPO_METHOD_VEROLD,	/* app is compiled to use obsolete method */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   182
    ETOPO_METHOD_VERNEW,	/* app is compiled to use obsolete method */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   183
    ETOPO_METHOD_NOMEM,		/* memory limit exceeded during method op */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   184
    ETOPO_METHOD_DEFD,		/* method op already defined */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   185
    ETOPO_METHOD_END		/* end of method errno list */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   186
} topo_method_errno_t;
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   187
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   188
typedef enum topo_fmri_errno {
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   189
    ETOPO_FMRI_UNKNOWN = 3200, /* unknown topo fmri error */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   190
    ETOPO_FMRI_NVL,		/* nvlist allocation failure for FMRI */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   191
    ETOPO_FMRI_VERSION,		/* invalid FMRI scheme version */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   192
    ETOPO_FMRI_MALFORM,		/* malformed FMRI */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   193
    ETOPO_FMRI_NOMEM,		/* memory limit exceeded */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   194
    ETOPO_FMRI_END		/* end of fmri errno list */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   195
} topo_fmri_errno_t;
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   196
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   197
typedef enum topo_hdl_errno {
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   198
    ETOPO_HDL_UNKNOWN = 3300,	/* unknown topo handle error */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   199
    ETOPO_HDL_ABIVER,		/* handle opened with invalid ABI version */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   200
    ETOPO_HDL_SNAP,		/* snapshot already taken */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   201
    ETOPO_HDL_INVAL,		/* invalid argument specified */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   202
    ETOPO_HDL_UUID,		/* uuid already set */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   203
    ETOPO_HDL_NOMEM,		/* memory limit exceeded */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   204
    ETOPO_HDL_END		/* end of handle errno list */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   205
} topo_hdl_errno_t;
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   206
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   207
extern const char *topo_strerror(int);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   208
extern void topo_hdl_strfree(topo_hdl_t *, char *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   209
extern void topo_debug_set(topo_hdl_t *, const char *, const char *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   210
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   211
/*
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   212
 * The following functions and data structures to support property
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   213
 * observability are private to the fmtopo command.
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   214
 */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   215
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   216
/*
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   217
 * Each topology node advertises the name and data stability of each of its
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   218
 * modules and properties. (see attributes(5)).
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   219
 */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   220
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   221
/*
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   222
 * Topo stability attributes
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   223
 */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   224
typedef enum topo_stability {
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   225
	TOPO_STABILITY_UNKNOWN = 0,	/* private to libtopo */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   226
	TOPO_STABILITY_INTERNAL,	/* private to libtopo */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   227
	TOPO_STABILITY_PRIVATE,		/* private to Sun */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   228
	TOPO_STABILITY_OBSOLETE,	/* scheduled for removal */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   229
	TOPO_STABILITY_EXTERNAL,	/* not controlled by Sun */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   230
	TOPO_STABILITY_UNSTABLE,	/* new or rapidly changing */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   231
	TOPO_STABILITY_EVOLVING,	/* less rapidly changing */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   232
	TOPO_STABILITY_STABLE,		/* mature interface from Sun */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   233
	TOPO_STABILITY_STANDARD		/* industry standard */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   234
} topo_stability_t;
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   235
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   236
#define	TOPO_STABILITY_MAX	TOPO_STABILITY_STANDARD	/* max valid stab */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   237
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   238
typedef struct topo_pgroup_info {
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   239
	const char *tpi_name;		/* property group name */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   240
	topo_stability_t tpi_namestab;	/* stability of group name */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   241
	topo_stability_t tpi_datastab;	/* stability of all property values */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   242
	topo_version_t tpi_version;	/* version of pgroup definition */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   243
} topo_pgroup_info_t;
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   244
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   245
extern topo_stability_t topo_name2stability(const char *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   246
extern const char *topo_stability2name(topo_stability_t);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   247
extern void topo_pgroup_destroy(tnode_t *, const char *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   248
extern topo_pgroup_info_t *topo_pgroup_info(tnode_t *, const char *, int *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   249
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   250
typedef enum {
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   251
	TOPO_TYPE_INVALID = 0,
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   252
	TOPO_TYPE_BOOLEAN,	/* boolean */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   253
	TOPO_TYPE_INT32,	/* int32_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   254
	TOPO_TYPE_UINT32,	/* uint32_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   255
	TOPO_TYPE_INT64,	/* int64_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   256
	TOPO_TYPE_UINT64,	/* uint64_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   257
	TOPO_TYPE_STRING,	/* const char* */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   258
	TOPO_TYPE_TIME,		/* uint64_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   259
	TOPO_TYPE_SIZE,		/* uint64_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   260
	TOPO_TYPE_FMRI,		/* nvlist_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   261
	TOPO_TYPE_INT32_ARRAY,	/* array of int32_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   262
	TOPO_TYPE_UINT32_ARRAY,	/* array of uint32_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   263
	TOPO_TYPE_INT64_ARRAY,	/* array of int64_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   264
	TOPO_TYPE_UINT64_ARRAY,	/* array of uint64_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   265
	TOPO_TYPE_STRING_ARRAY,	/* array of const char* */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   266
	TOPO_TYPE_FMRI_ARRAY	/* array of nvlist_t */
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   267
} topo_type_t;
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   268
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   269
extern nvlist_t *topo_prop_getprops(tnode_t *, int *err);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   270
extern int topo_prop_getprop(tnode_t *, const char *, const char *,
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   271
    nvlist_t *, nvlist_t **, int *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   272
extern int topo_prop_getpgrp(tnode_t *, const char *, nvlist_t **, int *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   273
extern int topo_prop_setprop(tnode_t *, const char *, nvlist_t *,
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   274
    int, nvlist_t *, int *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   275
extern int topo_fmri_getprop(topo_hdl_t *, nvlist_t *, const char *,
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   276
    const char *, nvlist_t *,  nvlist_t **, int *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   277
extern int topo_fmri_getpgrp(topo_hdl_t *, nvlist_t *, const char *,
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   278
    nvlist_t **, int *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   279
extern int topo_fmri_setprop(topo_hdl_t *, nvlist_t *, const char *,
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   280
    nvlist_t *, int, nvlist_t *, int *);
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   281
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   282
/* Property node NVL names used in topo_prop_getprops */
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   283
#define	TOPO_PROP_GROUP		"property-group"
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   284
#define	TOPO_PROP_GROUP_NAME	"property-group-name"
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   285
#define	TOPO_PROP_GROUP_DSTAB	"property-group-data-stability"
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   286
#define	TOPO_PROP_GROUP_NSTAB	"property-group-name-stability"
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   287
#define	TOPO_PROP_GROUP_VERSION	"property-group-version"
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   288
#define	TOPO_PROP_VAL		"property"
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   289
#define	TOPO_PROP_VAL_NAME	"property-name"
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   290
#define	TOPO_PROP_VAL_VAL	"property-value"
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   291
#define	TOPO_PROP_VAL_TYPE	"property-type"
4087
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   292
#define	TOPO_PROP_FLAG		"property-flag"
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   293
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   294
/*
4087
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   295
 * ARGS list used in topo property methods
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 1414
diff changeset
   296
 */
4087
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   297
#define	TOPO_PROP_ARGS	"args"
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   298
#define	TOPO_PROP_PARGS	"private-args"
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   299
4087
b986877655d2 6521594 fmtopo '[-Cdev]' usage doesn't make sense
cindi
parents: 3681
diff changeset
   300
extern int topo_xml_print(topo_hdl_t *, FILE *, const char *scheme, int *);
3681
d93cfde2f771 6519375 refactored the mdesc code in cpu scheme, platform-cpu.so and chip.so into a single code base
vn83148
parents: 3670
diff changeset
   301
1414
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   302
extern void *topo_hdl_alloc(topo_hdl_t *, size_t);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   303
extern void *topo_hdl_zalloc(topo_hdl_t *, size_t);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   304
extern void topo_hdl_free(topo_hdl_t *, void *, size_t);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   305
extern int topo_hdl_nvalloc(topo_hdl_t *, nvlist_t **, uint_t);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   306
extern int topo_hdl_nvdup(topo_hdl_t *, nvlist_t *, nvlist_t **);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   307
extern char *topo_hdl_strdup(topo_hdl_t *, const char *);
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   308
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   309
#ifdef __cplusplus
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   310
}
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   311
#endif
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   312
b4126407ac5b PSARC 2006/020 FMA for Athlon 64 and Opteron Processors
cindi
parents:
diff changeset
   313
#endif /* _LIBTOPO_H */