posix file: Let the OS decide addresses to map to
Reverse the direction of the `Addr` parameter of Map(). We let mmap()
decide which address to use and return that. Given that we can set the
address for `MMIO_Range` instances during runtime, we shouldn't ever
have to force static addresses.
Change-Id: I35bfd65e7b471daae4f43a9233ce613c7f45891e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20552
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/common/hw-file.ads b/common/hw-file.ads
index 9f5e452..57cf429 100644
--- a/common/hw-file.ads
+++ b/common/hw-file.ads
@@ -14,16 +14,19 @@
package HW.File is
+ --
-- Map a file's content into our address space
--
-- If `Map_Copy` is `False`, `Len` bytes from the start of the file
-- given by `Path` shall be mapped into the application's address
- -- space at `Addr` using mmap(). If `Map_Copy` is `True`, anonymous
- -- memory should be mapped instead and be filled with a copy of the
- -- file's content using read().
+ -- space using mmap().
+ --
+ -- If `Map_Copy` is `True`, anonymous memory should be mapped instead
+ -- and be filled with a copy of the file's content using read().
+ --
procedure Map
- (Path : in String;
- Addr : in Word64;
+ (Addr : out Word64;
+ Path : in String;
Len : in Natural;
Readable : in Boolean := False;
Writable : in Boolean := False;