Skip to content

Commit

Permalink
nova: fix write-combing support
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ab authored and chelmuth committed Nov 29, 2015
1 parent dd96cba commit 7857e83
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 40 deletions.
2 changes: 1 addition & 1 deletion repos/base-nova/ports/nova.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e08cc27e2cfe25ed72395cd5c245ff7bf460b900
efc658b16e2c7e3ae78fe72e03b34510d1aee0b1
2 changes: 1 addition & 1 deletion repos/base-nova/ports/nova.port
Original file line number Diff line number Diff line change
Expand Up @@ -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)
42 changes: 4 additions & 38 deletions repos/base-nova/src/core/io_mem_session_support.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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; }

0 comments on commit 7857e83

Please sign in to comment.