prom_emul.h (7c478bd9) prom_emul.h (fa9e4066)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 6 unchanged lines hidden (view full) ---

15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 6 unchanged lines hidden (view full) ---

15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
23 * Copyright (c) 1995-1999 by Sun Microsystems, Inc.
24 * All rights reserved.
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#ifndef _SYS_PROM_EMUL_H
28#define _SYS_PROM_EMUL_H
29
30#pragma ident "%Z%%M% %I% %E% SMI"
31
32#ifdef __cplusplus

--- 11 unchanged lines hidden (view full) ---

44 void *pp_val;
45};
46
47/*
48 * The following structure describes a node in the in-kernel copy
49 * of the PROM device tree.
50 */
51struct prom_node {
25 */
26
27#ifndef _SYS_PROM_EMUL_H
28#define _SYS_PROM_EMUL_H
29
30#pragma ident "%Z%%M% %I% %E% SMI"
31
32#ifdef __cplusplus

--- 11 unchanged lines hidden (view full) ---

44 void *pp_val;
45};
46
47/*
48 * The following structure describes a node in the in-kernel copy
49 * of the PROM device tree.
50 */
51struct prom_node {
52 dnode_t pn_nodeid;
52 pnode_t pn_nodeid;
53 struct prom_prop *pn_propp;
54 struct prom_node *pn_child;
55 struct prom_node *pn_sibling;
56};
57
58typedef struct prom_node prom_node_t;
59
60/*
61 * These are promif emulation functions, intended only for promif use
62 */
63extern void promif_create_device_tree(void);
64
53 struct prom_prop *pn_propp;
54 struct prom_node *pn_child;
55 struct prom_node *pn_sibling;
56};
57
58typedef struct prom_node prom_node_t;
59
60/*
61 * These are promif emulation functions, intended only for promif use
62 */
63extern void promif_create_device_tree(void);
64
65extern dnode_t promif_findnode_byname(dnode_t n, char *name);
66extern dnode_t promif_nextnode(dnode_t n);
67extern dnode_t promif_childnode(dnode_t n);
65extern pnode_t promif_findnode_byname(pnode_t n, char *name);
66extern pnode_t promif_nextnode(pnode_t n);
67extern pnode_t promif_childnode(pnode_t n);
68
68
69extern int promif_getproplen(dnode_t n, char *name);
70extern int promif_getprop(dnode_t n, char *name, void *value);
71extern int promif_bounded_getprop(dnode_t, char *name, void *value, int len);
72char *promif_nextprop(dnode_t n, char *previous, char *next);
69extern int promif_getproplen(pnode_t n, char *name);
70extern int promif_getprop(pnode_t n, char *name, void *value);
71extern int promif_bounded_getprop(pnode_t, char *name, void *value, int len);
72char *promif_nextprop(pnode_t n, char *previous, char *next);
73
74/*
75 * XXX: The following functions are unsafe and unecessary, and should be
76 * XXX: removed. OS created nodes belong in the OS copy of the device tree.
77 * XXX: The OS should not be creating nodes in the prom's device tree!
78 */
73
74/*
75 * XXX: The following functions are unsafe and unecessary, and should be
76 * XXX: removed. OS created nodes belong in the OS copy of the device tree.
77 * XXX: The OS should not be creating nodes in the prom's device tree!
78 */
79extern dnode_t promif_add_child(dnode_t parent, dnode_t child, char *name);
80extern void promif_create_prop_external(dnode_t, char *name, void *, int);
79extern pnode_t promif_add_child(pnode_t parent, pnode_t child, char *name);
80extern void promif_create_prop_external(pnode_t, char *name, void *, int);
81
82#ifdef __cplusplus
83}
84#endif
85
86#endif /* _SYS_PROM_EMUL_H */
81
82#ifdef __cplusplus
83}
84#endif
85
86#endif /* _SYS_PROM_EMUL_H */