genode/base-foc/src/core/rm_session_support.cc
Norman Feske 288fd4e56e Add support for allocating DMA memory
This patch extends the RAM session interface with the ability to
allocate DMA buffers. The client specifies the type of RAM dataspace to
allocate via the new 'cached' argument of the 'Ram_session::alloc()'
function. By default, 'cached' is true, which correponds to the common
case and the original behavior. When setting 'cached' to 'false', core
takes the precautions needed to register the memory as uncached in the
page table of each process that has the dataspace attached.

Currently, the support for allocating DMA buffers is implemented for
Fiasco.OC only. On x86 platforms, it is generally not needed. But on
platforms with more relaxed cache coherence (such as ARM), user-level
device drivers should always use uncacheable memory for DMA transactions.
2012-06-20 09:17:48 +02:00

25 lines
594 B
C++

/*
* \brief Fiasco-specific part of RM-session implementation
* \author Stefan Kalkowski
* \date 2011-01-18
*/
/*
* Copyright (C) 2011-2012 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.
*/
/* core includes */
#include <rm_session_component.h>
#include <map_local.h>
using namespace Genode;
void Rm_client::unmap(addr_t core_local_base, addr_t virt_base, size_t size)
{
// TODO unmap it only from target space
unmap_local(core_local_base, size >> get_page_size_log2());
}