4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_PROMIF_IMPL_H
28 #define _SYS_PROMIF_IMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <sys/types.h>
38 #include <sys/promimpl.h>
40 #include <sys/obpdefs.h>
41 #include <sys/cmn_err.h>
45 * CIF handler functions
47 typedef int (*cif_func_t
) (void *);
48 extern int promif_getprop(void *p
);
49 extern int promif_getproplen(void *p
);
50 extern int promif_nextprop(void *p
);
51 extern int promif_nextnode(void *p
);
52 extern int promif_childnode(void *p
);
53 extern int promif_parentnode(void *p
);
54 extern int promif_enter_mon(void *p
);
55 extern int promif_exit_to_mon(void *p
);
56 extern int promif_reboot(void *p
);
57 extern int promif_write(void *p
);
58 extern int promif_read(void *p
);
59 extern int promif_interpret(void *p
);
60 extern int promif_finddevice(void *p
);
61 extern int promif_instance_to_package(void *p
);
63 extern int promif_setprop(void *p
);
64 extern int promif_test(void *p
);
65 extern int promif_instance_to_path(void *p
);
66 extern int promif_power_off(void *p
);
67 extern int promif_asr_list_keys_len(void *p
);
68 extern int promif_asr_list_keys(void *p
);
69 extern int promif_asr_export_len(void *p
);
70 extern int promif_asr_export(void *p
);
71 extern int promif_set_security_key(void *p
);
72 extern int promif_get_security_key(void *p
);
73 extern int promif_start_cpu(void *p
);
74 extern int promif_set_mmfsa_traptable(void *p
);
75 extern int promif_set_sun4v_api_version(void *p
);
76 extern int promif_get_sun4v_api_version(void *p
);
80 * Shadow device tree access functions
82 extern pnode_t
promif_stree_nextnode(pnode_t nodeid
);
83 extern pnode_t
promif_stree_childnode(pnode_t nodeid
);
84 extern pnode_t
promif_stree_parentnode(pnode_t nodeid
);
85 extern int promif_stree_getproplen(pnode_t
, char *name
);
86 extern int promif_stree_getprop(pnode_t
, char *name
, void *value
);
87 extern int promif_stree_setprop(pnode_t
, char *name
, void *value
, int len
);
88 extern char *promif_stree_nextprop(pnode_t nodeid
, char *name
, char *next
);
91 * Hooks for kmdb to get and set a pointer to the PROM shadow tree
94 extern void promif_stree_setroot(void *root
);
95 extern caddr_t
promif_stree_getroot(void);
99 * Miscellaneous functions
101 extern cif_func_t
promif_find_cif_callback(char *opname
);
102 extern int promif_ldom_setprop(char *name
, void *value
, int valuelen
);
103 extern char promif_getchar(void);
106 * Initialization functions
109 extern void cif_init(char *, caddr_t
, ihandle_t
, ihandle_t
,
110 phandle_t
, phandle_t
, pnode_t
, pnode_t
);
111 extern void promif_io_init(ihandle_t
, ihandle_t
, phandle_t
, phandle_t
);
112 extern void promif_set_nodes(pnode_t
, pnode_t
);
114 extern void promif_io_init(void);
115 extern void promif_stree_init(void);
116 extern void promif_prop_init(void);
124 extern uint_t cif_debug
;
126 #define CIF_DBG_FLAG_NODE 0x01
127 #define CIF_DBG_FLAG_REBOOT 0x02
129 #define CIF_DBG_ALL if (cif_debug) prom_printf
130 #define CIF_DBG_NODE if (cif_debug & CIF_DBG_FLAG_NODE) prom_printf
131 #define CIF_DBG_REBOOT if (cif_debug & CIF_DBG_FLAG_REBOOT) prom_printf
135 #define CIF_DBG_ALL _NOTE(CONSTCOND) if (0) prom_printf
136 #define CIF_DBG_NODE CIF_DBG_ALL
137 #define CIF_DBG_REBOOT CIF_DBG_ALL
145 #endif /* _SYS_PROMIF_IMPL_H */