MCPcopy Create free account
hub / github.com/coreboot/coreboot / rmodule_load

Function rmodule_load

src/lib/rmodule.c:171–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171int rmodule_load(void *base, struct rmodule *module)
172{
173 /*
174 * In order to load the module at a given address, the following steps
175 * take place:
176 * 1. Copy payload to base address.
177 * 2. Adjust relocations within the module to new base address.
178 * 3. Clear the bss segment last since the relocations live where
179 * the bss is. If an rmodule is being loaded from its load
180 * address the relocations need to be processed before the bss.
181 */
182 module->location = base;
183 rmodule_copy_payload(module);
184 if (rmodule_relocate(module))
185 return -1;
186 rmodule_clear_bss(module);
187
188 prog_segment_loaded((uintptr_t)module->location,
189 rmodule_memory_size(module), SEG_FINAL);
190
191 return 0;
192}
193
194static void *rmodule_cbfs_allocator(void *rsl_arg, size_t unused,
195 const union cbfs_mdata *mdata)

Callers 4

rmodule_stage_loadFunction · 0.85
load_sipi_vectorFunction · 0.85
smm_module_setup_stubFunction · 0.85
smm_load_moduleFunction · 0.85

Calls 5

rmodule_copy_payloadFunction · 0.85
rmodule_relocateFunction · 0.85
rmodule_clear_bssFunction · 0.85
prog_segment_loadedFunction · 0.85
rmodule_memory_sizeFunction · 0.85

Tested by

no test coverage detected