mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
This patch extends the 'Platform_session::alloc_dma_buffer' interface with a 'Cache' argument that corresponds to the argument accepted by 'Ram_allocator::alloc', which is used by the platform driver under the hood. Since the x86 platform driver used to be hardwired to allocate DMA buffers as UNCACHED, I adjusted all drivers by specifying the UNCACHED argument. Right now, this is needed as a hint for core to steer the allocation of I/O page tables. Once we eliminate the need for such hints (by introducing an explicit 'Region_map::attach_dma' operation), we can revisit the drivers individually because cached DMA buffers should generally be fine on the x86 architecture. Issue #2243
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
/*
|
|
* \brief Client-side Platform-session interface
|
|
* \author Stefan Kalkowski
|
|
* \date 2020-04-28
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2020 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
*/
|
|
|
|
#ifndef _INCLUDE__SPEC__ARM__PLATFORM_SESSION__CLIENT_H_
|
|
#define _INCLUDE__SPEC__ARM__PLATFORM_SESSION__CLIENT_H_
|
|
|
|
#include <base/rpc_client.h>
|
|
#include <platform_device/client.h>
|
|
#include <platform_session/capability.h>
|
|
|
|
namespace Platform {
|
|
using namespace Genode;
|
|
|
|
struct Client;
|
|
}
|
|
|
|
|
|
struct Platform::Client : public Genode::Rpc_client<Session>
|
|
{
|
|
Client(Session_capability session)
|
|
: Rpc_client<Session>(session) { }
|
|
|
|
Rom_session_capability devices_rom() override {
|
|
return call<Rpc_devices_rom>(); }
|
|
|
|
Device_capability acquire_device(String const &device) override {
|
|
return call<Rpc_acquire_device>(device); }
|
|
|
|
void release_device(Device_capability device) override {
|
|
call<Rpc_release_device>(device); }
|
|
|
|
Ram_dataspace_capability alloc_dma_buffer(size_t size, Cache cache) override {
|
|
return call<Rpc_alloc_dma_buffer>(size, cache); }
|
|
|
|
void free_dma_buffer(Ram_dataspace_capability cap) override {
|
|
call<Rpc_free_dma_buffer>(cap); }
|
|
|
|
addr_t dma_addr(Ram_dataspace_capability cap) override {
|
|
return call<Rpc_dma_addr>(cap); }
|
|
};
|
|
|
|
#endif /* _INCLUDE__SPEC__ARM__PLATFORM_SESSION__CLIENT_H_ */
|