mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 10:46:25 +00:00
Give diagnostic aid to callers of 'dma_addr'
If the platform driver lacks the 'managing_system="yes"' attribute, requests for DMA addresses return 0. This patch is meant to help diagnosing such configuration issues. Issue #2243
This commit is contained in:
parent
cbe3e49c7f
commit
7e26d3ef3f
@ -15,6 +15,7 @@
|
||||
#define _INCLUDE__PLATFORM_SESSION__CLIENT_H_
|
||||
|
||||
#include <base/rpc_client.h>
|
||||
#include <base/log.h>
|
||||
#include <platform_session/capability.h>
|
||||
|
||||
namespace Platform { struct Client; }
|
||||
@ -43,8 +44,16 @@ struct Platform::Client : Genode::Rpc_client<Session>
|
||||
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); }
|
||||
addr_t dma_addr(Ram_dataspace_capability cap) override
|
||||
{
|
||||
addr_t const result = call<Rpc_dma_addr>(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_ */
|
||||
|
Loading…
Reference in New Issue
Block a user