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

Function imd_entry_remove

src/lib/imd.c:585–610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583}
584
585int imd_entry_remove(const struct imd *imd, const struct imd_entry *entry)
586{
587 struct imd_root *r;
588 const struct imdr *imdr;
589
590 imdr = imd_entry_to_imdr(imd, entry);
591
592 if (imdr == NULL)
593 return -1;
594
595 r = imdr_root(imdr);
596
597 if (root_is_locked(r))
598 return -1;
599
600 if (entry != root_last_entry(r))
601 return -1;
602
603 /* Don't remove entry covering root region */
604 if (r->num_entries == 1)
605 return -1;
606
607 r->num_entries--;
608
609 return 0;
610}
611
612static void imdr_print_entries(const struct imdr *imdr, const char *indent,
613 const struct imd_lookup *lookup, size_t size)

Callers 2

cbmem_entry_removeFunction · 0.85
test_imd_entry_removeFunction · 0.85

Calls 4

imd_entry_to_imdrFunction · 0.85
imdr_rootFunction · 0.85
root_is_lockedFunction · 0.85
root_last_entryFunction · 0.85

Tested by 1

test_imd_entry_removeFunction · 0.68