| 267 | |
| 268 | #ifdef FDT |
| 269 | static void |
| 270 | xlp_bootargs_init(__register_t arg) |
| 271 | { |
| 272 | char buf[2048]; /* early stack is big enough */ |
| 273 | void *dtbp; |
| 274 | phandle_t chosen; |
| 275 | ihandle_t mask; |
| 276 | |
| 277 | dtbp = (void *)(intptr_t)arg; |
| 278 | #if defined(FDT_DTB_STATIC) |
| 279 | /* |
| 280 | * In case the device tree blob was not passed as argument try |
| 281 | * to use the statically embedded one. |
| 282 | */ |
| 283 | if (dtbp == NULL) |
| 284 | dtbp = &fdt_static_dtb; |
| 285 | #endif |
| 286 | if (OF_install(OFW_FDT, 0) == FALSE) |
| 287 | while (1); |
| 288 | if (OF_init((void *)dtbp) != 0) |
| 289 | while (1); |
| 290 | OF_interpret("perform-fixup", 0); |
| 291 | |
| 292 | chosen = OF_finddevice("/chosen"); |
| 293 | if (OF_getprop(chosen, "cpumask", &mask, sizeof(mask)) != -1) { |
| 294 | xlp_hw_thread_mask = mask; |
| 295 | } |
| 296 | |
| 297 | if (OF_getprop(chosen, "bootargs", buf, sizeof(buf)) != -1) |
| 298 | boothowto |= boot_parse_cmdline(buf); |
| 299 | } |
| 300 | #else |
| 301 | /* |
| 302 | * arg is a pointer to the environment block, the format of the block is |
no test coverage detected