/* * \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__PLATFORM_SESSION__CLIENT_H_ #define _INCLUDE__PLATFORM_SESSION__CLIENT_H_ #include #include #include namespace Platform { struct Client; } struct Platform::Client : Genode::Rpc_client { Client(Session_capability session) : Rpc_client(session) { } Rom_session_capability devices_rom() override { return call(); } Capability acquire_device(Device_name const &name) override { return call(name); } Capability acquire_single_device() override { return call(); } void release_device(Capability device) override { call(device); } Ram_dataspace_capability alloc_dma_buffer(size_t size, Cache cache) override { return call(size, cache); } void free_dma_buffer(Ram_dataspace_capability cap) override { call(cap); } addr_t dma_addr(Ram_dataspace_capability cap) override { addr_t const result = call(cap); /* the platform driver may lack the 'managing_system' role */ if (!result) warning("unable to obtain DMA address from platform driver"); return result; } }; #endif /* _INCLUDE__PLATFORM_SESSION__CLIENT_H_ */