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

Function xen_legacy_pvh_parse_preload_data

freebsd/x86/xen/pv.c:513–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511#endif
512
513static caddr_t
514xen_legacy_pvh_parse_preload_data(uint64_t modulep)
515{
516 caddr_t kmdp;
517 vm_ooffset_t off;
518 vm_paddr_t metadata;
519 char *envp;
520
521 if (legacy_start_info->mod_start != 0) {
522 preload_metadata = (caddr_t)legacy_start_info->mod_start;
523
524 kmdp = preload_search_by_type("elf kernel");
525 if (kmdp == NULL)
526 kmdp = preload_search_by_type("elf64 kernel");
527 KASSERT(kmdp != NULL, ("unable to find kernel"));
528
529 /*
530 * Xen has relocated the metadata and the modules,
531 * so we need to recalculate it's position. This is
532 * done by saving the original modulep address and
533 * then calculating the offset with mod_start,
534 * which contains the relocated modulep address.
535 */
536 metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, vm_paddr_t);
537 off = legacy_start_info->mod_start - metadata;
538
539 preload_bootstrap_relocate(off);
540
541 boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int);
542 envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *);
543 if (envp != NULL)
544 envp += off;
545 xen_pvh_set_env(envp, NULL);
546 } else {
547 /* Parse the extra boot information given by Xen */
548 boot_parse_cmdline_delim(legacy_start_info->cmd_line, ",");
549 kmdp = NULL;
550 }
551
552 boothowto |= boot_env_to_howto();
553
554#ifdef DDB
555 xen_pvh_parse_symtab();
556#endif
557 return (kmdp);
558}
559
560static caddr_t
561xen_pvh_parse_preload_data(uint64_t modulep)

Callers

nothing calls this directly

Calls 6

preload_search_by_typeFunction · 0.85
xen_pvh_set_envFunction · 0.85
boot_parse_cmdline_delimFunction · 0.85
boot_env_to_howtoFunction · 0.85
xen_pvh_parse_symtabFunction · 0.85

Tested by

no test coverage detected