Changeset 183
- Timestamp:
- Dec 13, 2016, 10:52:53 PM (9 years ago)
- Location:
- trunk/src/os2ahci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ahci.c
r182 r183 635 635 636 636 #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); 639 639 #endif 640 640 … … 671 671 ai->port_map &= ~(1UL << p); 672 672 #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; 675 675 #endif 676 676 } -
trunk/src/os2ahci/ahci.h
r178 r183 66 66 67 67 /* 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) 69 70 70 71 #define AHCI_IRQ_ON_SG (1UL << 31) -
trunk/src/os2ahci/os2ahci.h
r182 r183 124 124 /* Get AHCI port MMIO base from AD_INFO and port number. */ 125 125 #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) 128 128 129 129 /* Convert an SATA adapter/port/device address into a 16-bit IORB unit handle … … 253 253 volatile u32 ncq_cmds; /* bitmap for NCQ commands issued */ 254 254 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 */ 255 257 256 258 struct { … … 300 302 u32 mmio_size; /* size of MMIO region */ 301 303 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 */305 304 306 305 P_INFO ports[AHCI_MAX_PORTS]; /* SATA ports on this adapter */ -
trunk/src/os2ahci/pci.c
r182 r183 633 633 for (i = 0; i < ad_info->hw_ports; i++) 634 634 { 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); 637 637 } 638 638 #endif
Note:
See TracChangeset
for help on using the changeset viewer.