From dfe351a02cd06f5f4480a1054262793a945a4a83 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Thu, 19 Jan 2017 13:06:27 +0100 Subject: [PATCH] Link device_pd statically. Reduces the likelihood of issue reported by #2209. Commit is meant as stop gap until #2209 gets fixed. --- .../src/drivers/platform/spec/x86/device_pd/main.cc | 11 ++++++++--- .../src/drivers/platform/spec/x86/device_pd/target.mk | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/repos/os/src/drivers/platform/spec/x86/device_pd/main.cc b/repos/os/src/drivers/platform/spec/x86/device_pd/main.cc index 9ee7e1111c..31399e9531 100644 --- a/repos/os/src/drivers/platform/spec/x86/device_pd/main.cc +++ b/repos/os/src/drivers/platform/spec/x86/device_pd/main.cc @@ -114,8 +114,13 @@ void Platform::Device_pd_component::attach_dma_mem(Genode::Dataspace_capability } catch (Rm_session::Out_of_metadata) { throw; } catch (Rm_session::Region_conflict) { - /* memory already attached before - done */ - return; + /* + * DMA memory already attached before or collision with normal + * device_pd memory (text, data, etc). + * Currently we can't distinguish it easily - show error + * message as a precaution. + */ + Genode::error("region conflict"); } catch (...) { } /* sanity check */ @@ -166,7 +171,7 @@ void Platform::Device_pd_component::assign_pci(Genode::Io_mem_dataspace_capabili using Genode::print; using Genode::Hex; print(out, Hex(v >> 8, Hex::Prefix::OMIT_PREFIX), ":", - Hex((v >> 3) & 3, Hex::Prefix::OMIT_PREFIX), ".", + Hex((v >> 3) & 0x1f, Hex::Prefix::OMIT_PREFIX), ".", Hex(v & 0x7, Hex::Prefix::OMIT_PREFIX)); } }; diff --git a/repos/os/src/drivers/platform/spec/x86/device_pd/target.mk b/repos/os/src/drivers/platform/spec/x86/device_pd/target.mk index e37f1cde61..b00ac918b8 100644 --- a/repos/os/src/drivers/platform/spec/x86/device_pd/target.mk +++ b/repos/os/src/drivers/platform/spec/x86/device_pd/target.mk @@ -1,6 +1,6 @@ TARGET = device_pd SRC_CC = main.cc -LIBS = base +LIBS = base-nova REQUIRES = nova