PageRenderTime 31ms CodeModel.GetById 22ms app.highlight 8ms RepoModel.GetById 0ms app.codeStats 0ms

/arch/sparc/kernel/of_device_common.h

https://bitbucket.org/cresqo/cm7-p500-kernel
C Header | 36 lines | 29 code | 6 blank | 1 comment | 1 complexity | 83435f9b6742f180cabdaefd113031ab MD5 | raw file
Possible License(s): LGPL-2.0, AGPL-1.0, GPL-2.0
 1#ifndef _OF_DEVICE_COMMON_H
 2#define _OF_DEVICE_COMMON_H
 3
 4static inline u64 of_read_addr(const u32 *cell, int size)
 5{
 6	u64 r = 0;
 7	while (size--)
 8		r = (r << 32) | *(cell++);
 9	return r;
10}
11
12void of_bus_default_count_cells(struct device_node *dev, int *addrc,
13				int *sizec);
14int of_out_of_range(const u32 *addr, const u32 *base,
15		    const u32 *size, int na, int ns);
16int of_bus_default_map(u32 *addr, const u32 *range, int na, int ns, int pna);
17unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags);
18
19int of_bus_sbus_match(struct device_node *np);
20void of_bus_sbus_count_cells(struct device_node *child, int *addrc, int *sizec);
21
22/* Max address size we deal with */
23#define OF_MAX_ADDR_CELLS	4
24
25struct of_bus {
26	const char	*name;
27	const char	*addr_prop_name;
28	int		(*match)(struct device_node *parent);
29	void		(*count_cells)(struct device_node *child,
30				       int *addrc, int *sizec);
31	int		(*map)(u32 *addr, const u32 *range,
32			       int na, int ns, int pna);
33	unsigned long	(*get_flags)(const u32 *addr, unsigned long);
34};
35
36#endif /* _OF_DEVICE_COMMON_H */