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@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));