[coreboot-gerrit] Change in libhwbase[master]: linux pci: Add dummy PCI access for shared contracts

Nico Huber (Code Review) gerrit at coreboot.org
Fri Aug 25 20:57:39 CEST 2017


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/21206


Change subject: linux pci: Add dummy PCI access for shared contracts
......................................................................

linux pci: Add dummy PCI access for shared contracts

Other implementations may update the PCI_State in Resource_Size() and
Map(). To share the contract with those implementations, we have to
simulate such accesses.

Change-Id: If994db22d91eb3707e555871d854c3a25a13678b
Signed-off-by: Nico Huber <nico.h at gmx.de>
---
M common/linux/hw-pci-dev.adb
1 file changed, 17 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/libhwbase refs/changes/06/21206/1

diff --git a/common/linux/hw-pci-dev.adb b/common/linux/hw-pci-dev.adb
index a768002..294d976 100644
--- a/common/linux/hw-pci-dev.adb
+++ b/common/linux/hw-pci-dev.adb
@@ -41,6 +41,19 @@
    procedure Write16 (Offset : Index; Value : Word16) renames MM.Write16;
    procedure Write32 (Offset : Index; Value : Word32) renames MM.Write32;
 
+   package Dummy is
+      -- No-op PCI config update to share contracts
+      -- with implementations that do actual updates.
+      procedure PCI_Update
+      with
+         Global => (In_Out => MM.PCI_State);
+   end Dummy;
+   package body Dummy is
+      procedure PCI_Update is null
+      with
+         SPARK_Mode => Off;
+   end Dummy;
+
    function Hex (Val : Natural) return Character
    with
       Pre => Val < 16
@@ -85,6 +98,8 @@
       Path     : String (1 .. 49) :=
          "/sys/devices/pci0000:xx/0000:xx:xx.x/resourcex_wc";
    begin
+      Dummy.PCI_Update;
+
       Patch_Sysfs_Path (Path);
       Path (46) := Character'Val (Character'Pos ('0') + Resource'Pos (Res));
       if not WC then
@@ -123,6 +138,8 @@
       Path : String (1 .. 46) :=
          "/sys/devices/pci0000:xx/0000:xx:xx.x/resourcex";
    begin
+      Dummy.PCI_Update;
+
       Patch_Sysfs_Path (Path);
       Path (46) := Character'Val (Character'Pos ('0') + Resource'Pos (Res));
 

-- 
To view, visit https://review.coreboot.org/21206
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: libhwbase
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If994db22d91eb3707e555871d854c3a25a13678b
Gerrit-Change-Number: 21206
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170825/ed57ff84/attachment-0001.html>


More information about the coreboot-gerrit mailing list