1 // 2 // Copyright (c) 2010-2018 Antmicro 3 // Copyright (c) 2011-2015 Realtime Embedded 4 // 5 // This file is licensed under the MIT License. 6 // Full license text is available in 'licenses/MIT.txt'. 7 // 8 using System; 9 10 namespace Antmicro.Renode.Peripherals.PCI 11 { 12 public struct PCIInfo { 13 14 public uint[] BAR; 15 public uint[] BAR_len; 16 public ushort device_id; 17 public ushort vendor_id; 18 public ushort sub_device_id; 19 public ushort sub_vendor_id; 20 public ushort device_class; 21 PCIInfoAntmicro.Renode.Peripherals.PCI.PCIInfo22 public PCIInfo(ushort did, ushort vid, ushort sdid, ushort svid, ushort dclass) { 23 device_id = did; 24 vendor_id = vid; 25 sub_device_id = sdid; 26 sub_vendor_id = svid; 27 device_class = dclass; 28 BAR = new uint[8]; 29 for (int i = 0; i < 8; i++) BAR[i] = 0; 30 BAR_len = new uint[8]; 31 for (int i = 0; i < 8; i++) BAR_len[i] = 0; 32 } 33 } 34 35 public interface IPCIPeripheral : IPeripheral 36 { GetPCIInfo()37 PCIInfo GetPCIInfo(); WriteDoubleWordPCI(uint bar, long offset, uint value)38 void WriteDoubleWordPCI (uint bar, long offset, uint value); ReadDoubleWordPCI(uint bar, long offset)39 uint ReadDoubleWordPCI (uint bar, long offset); 40 } 41 } 42 43