summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/elog/elog.c7
-rw-r--r--src/drivers/intel/gma/opregion.c9
-rw-r--r--src/drivers/smmstore/store.c6
-rw-r--r--src/drivers/vpd/vpd.c6
4 files changed, 11 insertions, 17 deletions
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index 82df989e25..4769559ca0 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -44,7 +44,7 @@ struct elog_state {
struct region_device nv_dev;
/* Device that mirrors the eventlog in memory. */
- struct mem_region_device mirror_dev;
+ struct region_device mirror_dev;
enum elog_init_state elog_initialized;
};
@@ -56,7 +56,7 @@ static uint8_t elog_mirror_buf[ELOG_SIZE];
static inline struct region_device *mirror_dev_get(void)
{
- return &elog_state.mirror_dev.rdev;
+ return &elog_state.mirror_dev;
}
static size_t elog_events_start(void)
@@ -798,8 +798,7 @@ int elog_init(void)
printk(BIOS_ERR, "ELOG: Unable to allocate backing store\n");
return -1;
}
- mem_region_device_rw_init(&elog_state.mirror_dev, mirror_buffer,
- elog_size);
+ rdev_chain_mem_rw(&elog_state.mirror_dev, mirror_buffer, elog_size);
/*
* Mark as initialized to allow elog_init() to be called and deemed
diff --git a/src/drivers/intel/gma/opregion.c b/src/drivers/intel/gma/opregion.c
index e1ed6c8285..cf2c5d9846 100644
--- a/src/drivers/intel/gma/opregion.c
+++ b/src/drivers/intel/gma/opregion.c
@@ -128,16 +128,14 @@ static enum cb_err locate_vbt_vbios(const u8 *vbios, struct region_device *rdev)
size_t offset;
// FIXME: caller should supply a region_device instead of vbios pointer
- if (rdev_chain(&rd, &addrspace_32bit.rdev, (uintptr_t)vbios,
- sizeof(*oprom)))
+ if (rdev_chain_mem(&rd, vbios, sizeof(*oprom)))
return CB_ERR;
if (rdev_readat(&rd, &opromsize, offsetof(optionrom_header_t, size),
sizeof(opromsize)) != sizeof(opromsize) || !opromsize)
return CB_ERR;
- if (rdev_chain(&rd, &addrspace_32bit.rdev, (uintptr_t)vbios,
- opromsize * 512))
+ if (rdev_chain_mem(&rd, vbios, opromsize * 512))
return CB_ERR;
oprom = rdev_mmap(&rd, 0, sizeof(*oprom));
@@ -200,8 +198,7 @@ static enum cb_err locate_vbt_cbfs(struct region_device *rdev)
if (vbt == NULL)
return CB_ERR;
- if (rdev_chain(rdev, &addrspace_32bit.rdev, (uintptr_t)vbt,
- vbt_data_size))
+ if (rdev_chain_mem(rdev, vbt, vbt_data_size))
return CB_ERR;
printk(BIOS_INFO, "GMA: Found VBT in CBFS\n");
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;
diff --git a/src/drivers/vpd/vpd.c b/src/drivers/vpd/vpd.c
index d3ff37019d..a099b3be37 100644
--- a/src/drivers/vpd/vpd.c
+++ b/src/drivers/vpd/vpd.c
@@ -101,10 +101,8 @@ static int init_vpd_rdevs_from_cbmem(void)
if (!cbmem)
return -1;
- rdev_chain(&ro_vpd, &addrspace_32bit.rdev,
- (uintptr_t)cbmem->blob, cbmem->ro_size);
- rdev_chain(&rw_vpd, &addrspace_32bit.rdev,
- (uintptr_t)cbmem->blob + cbmem->ro_size, cbmem->rw_size);
+ rdev_chain_mem(&ro_vpd, cbmem->blob, cbmem->ro_size);
+ rdev_chain_mem(&rw_vpd, cbmem->blob + cbmem->ro_size, cbmem->rw_size);
return 0;
}