Diff for /qemu/hw/pci_host.h between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2018/04/24 16:48:42 version 1.1.1.3, 2018/04/24 16:53:17
Line 25 Line 25
 /* Worker routines for a PCI host controller that uses an {address,data}  /* Worker routines for a PCI host controller that uses an {address,data}
    register pair to access PCI configuration space.  */     register pair to access PCI configuration space.  */
   
   /* debug PCI */
   //#define DEBUG_PCI
   
   #ifdef DEBUG_PCI
   #define PCI_DPRINTF(fmt, args...) \
   do { printf("pci_host_data: " fmt , ##args); } while (0)
   #else
   #define PCI_DPRINTF(fmt, args...)
   #endif
   
 typedef struct {  typedef struct {
     uint32_t config_reg;      uint32_t config_reg;
     PCIBus *bus;      PCIBus *bus;
Line 33  typedef struct { Line 43  typedef struct {
 static void pci_host_data_writeb(void* opaque, pci_addr_t addr, uint32_t val)  static void pci_host_data_writeb(void* opaque, pci_addr_t addr, uint32_t val)
 {  {
     PCIHostState *s = opaque;      PCIHostState *s = opaque;
   
       PCI_DPRINTF("writeb addr " TARGET_FMT_plx " val %x\n",
                   (target_phys_addr_t)addr, val);
     if (s->config_reg & (1u << 31))      if (s->config_reg & (1u << 31))
         pci_data_write(s->bus, s->config_reg | (addr & 3), val, 1);          pci_data_write(s->bus, s->config_reg | (addr & 3), val, 1);
 }  }
Line 43  static void pci_host_data_writew(void* o Line 56  static void pci_host_data_writew(void* o
 #ifdef TARGET_WORDS_BIGENDIAN  #ifdef TARGET_WORDS_BIGENDIAN
     val = bswap16(val);      val = bswap16(val);
 #endif  #endif
       PCI_DPRINTF("writew addr " TARGET_FMT_plx " val %x\n",
                   (target_phys_addr_t)addr, val);
     if (s->config_reg & (1u << 31))      if (s->config_reg & (1u << 31))
         pci_data_write(s->bus, s->config_reg | (addr & 3), val, 2);          pci_data_write(s->bus, s->config_reg | (addr & 3), val, 2);
 }  }
Line 53  static void pci_host_data_writel(void* o Line 68  static void pci_host_data_writel(void* o
 #ifdef TARGET_WORDS_BIGENDIAN  #ifdef TARGET_WORDS_BIGENDIAN
     val = bswap32(val);      val = bswap32(val);
 #endif  #endif
       PCI_DPRINTF("writel addr " TARGET_FMT_plx " val %x\n",
                   (target_phys_addr_t)addr, val);
     if (s->config_reg & (1u << 31))      if (s->config_reg & (1u << 31))
         pci_data_write(s->bus, s->config_reg, val, 4);          pci_data_write(s->bus, s->config_reg, val, 4);
 }  }
Line 60  static void pci_host_data_writel(void* o Line 77  static void pci_host_data_writel(void* o
 static uint32_t pci_host_data_readb(void* opaque, pci_addr_t addr)  static uint32_t pci_host_data_readb(void* opaque, pci_addr_t addr)
 {  {
     PCIHostState *s = opaque;      PCIHostState *s = opaque;
       uint32_t val;
   
     if (!(s->config_reg & (1 << 31)))      if (!(s->config_reg & (1 << 31)))
         return 0xff;          return 0xff;
     return pci_data_read(s->bus, s->config_reg | (addr & 3), 1);      val = pci_data_read(s->bus, s->config_reg | (addr & 3), 1);
       PCI_DPRINTF("readb addr " TARGET_FMT_plx " val %x\n",
                   (target_phys_addr_t)addr, val);
       return val;
 }  }
   
 static uint32_t pci_host_data_readw(void* opaque, pci_addr_t addr)  static uint32_t pci_host_data_readw(void* opaque, pci_addr_t addr)
Line 72  static uint32_t pci_host_data_readw(void Line 94  static uint32_t pci_host_data_readw(void
     if (!(s->config_reg & (1 << 31)))      if (!(s->config_reg & (1 << 31)))
         return 0xffff;          return 0xffff;
     val = pci_data_read(s->bus, s->config_reg | (addr & 3), 2);      val = pci_data_read(s->bus, s->config_reg | (addr & 3), 2);
       PCI_DPRINTF("readw addr " TARGET_FMT_plx " val %x\n",
                   (target_phys_addr_t)addr, val);
 #ifdef TARGET_WORDS_BIGENDIAN  #ifdef TARGET_WORDS_BIGENDIAN
     val = bswap16(val);      val = bswap16(val);
 #endif  #endif
Line 85  static uint32_t pci_host_data_readl(void Line 109  static uint32_t pci_host_data_readl(void
     if (!(s->config_reg & (1 << 31)))      if (!(s->config_reg & (1 << 31)))
         return 0xffffffff;          return 0xffffffff;
     val = pci_data_read(s->bus, s->config_reg | (addr & 3), 4);      val = pci_data_read(s->bus, s->config_reg | (addr & 3), 4);
       PCI_DPRINTF("readl addr " TARGET_FMT_plx " val %x\n",
                   (target_phys_addr_t)addr, val);
 #ifdef TARGET_WORDS_BIGENDIAN  #ifdef TARGET_WORDS_BIGENDIAN
     val = bswap32(val);      val = bswap32(val);
 #endif  #endif
     return val;      return val;
 }  }
   

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


unix.superglobalmegacorp.com