Ignore:
Timestamp:
Dec 15, 2016, 12:31:51 AM (9 years ago)
Author:
David Azarewicz
Message:

Reworked makefile
Fixed context hook logic.

File:
1 edited

Legend:

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

    r183 r184  
    148148    if (i == HOST_VERSION) version = val;
    149149
    150     NTPRINTF(" %02x: %08lx", i, val);
     150    dprintf(0," %02x: %08lx", i, val);
    151151
    152152    if (i == HOST_CAP) {
    153       NTPRINTF(" -");
    154       if (val & HOST_CAP_64)         NTPRINTF(" 64bit");
    155       if (val & HOST_CAP_NCQ)        NTPRINTF(" ncq");
    156       if (val & HOST_CAP_SNTF)       NTPRINTF(" sntf");
    157       if (val & HOST_CAP_MPS)        NTPRINTF(" mps");
    158       if (val & HOST_CAP_SSS)        NTPRINTF(" sss");
    159       if (val & HOST_CAP_ALPM)       NTPRINTF(" alpm");
    160       if (val & HOST_CAP_LED)        NTPRINTF(" led");
    161       if (val & HOST_CAP_CLO)        NTPRINTF(" clo");
    162       if (val & HOST_CAP_ONLY)       NTPRINTF(" ahci_only");
    163       if (val & HOST_CAP_PMP)        NTPRINTF(" pmp");
    164       if (val & HOST_CAP_FBS)        NTPRINTF(" fbs");
    165       if (val & HOST_CAP_PIO_MULTI)  NTPRINTF(" pio_multi");
    166       if (val & HOST_CAP_SSC)        NTPRINTF(" ssc");
    167       if (val & HOST_CAP_PART)       NTPRINTF(" part");
    168       if (val & HOST_CAP_CCC)        NTPRINTF(" ccc");
    169       if (val & HOST_CAP_EMS)        NTPRINTF(" ems");
    170       if (val & HOST_CAP_SXS)        NTPRINTF(" sxs");
    171       NTPRINTF(" cmd_slots:%d", ((val >> 8) & 0x1f) + 1);
    172       NTPRINTF(" ports:%d",     (val & 0x1f) + 1);
     153      dprintf(0," -");
     154      if (val & HOST_CAP_64)         dprintf(0," 64bit");
     155      if (val & HOST_CAP_NCQ)        dprintf(0," ncq");
     156      if (val & HOST_CAP_SNTF)       dprintf(0," sntf");
     157      if (val & HOST_CAP_MPS)        dprintf(0," mps");
     158      if (val & HOST_CAP_SSS)        dprintf(0," sss");
     159      if (val & HOST_CAP_ALPM)       dprintf(0," alpm");
     160      if (val & HOST_CAP_LED)        dprintf(0," led");
     161      if (val & HOST_CAP_CLO)        dprintf(0," clo");
     162      if (val & HOST_CAP_ONLY)       dprintf(0," ahci_only");
     163      if (val & HOST_CAP_PMP)        dprintf(0," pmp");
     164      if (val & HOST_CAP_FBS)        dprintf(0," fbs");
     165      if (val & HOST_CAP_PIO_MULTI)  dprintf(0," pio_multi");
     166      if (val & HOST_CAP_SSC)        dprintf(0," ssc");
     167      if (val & HOST_CAP_PART)       dprintf(0," part");
     168      if (val & HOST_CAP_CCC)        dprintf(0," ccc");
     169      if (val & HOST_CAP_EMS)        dprintf(0," ems");
     170      if (val & HOST_CAP_SXS)        dprintf(0," sxs");
     171      dprintf(0," cmd_slots:%d", ((val >> 8) & 0x1f) + 1);
     172      dprintf(0," ports:%d",     (val & 0x1f) + 1);
    173173    } else if (i == HOST_CTL) {
    174       NTPRINTF(" -");
    175       if (val & HOST_AHCI_EN)        NTPRINTF(" ahci_enabled");
    176       if (val & HOST_IRQ_EN)         NTPRINTF(" irq_enabled");
    177       if (val & HOST_RESET)          NTPRINTF(" resetting");
     174      dprintf(0," -");
     175      if (val & HOST_AHCI_EN)        dprintf(0," ahci_enabled");
     176      if (val & HOST_IRQ_EN)         dprintf(0," irq_enabled");
     177      if (val & HOST_RESET)          dprintf(0," resetting");
    178178    } else if (i == HOST_CAP2) {
    179       NTPRINTF(" -");
    180       if (val & HOST_CAP2_BOH)       NTPRINTF(" boh");
    181       if (val & HOST_CAP2_NVMHCI)    NTPRINTF(" nvmhci");
    182       if (val & HOST_CAP2_APST)      NTPRINTF(" apst");
    183     }
    184     NTPRINTF("\n");
     179      dprintf(0," -");
     180      if (val & HOST_CAP2_BOH)       dprintf(0," boh");
     181      if (val & HOST_CAP2_NVMHCI)    dprintf(0," nvmhci");
     182      if (val & HOST_CAP2_APST)      dprintf(0," apst");
     183    }
     184    dprintf(0,"\n");
    185185  }
    186186}
     
    228228  if (ai->pci->board >= sizeof(initial_flags) / sizeof(*initial_flags))
    229229  {
    230     DPRINTF(0,"error: invalid board index in PCI info\n");
     230    dprintf(0,"error: invalid board index in PCI info\n");
    231231    return(-1);
    232232  }
     
    446446    while (((tmp = readl(ai->mmio + HOST_CTL)) & HOST_RESET) != 0) {
    447447      if (TimerCheckAndBlock(&Timer)) {
    448         DPRINTF(0,"controller reset failed (0x%x)\n", tmp);
     448        dprintf(0,"controller reset failed (0x%x)\n", tmp);
    449449        return(-1);
    450450      }
     
    558558
    559559  /* couldn't enable AHCI mode */
    560   DPRINTF(0,"failed to enable AHCI mode on adapter %d\n", ad_no(ai));
     560  dprintf(0,"failed to enable AHCI mode on adapter %d\n", ad_no(ai));
    561561  return(1);
    562562}
     
    635635
    636636      #ifdef DAZ_NEW_CODE
    637       ai->ports[p].dma_buf = MemAlloc(AHCI_PORT_PRIV_DMA_SZ);
     637      ai->ports[p].dma_buf = MemAllocAlign(AHCI_PORT_PRIV_DMA_SZ, 1024);
    638638      ai->ports[p].dma_buf_phys = MemPhysAdr(ai->ports[p].dma_buf);
    639639      #endif
     
    714714      if (Dev32Help_SetIRQ(irq_handlers[irq_map_cnt], ai->irq, 0) != 0)
    715715      {
    716         DPRINTF(0,"failed to register exclusive interrupt\n");
     716        dprintf(0,"failed to register exclusive interrupt\n");
    717717        return(-1);
    718718      }
     
    963963  if ((rc = ahci_stop_fis_rx(ai, p)) != 0)
    964964  {
    965     DPRINTF(0,"error: failed to stop FIS receive (%d)\n", rc);
     965    dprintf(0,"error: failed to stop FIS receive (%d)\n", rc);
    966966    return(rc);
    967967  }
     
    970970  if ((rc = ahci_stop_engine(ai, p)) != 0)
    971971  {
    972     DPRINTF(0,"error: failed to stop port HW engine (%d)\n", rc);
     972    dprintf(0,"error: failed to stop port HW engine (%d)\n", rc);
    973973    return(rc);
    974974  }
     
    16321632   * reset, or worse.
    16331633   */
     1634  ai->ports[p].error_count++;
     1635
    16341636  if (irq_stat & PORT_IRQ_UNK_FIS)
    16351637  {
     
    16421644  if (irq_stat & (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR))
    16431645  {
    1644     DPRINTF(0,"warning: host bus [data] error for port #%d\n", p);
     1646    dprintf(0,"warning: host bus [data] error for port #%d\n", p);
    16451647    reset_port = 1;
    16461648  }
    16471649  if (irq_stat & PORT_IRQ_IF_ERR && !(ai->flags & AHCI_HFLAG_IGN_IRQ_IF_ERR))
    16481650  {
    1649     DPRINTF(0,"warning: interface fatal error for port #%d\n", p);
     1651    dprintf(0,"warning: interface fatal error for port #%d\n", p);
    16501652    reset_port = 1;
    16511653  }
     
    16611663  }
    16621664
    1663   DPRINTF(0,"port #%d interrupt error status: 0x%08lx; restarting port\n", p, irq_stat);
     1665  dprintf(0,"port #%d interrupt error status: 0x%08lx; restarting port\n", p, irq_stat);
    16641666
    16651667  /* Handle device-specific errors. Those errors typically involve restarting
     
    16771679void ahci_get_geometry(IORBH FAR16DATA *vIorb, IORBH *pIorb)
    16781680{
    1679   #ifdef DEBUG
    16801681  DPRINTF(7,"ahci_get_geometry(%d.%d.%d)\n", iorb_unit_adapter(pIorb),
    16811682          iorb_unit_port(pIorb), iorb_unit_device(pIorb));
    1682   #endif
    16831683
    16841684  ahci_exec_iorb(vIorb, pIorb, 0, cmd_func(pIorb, get_geometry));
     
    16901690void ahci_unit_ready(IORBH FAR16DATA *vIorb, IORBH *pIorb)
    16911691{
    1692   #ifdef DEBUG
    16931692  DPRINTF(7,"ahci_unit_ready(%d.%d.%d)\n", iorb_unit_adapter(pIorb),
    16941693          iorb_unit_port(pIorb), iorb_unit_device(pIorb));
    1695   #endif
    16961694
    16971695  ahci_exec_iorb(vIorb, pIorb, 0, cmd_func(pIorb, unit_ready));
     
    17031701void ahci_read(IORBH FAR16DATA *vIorb, IORBH *pIorb)
    17041702{
    1705   #ifdef DEBUG
    17061703  DPRINTF(7,"ahci_read(%d.%d.%d, %d, %d)\n", iorb_unit_adapter(vIorb),
    17071704          iorb_unit_port(pIorb), iorb_unit_device(pIorb),
    17081705          ((IORB_EXECUTEIO *) pIorb)->RBA,
    17091706          ((IORB_EXECUTEIO *) pIorb)->BlockCount);
    1710   #endif
    17111707
    17121708  ahci_exec_iorb(vIorb, pIorb, 1, cmd_func(pIorb, read));
     
    17181714void ahci_verify(IORBH FAR16DATA *vIorb, IORBH *pIorb)
    17191715{
    1720   #ifdef DEBUG
    17211716  DPRINTF(7,"ahci_verify(%d.%d.%d, %d, %d)\n", iorb_unit_adapter(pIorb),
    17221717          iorb_unit_port(pIorb), iorb_unit_device(pIorb),
    17231718          ((IORB_EXECUTEIO *)pIorb)->RBA,
    17241719          ((IORB_EXECUTEIO *)pIorb)->BlockCount);
    1725   #endif
    17261720
    17271721  ahci_exec_iorb(vIorb, pIorb, 0, cmd_func(pIorb, verify));
     
    17331727void ahci_write(IORBH FAR16DATA *vIorb, IORBH *pIorb)
    17341728{
    1735   #ifdef DEBUG
    17361729  DPRINTF(7,"ahci_write(%d.%d.%d, %d, %d)\n", iorb_unit_adapter(pIorb),
    17371730          iorb_unit_port(pIorb), iorb_unit_device(pIorb),
    17381731          ((IORB_EXECUTEIO *)pIorb)->RBA,
    17391732          ((IORB_EXECUTEIO *)pIorb)->BlockCount);
    1740   #endif
    17411733
    17421734  ahci_exec_iorb(vIorb, pIorb, 1, cmd_func(pIorb, write));
Note: See TracChangeset for help on using the changeset viewer.