MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xlp_bootargs_init

Function xlp_bootargs_init

freebsd/mips/nlm/xlp_machdep.c:269–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267
268#ifdef FDT
269static void
270xlp_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

Callers 1

platform_startFunction · 0.85

Calls 7

boot_parse_cmdlineFunction · 0.85
strsepFunction · 0.85
strlcpyFunction · 0.50
kern_setenvFunction · 0.50
getenv_uintFunction · 0.50
kern_getenvFunction · 0.50
freeenvFunction · 0.50

Tested by

no test coverage detected