summaryrefslogtreecommitdiff
path: root/src/device/device_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/device/device_util.c')
-rw-r--r--src/device/device_util.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/device/device_util.c b/src/device/device_util.c
index 383e17b0f6..7e31b43495 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -841,6 +841,21 @@ const struct resource *fixed_resource_range_idx(struct device *dev, unsigned lon
return resource;
}
+const struct resource *lower_ram_end(struct device *dev, unsigned long index, uint64_t end)
+{
+ return ram_from_to(dev, index, 0, end);
+}
+
+const struct resource *upper_ram_end(struct device *dev, unsigned long index, uint64_t end)
+{
+ if (end <= 4ull * GiB)
+ return NULL;
+
+ printk(BIOS_INFO, "Available memory above 4GB: %lluM\n", (end - 4ull * GiB) / MiB);
+
+ return ram_from_to(dev, index, 4ull * GiB, end);
+}
+
void mmconf_resource(struct device *dev, unsigned long index)
{
struct resource *resource = new_resource(dev, index);