summaryrefslogtreecommitdiff
path: root/os/pc/memory.c
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2007-04-07 12:52:27 +0000
committerCharles.Forsyth <devnull@localhost>2007-04-07 12:52:27 +0000
commite1bd49a1e1823eab71c293efd1bd0c9b83c350c9 (patch)
treea9424cde16004cb9e591045225bc61beed339dd5 /os/pc/memory.c
parent15345f9c75c069d3e2e362af5d6f931eef7772ef (diff)
20070407-1350 more updates from plan 9 pc kernel, and a few unreachable fixes(!)
Diffstat (limited to 'os/pc/memory.c')
-rw-r--r--os/pc/memory.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/os/pc/memory.c b/os/pc/memory.c
index a58119c6..85658248 100644
--- a/os/pc/memory.c
+++ b/os/pc/memory.c
@@ -568,3 +568,21 @@ upafree(ulong pa, int size)
{
mapfree(&xrmapupa, pa, size);
}
+
+void
+upareserve(ulong pa, int size)
+{
+ ulong a;
+
+ a = mapalloc(&rmapupa, pa, size, 0);
+ if(a != pa){
+ /*
+ * This can happen when we're using the E820
+ * map, which might have already reserved some
+ * of the regions claimed by the pci devices.
+ */
+ // print("upareserve: cannot reserve pa=%#.8lux size=%d\n", pa, size);
+ if(a != 0)
+ mapfree(&rmapupa, a, size);
+ }
+}