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

Function preload_search_next_name

freebsd/kern/subr_module.c:122–157  ·  view source on GitHub ↗

* Walk through the preloaded module list */

Source from the content-addressed store, hash-verified

120 * Walk through the preloaded module list
121 */
122caddr_t
123preload_search_next_name(caddr_t base)
124{
125 caddr_t curp;
126 uint32_t *hdr;
127 int next;
128
129 if (preload_metadata != NULL) {
130 /* Pick up where we left off last time */
131 if (base) {
132 /* skip to next field */
133 curp = base;
134 hdr = (uint32_t *)curp;
135 next = sizeof(uint32_t) * 2 + hdr[1];
136 next = roundup(next, sizeof(u_long));
137 curp += next;
138 } else
139 curp = preload_metadata;
140
141 for (;;) {
142 hdr = (uint32_t *)curp;
143 if (hdr[0] == 0 && hdr[1] == 0)
144 break;
145
146 /* Found a new record? */
147 if (hdr[0] == MODINFO_NAME)
148 return curp;
149
150 /* skip to next field */
151 next = sizeof(uint32_t) * 2 + hdr[1];
152 next = roundup(next, sizeof(u_long));
153 curp += next;
154 }
155 }
156 return(NULL);
157}
158
159/*
160 * Given a preloaded module handle (mod), return a pointer

Callers 3

linker_preloadFunction · 0.85
ucode_releaseFunction · 0.85
ucode_load_bspFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected