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

Function get_preload_rdev

src/lib/cbfs.c:428–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426}
427
428static enum cb_err get_preload_rdev(struct region_device *rdev, const char *name)
429{
430 enum cb_err err;
431 struct cbfs_preload_context *context;
432
433 if (!CONFIG(CBFS_PRELOAD) || !ENV_SUPPORTS_COOP)
434 return CB_ERR_ARG;
435
436 context = find_cbfs_preload_context(name);
437 if (!context)
438 return CB_ERR_ARG;
439
440 err = thread_join(&context->handle);
441 if (err != CB_SUCCESS) {
442 ERROR("%s(name='%s') Preload thread failed: %u\n", __func__, name, err);
443
444 goto out;
445 }
446
447 if (rdev_chain_mem(rdev, context->buffer, region_device_sz(&context->rdev)) != 0) {
448 ERROR("%s(name='%s') chaining failed\n", __func__, name);
449
450 err = CB_ERR;
451 goto out;
452 }
453
454 err = CB_SUCCESS;
455
456 DEBUG("%s(name='%s') preload successful\n", __func__, name);
457
458out:
459 free_cbfs_preload_context(context);
460
461 return err;
462}
463
464static void *do_alloc(union cbfs_mdata *mdata, struct region_device *rdev,
465 cbfs_allocator_t allocator, void *arg, size_t *size_out,

Callers 1

_cbfs_allocFunction · 0.85

Calls 5

thread_joinFunction · 0.85
rdev_chain_memFunction · 0.85
region_device_szFunction · 0.85

Tested by

no test coverage detected