vesa: handle platform session memory requests

Issue #1039
This commit is contained in:
Christian Helmuth 2016-11-25 15:14:09 +01:00
parent 7dcfc8bd49
commit 1216839bec
2 changed files with 19 additions and 5 deletions

View File

@ -19,6 +19,7 @@
#include <base/sleep.h>
#include <base/log.h>
#include <util/retry.h>
#include "hw_emul.h"
@ -69,16 +70,29 @@ class Pci_card
Platform::Device_client _device;
unsigned short _devfn;
Platform::Device_capability _first_device()
{
return Genode::retry<Platform::Session::Out_of_metadata>(
[&] () { return _pci_drv.first_device(); },
[&] () { _pci_drv.upgrade_ram(4096); });
}
Platform::Device_capability _next_device(Platform::Device_capability prev)
{
return Genode::retry<Platform::Session::Out_of_metadata>(
[&] () { return _pci_drv.next_device(prev); },
[&] () { _pci_drv.upgrade_ram(4096); });
}
Platform::Device_capability _find_vga_card()
{
/*
* Iterate through all accessible devices.
*/
Platform::Device_capability prev_device_cap, device_cap;
_pci_drv.upgrade_ram(4096);
for (device_cap = _pci_drv.first_device();
for (device_cap = _first_device();
device_cap.valid();
device_cap = _pci_drv.next_device(prev_device_cap)) {
device_cap = _next_device(prev_device_cap)) {
Platform::Device_client device(device_cap);
@ -105,7 +119,7 @@ class Pci_card
public:
Pci_card() : _pci_drv(), _device(_find_vga_card())
Pci_card() : _device(_find_vga_card())
{
unsigned char bus = 0, dev = 0, fn = 0;

View File

@ -233,7 +233,7 @@ int main(int argc, char **argv)
static Cap_connection cap;
/* initialize server entry point */
enum { STACK_SIZE = 8*1024 };
enum { STACK_SIZE = 4*1024*sizeof(long) };
static Rpc_entrypoint ep(&cap, STACK_SIZE, "vesa_ep");
/* init driver back end */