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

Function physmem_dump_tables

freebsd/kern/subr_physmem.c:95–130  ·  view source on GitHub ↗

* Print the contents of the physical and excluded region tables using the * provided printf-like output function (which will be either printf or * db_printf). */

Source from the content-addressed store, hash-verified

93 * db_printf).
94 */
95static void
96physmem_dump_tables(int (*prfunc)(const char *, ...))
97{
98 int flags, i;
99 uintmax_t addr, size;
100 const unsigned int mbyte = 1024 * 1024;
101
102 prfunc("Physical memory chunk(s):\n");
103 for (i = 0; i < hwcnt; ++i) {
104 addr = hwregions[i].addr;
105 size = hwregions[i].size;
106 prfunc(" 0x%08jx - 0x%08jx, %5ju MB (%7ju pages)\n", addr,
107 addr + size - 1, size / mbyte, size / PAGE_SIZE);
108 }
109
110 prfunc("Excluded memory regions:\n");
111 for (i = 0; i < excnt; ++i) {
112 addr = exregions[i].addr;
113 size = exregions[i].size;
114 flags = exregions[i].flags;
115 prfunc(" 0x%08jx - 0x%08jx, %5ju MB (%7ju pages) %s %s\n",
116 addr, addr + size - 1, size / mbyte, size / PAGE_SIZE,
117 (flags & EXFLAG_NOALLOC) ? "NoAlloc" : "",
118 (flags & EXFLAG_NODUMP) ? "NoDump" : "");
119 }
120
121#ifdef DEBUG
122 prfunc("Avail lists:\n");
123 for (i = 0; phys_avail[i] != 0; ++i) {
124 prfunc(" phys_avail[%d] 0x%08x\n", i, phys_avail[i]);
125 }
126 for (i = 0; dump_avail[i] != 0; ++i) {
127 prfunc(" dump_avail[%d] 0x%08x\n", i, dump_avail[i]);
128 }
129#endif
130}
131
132/*
133 * Print the contents of the static mapping table. Used for bootverbose.

Callers 2

physmem_print_tablesFunction · 0.85
subr_physmem.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected