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

Function vm_phys_early_startup

freebsd/vm/vm_phys.c:1698–1732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1696}
1697
1698void
1699vm_phys_early_startup(void)
1700{
1701 struct vm_phys_seg *seg;
1702 int i;
1703
1704 for (i = 0; phys_avail[i + 1] != 0; i += 2) {
1705 phys_avail[i] = round_page(phys_avail[i]);
1706 phys_avail[i + 1] = trunc_page(phys_avail[i + 1]);
1707 }
1708
1709 for (i = 0; i < vm_phys_early_nsegs; i++) {
1710 seg = &vm_phys_early_segs[i];
1711 vm_phys_add_seg(seg->start, seg->end);
1712 }
1713 vm_phys_early_nsegs = -1;
1714
1715#ifdef NUMA
1716 /* Force phys_avail to be split by domain. */
1717 if (mem_affinity != NULL) {
1718 int idx;
1719
1720 for (i = 0; mem_affinity[i].end != 0; i++) {
1721 idx = vm_phys_avail_find(mem_affinity[i].start);
1722 if (idx != -1 &&
1723 phys_avail[idx] != mem_affinity[i].start)
1724 vm_phys_avail_split(mem_affinity[i].start, idx);
1725 idx = vm_phys_avail_find(mem_affinity[i].end);
1726 if (idx != -1 &&
1727 phys_avail[idx] != mem_affinity[i].end)
1728 vm_phys_avail_split(mem_affinity[i].end, idx);
1729 }
1730 }
1731#endif
1732}
1733
1734#ifdef DDB
1735/*

Callers 1

vm_page_startupFunction · 0.85

Calls 3

vm_phys_add_segFunction · 0.85
vm_phys_avail_findFunction · 0.85
vm_phys_avail_splitFunction · 0.85

Tested by

no test coverage detected