mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
parent
dd96cba415
commit
7857e830a3
@ -1 +1 @@
|
||||
e08cc27e2cfe25ed72395cd5c245ff7bf460b900
|
||||
efc658b16e2c7e3ae78fe72e03b34510d1aee0b1
|
||||
|
@ -4,7 +4,7 @@ DOWNLOADS := nova.git
|
||||
|
||||
# r9 branch - use r9_debug for more verbose kernel messages
|
||||
URL(nova) := https://github.com/alex-ab/NOVA.git
|
||||
REV(nova) := 7c0c451d3de1a4645e8fadde1fdbebb3203c1f8d
|
||||
REV(nova) := ae14ffde62a1de3bf4f4f6f173e3be63872e7f90
|
||||
DIR(nova) := src/kernel/nova
|
||||
|
||||
PATCHES := $(wildcard $(REP_DIR)/patches/*.patch)
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
* Copyright (C) 2009-2015 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
@ -20,41 +20,7 @@
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
void Io_mem_session_component::_unmap_local(addr_t base, size_t size) { }
|
||||
|
||||
void Io_mem_session_component::_unmap_local(addr_t base, size_t size)
|
||||
{
|
||||
size_t page_rounded_size = align_addr(size, get_page_size_log2());
|
||||
|
||||
Nova::Rights rwx(true, true, true);
|
||||
int count = page_rounded_size >> 12;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
unmap_local(Nova::Mem_crd((base >> 12) + i, 0, rwx));
|
||||
}
|
||||
|
||||
|
||||
addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
|
||||
{
|
||||
size_t page_rounded_size = align_addr(size, get_page_size_log2());
|
||||
|
||||
/* align large I/O dataspaces on a super-page boundary within core */
|
||||
size_t alignment = (size >= get_super_page_size()) ? get_super_page_size_log2()
|
||||
: get_page_size_log2();
|
||||
|
||||
/* allocate range in core's virtual address space */
|
||||
void *virt_addr;
|
||||
if (platform()->region_alloc()->alloc_aligned(page_rounded_size,
|
||||
&virt_addr, alignment).is_error()) {
|
||||
PERR("Could not allocate virtual address range in core of size %zd\n",
|
||||
page_rounded_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* map the dataspace's physical pages to local addresses */
|
||||
const Nova::Rights rights(true, true, false);
|
||||
int res = map_local((Nova::Utcb *)Thread_base::myself()->utcb(),
|
||||
base, (addr_t)virt_addr,
|
||||
page_rounded_size >> get_page_size_log2(), rights, true);
|
||||
|
||||
return res ? 0 : (addr_t)virt_addr;
|
||||
}
|
||||
addr_t Io_mem_session_component::_map_local(addr_t base, size_t size) {
|
||||
return 0; }
|
||||
|
Loading…
Reference in New Issue
Block a user