diff options
author | Damien Zammit <damien@zamaudio.com> | 2022-02-12 21:57:46 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-02-12 23:05:53 +0100 |
commit | d2ce4a404f6dc016e650c46a117c3ce278af7350 (patch) | |
tree | a9a3b41a52a5837aaaa19deb49b86017656911b9 /acpi | |
parent | 4dab9c56f90738bf772e7e771397cf40df9e49d8 (diff) | |
download | hurd-d2ce4a404f6dc016e650c46a117c3ce278af7350.tar.gz hurd-d2ce4a404f6dc016e650c46a117c3ce278af7350.tar.bz2 hurd-d2ce4a404f6dc016e650c46a117c3ce278af7350.zip |
acpi: Remove erroneous MAP_FIXED
Reading the man page for mmap, MAP_FIXED needs to be removed,
because we do not want the mapping to be placed at 0.
Message-Id: <20220212215736.28433-1-damien@zamaudio.com>
Diffstat (limited to 'acpi')
-rw-r--r-- | acpi/acpi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/acpi/acpi.c b/acpi/acpi.c index 8115b2c8..210a229e 100644 --- a/acpi/acpi.c +++ b/acpi/acpi.c @@ -43,7 +43,7 @@ mmap_phys_acpi_header(uintptr_t base_addr, struct acpi_header **ptr_to_header, /* Map the ACPI table at the nearest page (rounded down) */ *virt_addr = 0; - *virt_addr = mmap(NULL, ESCD_SIZE, PROT_READ, MAP_SHARED | MAP_FIXED, + *virt_addr = mmap(NULL, ESCD_SIZE, PROT_READ, MAP_SHARED, fd, (off_t) pa_acpi); if (*virt_addr == MAP_FAILED) @@ -73,7 +73,7 @@ acpi_get_num_tables(size_t *num_tables) return EPERM; virt_addr = mmap(NULL, ESCD_SIZE, PROT_READ, - MAP_SHARED | MAP_FIXED, fd_mem, ESCD); + MAP_SHARED, fd_mem, ESCD); if (virt_addr == MAP_FAILED) return errno; @@ -184,7 +184,7 @@ acpi_get_tables(struct acpi_table **tables) if ((fd_mem = open("/dev/mem", O_RDWR)) < 0) return EPERM; - virt_addr = mmap(NULL, ESCD_SIZE, PROT_READ, MAP_SHARED | MAP_FIXED, + virt_addr = mmap(NULL, ESCD_SIZE, PROT_READ, MAP_SHARED, fd_mem, (off_t) phys_addr); if (virt_addr == MAP_FAILED) |