MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_ofw_get_address_count

Function rt_ofw_get_address_count

components/drivers/ofw/io.c:79–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79int rt_ofw_get_address_count(struct rt_ofw_node *np)
80{
81 int count;
82
83 if (np)
84 {
85 rt_ssize_t len;
86
87 count = 0;
88
89 if (rt_ofw_get_prop(np, "reg", &len))
90 {
91 count = len / (sizeof(fdt32_t) * (rt_ofw_io_addr_cells(np) + rt_ofw_io_size_cells(np)));
92 }
93 }
94 else
95 {
96 count = -RT_EINVAL;
97 }
98
99 return count;
100}
101
102static rt_err_t ofw_get_address(struct rt_ofw_node *np, int index, rt_uint64_t *out_address, rt_uint64_t *out_size)
103{

Callers 1

numa_ofw_initFunction · 0.85

Calls 3

rt_ofw_get_propFunction · 0.85
rt_ofw_io_addr_cellsFunction · 0.85
rt_ofw_io_size_cellsFunction · 0.85

Tested by

no test coverage detected