Changeset 183


Ignore:
Timestamp:
Dec 13, 2016, 10:52:53 PM (9 years ago)
Author:
David Azarewicz
Message:

Moved dma buffer pointers.

Location:
trunk/src/os2ahci
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/ahci.c

    r182 r183  
    635635
    636636      #ifdef DAZ_NEW_CODE
    637       ai->dma_buf[p] = MemAllocAlign(AHCI_PORT_PRIV_DMA_SZ, 1024);
    638       ai->dma_buf_phys[p] = MemPhysAdr(ai->dma_buf[p]);
     637      ai->ports[p].dma_buf = MemAlloc(AHCI_PORT_PRIV_DMA_SZ);
     638      ai->ports[p].dma_buf_phys = MemPhysAdr(ai->ports[p].dma_buf);
    639639      #endif
    640640
     
    671671      ai->port_map &= ~(1UL << p);
    672672      #ifdef DAZ_NEW_CODE
    673       if (ai->dma_buf[p]) MemFree(ai->dma_buf[p]);
    674       ai->dma_buf[p] = NULL;
     673      if (ai->ports[p].dma_buf) MemFree(ai->ports[p].dma_buf);
     674      ai->ports[p].dma_buf = NULL;
    675675      #endif
    676676    }
  • trunk/src/os2ahci/ahci.h

    r178 r183  
    6666
    6767/* port-specific DMA scratch buffer aligned to 1024 bytes */
    68 #define AHCI_PORT_PRIV_DMA_SZ   (((sizeof(AHCI_PORT_DMA) + 1023U) / 1024U) * 1024U)
     68//DAZ #define AHCI_PORT_PRIV_DMA_SZ   (((sizeof(AHCI_PORT_DMA) + 1023U) / 1024U) * 1024U)
     69#define AHCI_PORT_PRIV_DMA_SZ   sizeof(AHCI_PORT_DMA)
    6970
    7071#define AHCI_IRQ_ON_SG          (1UL << 31)
  • trunk/src/os2ahci/os2ahci.h

    r182 r183  
    124124/* Get AHCI port MMIO base from AD_INFO and port number. */
    125125#define port_base(ai, p) ((u8 *) (ai)->mmio + 0x100 + (p) * 0x80)
    126 #define port_dma_base(ai, p) ((AHCI_PORT_DMA *) ((ai)->dma_buf[(p)]))
    127 #define port_dma_base_phys(ai, p) ((ai)->dma_buf_phys[(p)])
     126#define port_dma_base(ai, p) ((AHCI_PORT_DMA *) ((ai)->ports[(p)].dma_buf))
     127#define port_dma_base_phys(ai, p) ((ai)->ports[p].dma_buf_phys)
    128128
    129129/* Convert an SATA adapter/port/device address into a 16-bit IORB unit handle
     
    253253  volatile u32  ncq_cmds;              /* bitmap for NCQ commands issued */
    254254  volatile u32  reg_cmds;              /* bitmap for regular commands issued */
     255  u32           dma_buf_phys;          /* physical address of DMA scratch buffer */
     256  u8           *dma_buf;               /* DMA scatch buffers */
    255257
    256258  struct {
     
    300302  u32           mmio_size;             /* size of MMIO region */
    301303  u8           *mmio;                  /* pointer to this adapter's MMIO region */
    302 
    303   u32           dma_buf_phys[AHCI_MAX_PORTS];          /* physical address of DMA scratch buffer */
    304   u8           *dma_buf[AHCI_MAX_PORTS]; /* DMA scatch buffers */
    305304
    306305  P_INFO        ports[AHCI_MAX_PORTS]; /* SATA ports on this adapter */
  • trunk/src/os2ahci/pci.c

    r182 r183  
    633633  for (i = 0; i < ad_info->hw_ports; i++)
    634634  {
    635     ad_info->dma_buf[i] = MemAlloc(AHCI_PORT_PRIV_DMA_SZ);
    636     ad_info->dma_buf_phys[i] = MemPhysAdr(ad_info->dma_buf[i]);
     635    ad_info->ports[i].dma_buf = MemAlloc(AHCI_PORT_PRIV_DMA_SZ);
     636    ad_info->ports[i].dma_buf_phys = MemPhysAdr(ad_info->ports[i].dma_buf);
    637637  }
    638638  #endif
Note: See TracChangeset for help on using the changeset viewer.