Commit 790ef988 authored by Samuel Thibault's avatar Samuel Thibault
Browse files

hurd: Add missing round up size in map_dev_mem


Signed-off-by: Samuel Thibault's avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
parent 3e5ae795
/*
* Copyright (c) 2018 Damien Zammit
* Copyright (c) 2017 Joan Lledó
* Copyright (c) 2009, 2012 Samuel Thibault
* Copyright (c) 2009, 2012, 2020 Samuel Thibault
* Heavily inspired from the freebsd, netbsd, and openbsd backends
* (C) Copyright Eric Anholt 2006
* (C) Copyright IBM Corporation 2006
......@@ -228,6 +228,7 @@ map_dev_mem(void **dest, size_t mem_offset, size_t mem_size, int write)
mach_port_t pager;
dev_mode_t mode = D_READ;
vm_prot_t prot = VM_PROT_READ;
int pagesize;
if (get_privileged_ports (NULL, &master_device)) {
*dest = 0;
......@@ -243,6 +244,10 @@ map_dev_mem(void **dest, size_t mem_offset, size_t mem_size, int write)
if (err)
return err;
pagesize = getpagesize();
if (mem_size % pagesize)
mem_size += pagesize - (mem_size % pagesize);
err = device_map (devmem, prot, 0x0, mem_size, &pager, 0);
if (err)
return err;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment