From ed9307db13671ee347a3f1288e87da508139feea Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 5 Feb 2014 15:44:30 -0600 Subject: memranges: add memranges_update_tag() functionality The memranges_update_tag() function replaces all instances that are tagged with old_tag and update to new_tag. This can be helpful in the MTRR code by adjusting the address space if certain memory types cause the MTRR usage to become too large. Change-Id: Ie5c405204de2fdd9fd1dd5d6190b223925d6d318 Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/5150 Tested-by: build bot (Jenkins) Reviewed-by: Vladimir Serbinenko --- src/include/memrange.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include') diff --git a/src/include/memrange.h b/src/include/memrange.h index 0e69b2ffeb..4f094f593e 100644 --- a/src/include/memrange.h +++ b/src/include/memrange.h @@ -110,6 +110,10 @@ void memranges_create_hole(struct memranges *ranges, void memranges_insert(struct memranges *ranges, resource_t base, resource_t size, unsigned long tag); +/* Update all entries with old_tag to new_tag. */ +void memranges_update_tag(struct memranges *ranges, unsigned long old_tag, + unsigned long new_tag); + /* Returns next entry after the provided entry. NULL if r is last. */ struct range_entry *memranges_next_entry(struct memranges *ranges, const struct range_entry *r); -- cgit v1.2.3