ofwvar.h (41fe50f5deab9062cdf5915541105e47679ba571) ofwvar.h (481d6b549b172c5faea8d3b94de5a5b0ab1f5f9a)
1/*-
2 * Copyright (c) 2005 Peter Grehan
3 * Copyright (c) 2008 Nathan Whitehorn
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD$
28 */
29
1/*-
2 * Copyright (c) 2005 Peter Grehan
3 * Copyright (c) 2008 Nathan Whitehorn
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD$
28 */
29
30#ifndef _OFW_OFWVAR_H_
31#define _OFW_OFWVAR_H_
30#ifndef _DEV_OFW_OFWVAR_H_
31#define _DEV_OFW_OFWVAR_H_
32
33/*
34 * An Open Firmware client implementation is declared with a kernel object and
35 * an associated method table, similar to a device driver.
36 *
37 * e.g.
38 *
39 * static ofw_method_t fdt_methods[] = {
40 * OFWMETHOD(ofw_init, fdt_init),
41 * OFWMETHOD(ofw_finddevice, fdt_finddevice),
42 * ...
43 * OFWMETHOD(ofw_nextprop, fdt_nextprop),
44 * { 0, 0 }
45 * };
46 *
47 * static ofw_def_t ofw_fdt = {
32
33/*
34 * An Open Firmware client implementation is declared with a kernel object and
35 * an associated method table, similar to a device driver.
36 *
37 * e.g.
38 *
39 * static ofw_method_t fdt_methods[] = {
40 * OFWMETHOD(ofw_init, fdt_init),
41 * OFWMETHOD(ofw_finddevice, fdt_finddevice),
42 * ...
43 * OFWMETHOD(ofw_nextprop, fdt_nextprop),
44 * { 0, 0 }
45 * };
46 *
47 * static ofw_def_t ofw_fdt = {
48 * "ofw_fdt",
48 * "ofw_fdt",
49 * fdt_methods,
50 * sizeof(fdt_softc), // or 0 if no softc
51 * };
52 *
53 * OFW_DEF(ofw_fdt);
54 */
55
56#include <sys/kobj.h>

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

64 /*
65 * Utility elements that an instance may use
66 */
67 struct mtx ofw_mtx; /* available for instance use */
68 void *ofw_iptr; /* instance data pointer */
69
70 /*
71 * Opaque data that can be overlaid with an instance-private
49 * fdt_methods,
50 * sizeof(fdt_softc), // or 0 if no softc
51 * };
52 *
53 * OFW_DEF(ofw_fdt);
54 */
55
56#include <sys/kobj.h>

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

64 /*
65 * Utility elements that an instance may use
66 */
67 struct mtx ofw_mtx; /* available for instance use */
68 void *ofw_iptr; /* instance data pointer */
69
70 /*
71 * Opaque data that can be overlaid with an instance-private
72 * structure. OFW code can test that this is large enough at
73 * compile time with a sizeof() test againt it's softc. There
72 * structure. OFW code can test that this is large enough at
73 * compile time with a sizeof() test againt it's softc. There
74 * is also a run-time test when the MMU kernel object is
75 * registered.
76 */
74 * is also a run-time test when the MMU kernel object is
75 * registered.
76 */
77#define OFW_OPAQUESZ 64
77#define OFW_OPAQUESZ 64
78 u_int ofw_opaque[OFW_OPAQUESZ];
79};
80
81typedef struct ofw_kobj *ofw_t;
82typedef struct kobj_class ofw_def_t;
83
78 u_int ofw_opaque[OFW_OPAQUESZ];
79};
80
81typedef struct ofw_kobj *ofw_t;
82typedef struct kobj_class ofw_def_t;
83
84#define ofw_method_t kobj_method_t
85#define OFWMETHOD KOBJMETHOD
84#define ofw_method_t kobj_method_t
85#define OFWMETHOD KOBJMETHOD
86
86
87#define OFW_DEF(name) DATA_SET(ofw_set, name)
87#define OFW_DEF(name) DATA_SET(ofw_set, name)
88
88
89#endif /* _OFW_OFWVAR_H_ */
89#endif /* _DEV_OFW_OFWVAR_H_ */