diff options
author | Julius Werner <jwerner@chromium.org> | 2021-04-16 16:48:32 -0700 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2021-04-21 02:06:26 +0000 |
commit | c893197352acc9b53c1beef5082cbc0271f63688 (patch) | |
tree | b975712387bd54bd0101a736adbb2a6fe5b824bb /src/drivers/smmstore | |
parent | b03e497ef16e9e38ba9220d31131a6bfdef35390 (diff) |
commonlib/region: Turn addrspace_32bit into a more official API
We had the addrspace_32bit rdev in prog_loaders.c for a while to help
represent memory ranges as an rdev, and we've found it useful for a
couple of things that have nothing to do with program loading. This
patch moves the concept straight into commonlib/region.c so it is no
longer anchored in such a weird place, and easier to use in unit tests.
Also expand the concept to the whole address space (there's no real need
to restrict it to 32 bits in 64-bit environments) and introduce an
rdev_chain_mem() helper function to make it a bit easier to use. Replace
some direct uses of struct mem_region_device with this new API where it
seems to make sense.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Ie4c763b77f77d227768556a9528681d771a08dca
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52533
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/drivers/smmstore')
-rw-r--r-- | src/drivers/smmstore/store.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/smmstore/store.c b/src/drivers/smmstore/store.c index 9f9ab0199d..a12cd58e10 100644 --- a/src/drivers/smmstore/store.c +++ b/src/drivers/smmstore/store.c @@ -267,14 +267,14 @@ int smmstore_clear_region(void) /* Implementation of Version 2 */ static bool store_initialized; -static struct mem_region_device mdev_com_buf; +static struct region_device mdev_com_buf; static int smmstore_rdev_chain(struct region_device *rdev) { if (!store_initialized) return -1; - return rdev_chain_full(rdev, &mdev_com_buf.rdev); + return rdev_chain_full(rdev, &mdev_com_buf); } /** @@ -289,7 +289,7 @@ int smmstore_init(void *buf, size_t len) if (store_initialized) return -1; - mem_region_device_rw_init(&mdev_com_buf, buf, len); + rdev_chain_mem_rw(&mdev_com_buf, buf, len); store_initialized = true; |