Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2017 Google, Inc |
| 4 | * Written by Simon Glass <sjg@chromium.org> |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 5 | */ |
| 6 | |
Álvaro Fernández Rojas | 67036129 | 2018-04-29 21:56:54 +0200 | [diff] [blame] | 7 | #include <asm/types.h> |
| 8 | #include <asm/io.h> |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 9 | #include <common.h> |
| 10 | #include <dm.h> |
Simon Glass | c47a388 | 2017-09-28 06:35:15 -0600 | [diff] [blame] | 11 | #include <mapmem.h> |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 12 | #include <dm/of_access.h> |
| 13 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 14 | int dev_read_u32(const struct udevice *dev, const char *propname, u32 *outp) |
Masahiro Yamada | 71d115f | 2017-12-30 02:00:05 +0900 | [diff] [blame] | 15 | { |
| 16 | return ofnode_read_u32(dev_ofnode(dev), propname, outp); |
| 17 | } |
| 18 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 19 | int dev_read_u32_default(const struct udevice *dev, const char *propname, |
| 20 | int def) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 21 | { |
| 22 | return ofnode_read_u32_default(dev_ofnode(dev), propname, def); |
| 23 | } |
| 24 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 25 | int dev_read_s32(const struct udevice *dev, const char *propname, s32 *outp) |
Simon Glass | 6df01f9 | 2018-12-10 10:37:37 -0700 | [diff] [blame] | 26 | { |
| 27 | return ofnode_read_u32(dev_ofnode(dev), propname, (u32 *)outp); |
| 28 | } |
| 29 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 30 | int dev_read_s32_default(const struct udevice *dev, const char *propname, |
| 31 | int def) |
Simon Glass | 6df01f9 | 2018-12-10 10:37:37 -0700 | [diff] [blame] | 32 | { |
| 33 | return ofnode_read_u32_default(dev_ofnode(dev), propname, def); |
| 34 | } |
| 35 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 36 | int dev_read_u32u(const struct udevice *dev, const char *propname, uint *outp) |
Simon Glass | 6df01f9 | 2018-12-10 10:37:37 -0700 | [diff] [blame] | 37 | { |
| 38 | u32 val; |
| 39 | int ret; |
| 40 | |
| 41 | ret = ofnode_read_u32(dev_ofnode(dev), propname, &val); |
| 42 | if (ret) |
| 43 | return ret; |
| 44 | *outp = val; |
| 45 | |
| 46 | return 0; |
| 47 | } |
| 48 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 49 | int dev_read_u64(const struct udevice *dev, const char *propname, u64 *outp) |
T Karthik Reddy | 478860d | 2019-09-02 16:34:30 +0200 | [diff] [blame] | 50 | { |
| 51 | return ofnode_read_u64(dev_ofnode(dev), propname, outp); |
| 52 | } |
| 53 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 54 | u64 dev_read_u64_default(const struct udevice *dev, const char *propname, |
| 55 | u64 def) |
T Karthik Reddy | 478860d | 2019-09-02 16:34:30 +0200 | [diff] [blame] | 56 | { |
| 57 | return ofnode_read_u64_default(dev_ofnode(dev), propname, def); |
| 58 | } |
| 59 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 60 | const char *dev_read_string(const struct udevice *dev, const char *propname) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 61 | { |
| 62 | return ofnode_read_string(dev_ofnode(dev), propname); |
| 63 | } |
| 64 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 65 | bool dev_read_bool(const struct udevice *dev, const char *propname) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 66 | { |
| 67 | return ofnode_read_bool(dev_ofnode(dev), propname); |
| 68 | } |
| 69 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 70 | ofnode dev_read_subnode(const struct udevice *dev, const char *subnode_name) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 71 | { |
| 72 | return ofnode_find_subnode(dev_ofnode(dev), subnode_name); |
| 73 | } |
| 74 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 75 | ofnode dev_read_first_subnode(const struct udevice *dev) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 76 | { |
| 77 | return ofnode_first_subnode(dev_ofnode(dev)); |
| 78 | } |
| 79 | |
| 80 | ofnode dev_read_next_subnode(ofnode node) |
| 81 | { |
| 82 | return ofnode_next_subnode(node); |
| 83 | } |
| 84 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 85 | int dev_read_size(const struct udevice *dev, const char *propname) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 86 | { |
| 87 | return ofnode_read_size(dev_ofnode(dev), propname); |
| 88 | } |
| 89 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 90 | fdt_addr_t dev_read_addr_index(const struct udevice *dev, int index) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 91 | { |
| 92 | if (ofnode_is_np(dev_ofnode(dev))) |
| 93 | return ofnode_get_addr_index(dev_ofnode(dev), index); |
| 94 | else |
| 95 | return devfdt_get_addr_index(dev, index); |
| 96 | } |
| 97 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 98 | fdt_addr_t dev_read_addr_size_index(const struct udevice *dev, int index, |
Sekhar Nori | f677c6f | 2019-08-01 19:12:56 +0530 | [diff] [blame] | 99 | fdt_size_t *size) |
| 100 | { |
| 101 | if (ofnode_is_np(dev_ofnode(dev))) |
| 102 | return ofnode_get_addr_size_index(dev_ofnode(dev), index, size); |
| 103 | else |
| 104 | return devfdt_get_addr_size_index(dev, index, size); |
| 105 | } |
| 106 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 107 | void *dev_remap_addr_index(const struct udevice *dev, int index) |
Álvaro Fernández Rojas | 67036129 | 2018-04-29 21:56:54 +0200 | [diff] [blame] | 108 | { |
| 109 | fdt_addr_t addr = dev_read_addr_index(dev, index); |
| 110 | |
| 111 | if (addr == FDT_ADDR_T_NONE) |
| 112 | return NULL; |
| 113 | |
| 114 | return map_physmem(addr, 0, MAP_NOCACHE); |
| 115 | } |
| 116 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 117 | fdt_addr_t dev_read_addr_name(const struct udevice *dev, const char *name) |
Álvaro Fernández Rojas | a318115 | 2018-12-03 19:37:09 +0100 | [diff] [blame] | 118 | { |
| 119 | int index = dev_read_stringlist_search(dev, "reg-names", name); |
| 120 | |
| 121 | if (index < 0) |
| 122 | return FDT_ADDR_T_NONE; |
| 123 | else |
| 124 | return dev_read_addr_index(dev, index); |
| 125 | } |
| 126 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 127 | fdt_addr_t dev_read_addr_size_name(const struct udevice *dev, const char *name, |
Sekhar Nori | f677c6f | 2019-08-01 19:12:56 +0530 | [diff] [blame] | 128 | fdt_size_t *size) |
| 129 | { |
| 130 | int index = dev_read_stringlist_search(dev, "reg-names", name); |
| 131 | |
| 132 | if (index < 0) |
| 133 | return FDT_ADDR_T_NONE; |
| 134 | else |
| 135 | return dev_read_addr_size_index(dev, index, size); |
| 136 | } |
| 137 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 138 | void *dev_remap_addr_name(const struct udevice *dev, const char *name) |
Álvaro Fernández Rojas | a318115 | 2018-12-03 19:37:09 +0100 | [diff] [blame] | 139 | { |
| 140 | fdt_addr_t addr = dev_read_addr_name(dev, name); |
| 141 | |
| 142 | if (addr == FDT_ADDR_T_NONE) |
| 143 | return NULL; |
| 144 | |
| 145 | return map_physmem(addr, 0, MAP_NOCACHE); |
| 146 | } |
| 147 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 148 | fdt_addr_t dev_read_addr(const struct udevice *dev) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 149 | { |
| 150 | return dev_read_addr_index(dev, 0); |
| 151 | } |
| 152 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 153 | void *dev_read_addr_ptr(const struct udevice *dev) |
Philipp Tomsich | 7719b39 | 2017-09-11 22:04:12 +0200 | [diff] [blame] | 154 | { |
| 155 | fdt_addr_t addr = dev_read_addr(dev); |
| 156 | |
Simon Glass | c47a388 | 2017-09-28 06:35:15 -0600 | [diff] [blame] | 157 | return (addr == FDT_ADDR_T_NONE) ? NULL : map_sysmem(addr, 0); |
Philipp Tomsich | 7719b39 | 2017-09-11 22:04:12 +0200 | [diff] [blame] | 158 | } |
| 159 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 160 | void *dev_remap_addr(const struct udevice *dev) |
Álvaro Fernández Rojas | 67036129 | 2018-04-29 21:56:54 +0200 | [diff] [blame] | 161 | { |
| 162 | return dev_remap_addr_index(dev, 0); |
| 163 | } |
| 164 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 165 | fdt_addr_t dev_read_addr_size(const struct udevice *dev, const char *property, |
Mario Six | 6eac222 | 2018-01-15 11:07:18 +0100 | [diff] [blame] | 166 | fdt_size_t *sizep) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 167 | { |
| 168 | return ofnode_get_addr_size(dev_ofnode(dev), property, sizep); |
| 169 | } |
| 170 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 171 | const char *dev_read_name(const struct udevice *dev) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 172 | { |
| 173 | return ofnode_get_name(dev_ofnode(dev)); |
| 174 | } |
| 175 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 176 | int dev_read_stringlist_search(const struct udevice *dev, const char *property, |
Mario Six | 6eac222 | 2018-01-15 11:07:18 +0100 | [diff] [blame] | 177 | const char *string) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 178 | { |
| 179 | return ofnode_stringlist_search(dev_ofnode(dev), property, string); |
| 180 | } |
| 181 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 182 | int dev_read_string_index(const struct udevice *dev, const char *propname, |
| 183 | int index, const char **outp) |
Jean-Jacques Hiblot | 8365ebd | 2017-09-21 17:03:09 +0200 | [diff] [blame] | 184 | { |
| 185 | return ofnode_read_string_index(dev_ofnode(dev), propname, index, outp); |
| 186 | } |
| 187 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 188 | int dev_read_string_count(const struct udevice *dev, const char *propname) |
Jean-Jacques Hiblot | 8365ebd | 2017-09-21 17:03:09 +0200 | [diff] [blame] | 189 | { |
| 190 | return ofnode_read_string_count(dev_ofnode(dev), propname); |
| 191 | } |
| 192 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 193 | int dev_read_phandle_with_args(const struct udevice *dev, const char *list_name, |
Mario Six | 6eac222 | 2018-01-15 11:07:18 +0100 | [diff] [blame] | 194 | const char *cells_name, int cell_count, |
| 195 | int index, struct ofnode_phandle_args *out_args) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 196 | { |
| 197 | return ofnode_parse_phandle_with_args(dev_ofnode(dev), list_name, |
| 198 | cells_name, cell_count, index, |
| 199 | out_args); |
| 200 | } |
| 201 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 202 | int dev_count_phandle_with_args(const struct udevice *dev, |
| 203 | const char *list_name, const char *cells_name) |
Patrice Chotard | 99503c1 | 2017-11-29 09:06:10 +0100 | [diff] [blame] | 204 | { |
| 205 | return ofnode_count_phandle_with_args(dev_ofnode(dev), list_name, |
| 206 | cells_name); |
| 207 | } |
| 208 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 209 | int dev_read_addr_cells(const struct udevice *dev) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 210 | { |
| 211 | return ofnode_read_addr_cells(dev_ofnode(dev)); |
| 212 | } |
| 213 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 214 | int dev_read_size_cells(const struct udevice *dev) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 215 | { |
| 216 | return ofnode_read_size_cells(dev_ofnode(dev)); |
| 217 | } |
| 218 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 219 | int dev_read_simple_addr_cells(const struct udevice *dev) |
Simon Glass | 4191dc1 | 2017-06-12 06:21:31 -0600 | [diff] [blame] | 220 | { |
| 221 | return ofnode_read_simple_addr_cells(dev_ofnode(dev)); |
| 222 | } |
| 223 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 224 | int dev_read_simple_size_cells(const struct udevice *dev) |
Simon Glass | 4191dc1 | 2017-06-12 06:21:31 -0600 | [diff] [blame] | 225 | { |
| 226 | return ofnode_read_simple_size_cells(dev_ofnode(dev)); |
| 227 | } |
| 228 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 229 | int dev_read_phandle(const struct udevice *dev) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 230 | { |
| 231 | ofnode node = dev_ofnode(dev); |
| 232 | |
| 233 | if (ofnode_is_np(node)) |
| 234 | return ofnode_to_np(node)->phandle; |
| 235 | else |
| 236 | return fdt_get_phandle(gd->fdt_blob, ofnode_to_offset(node)); |
| 237 | } |
| 238 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 239 | const void *dev_read_prop(const struct udevice *dev, const char *propname, |
| 240 | int *lenp) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 241 | { |
Masahiro Yamada | 9cf85cb | 2017-06-22 16:54:05 +0900 | [diff] [blame] | 242 | return ofnode_get_property(dev_ofnode(dev), propname, lenp); |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 243 | } |
| 244 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 245 | int dev_read_alias_seq(const struct udevice *dev, int *devnump) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 246 | { |
| 247 | ofnode node = dev_ofnode(dev); |
| 248 | const char *uc_name = dev->uclass->uc_drv->name; |
| 249 | int ret; |
| 250 | |
| 251 | if (ofnode_is_np(node)) { |
| 252 | ret = of_alias_get_id(ofnode_to_np(node), uc_name); |
| 253 | if (ret >= 0) |
| 254 | *devnump = ret; |
| 255 | } else { |
| 256 | ret = fdtdec_get_alias_seq(gd->fdt_blob, uc_name, |
| 257 | ofnode_to_offset(node), devnump); |
| 258 | } |
| 259 | |
| 260 | return ret; |
| 261 | } |
| 262 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 263 | int dev_read_u32_array(const struct udevice *dev, const char *propname, |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 264 | u32 *out_values, size_t sz) |
| 265 | { |
| 266 | return ofnode_read_u32_array(dev_ofnode(dev), propname, out_values, sz); |
| 267 | } |
| 268 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 269 | const uint8_t *dev_read_u8_array_ptr(const struct udevice *dev, |
| 270 | const char *propname, size_t sz) |
Simon Glass | cfdae5c | 2017-05-18 20:09:04 -0600 | [diff] [blame] | 271 | { |
| 272 | return ofnode_read_u8_array_ptr(dev_ofnode(dev), propname, sz); |
| 273 | } |
Simon Glass | fa031f8 | 2017-06-12 06:21:30 -0600 | [diff] [blame] | 274 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 275 | int dev_read_enabled(const struct udevice *dev) |
Simon Glass | fa031f8 | 2017-06-12 06:21:30 -0600 | [diff] [blame] | 276 | { |
| 277 | ofnode node = dev_ofnode(dev); |
| 278 | |
| 279 | if (ofnode_is_np(node)) |
| 280 | return of_device_is_available(ofnode_to_np(node)); |
| 281 | else |
| 282 | return fdtdec_get_is_enabled(gd->fdt_blob, |
| 283 | ofnode_to_offset(node)); |
| 284 | } |
Simon Glass | f7bfcc4 | 2017-07-25 08:29:55 -0600 | [diff] [blame] | 285 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 286 | int dev_read_resource(const struct udevice *dev, uint index, |
| 287 | struct resource *res) |
Simon Glass | f7bfcc4 | 2017-07-25 08:29:55 -0600 | [diff] [blame] | 288 | { |
| 289 | return ofnode_read_resource(dev_ofnode(dev), index, res); |
| 290 | } |
Masahiro Yamada | 4dada2c | 2017-08-26 01:12:30 +0900 | [diff] [blame] | 291 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 292 | int dev_read_resource_byname(const struct udevice *dev, const char *name, |
Masahiro Yamada | 4dada2c | 2017-08-26 01:12:30 +0900 | [diff] [blame] | 293 | struct resource *res) |
| 294 | { |
| 295 | return ofnode_read_resource_byname(dev_ofnode(dev), name, res); |
| 296 | } |
Mario Six | aefac06 | 2018-01-15 11:07:19 +0100 | [diff] [blame] | 297 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 298 | u64 dev_translate_address(const struct udevice *dev, const fdt32_t *in_addr) |
Mario Six | aefac06 | 2018-01-15 11:07:19 +0100 | [diff] [blame] | 299 | { |
| 300 | return ofnode_translate_address(dev_ofnode(dev), in_addr); |
| 301 | } |
Michal Simek | d0e30a0 | 2019-01-31 16:30:59 +0100 | [diff] [blame] | 302 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 303 | u64 dev_translate_dma_address(const struct udevice *dev, const fdt32_t *in_addr) |
Fabien Dessenne | 22236e0 | 2019-05-31 15:11:30 +0200 | [diff] [blame] | 304 | { |
| 305 | return ofnode_translate_dma_address(dev_ofnode(dev), in_addr); |
| 306 | } |
| 307 | |
Michal Simek | d0e30a0 | 2019-01-31 16:30:59 +0100 | [diff] [blame] | 308 | int dev_read_alias_highest_id(const char *stem) |
| 309 | { |
| 310 | if (of_live_active()) |
| 311 | return of_alias_get_highest_id(stem); |
| 312 | |
| 313 | return fdtdec_get_alias_highest_id(gd->fdt_blob, stem); |
| 314 | } |
Simon Glass | 23b2759 | 2019-09-15 12:08:58 -0600 | [diff] [blame] | 315 | |
Simon Glass | 2f9a612 | 2020-01-27 08:49:40 -0700 | [diff] [blame] | 316 | fdt_addr_t dev_read_addr_pci(const struct udevice *dev) |
Simon Glass | 23b2759 | 2019-09-15 12:08:58 -0600 | [diff] [blame] | 317 | { |
| 318 | ulong addr; |
| 319 | |
| 320 | addr = dev_read_addr(dev); |
| 321 | if (addr == FDT_ADDR_T_NONE && !of_live_active()) |
| 322 | addr = devfdt_get_addr_pci(dev); |
| 323 | |
| 324 | return addr; |
| 325 | } |