Changeset 66


Ignore:
Timestamp:
Dec 23, 2010, 11:06:03 PM (15 years ago)
Author:
chris
Message:
  • Added code to dprintf TF_DATA register in restart_ctxhook
  • Cleaned up aws_free() calls; in a nutshell, aws_free() will always be called when IORBs complete (successfully or with an error) and this is now verified; redundant invocations of aws_free() have been removed.
  • atapi_req_sense_pp() now sets the iorb_workspace(iorb)->complete = 1
Location:
trunk/src/os2ahci
Files:
5 edited

Legend:

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

    r57 r66  
    235235  if (ai->pci->vendor == PCI_VENDOR_ID_JMICRON &&
    236236      ai->pci->device == 0x2361 && ai->port_map != 1) {
    237     dprintf("JMB361 has only one port, port_map 0x%x -> 0x%x\n", ai->port_map, 1);
     237    dprintf("JMB361 has only one port, port_map 0x%lx -> 0x%lx\n", ai->port_map, 1);
    238238    ai->port_map = 1;
    239239  }
     
    10291029
    10301030  if (add_workspace(iorb)->complete | (iorb->Status | IORB_ERROR)) {
    1031     aws_free(add_workspace(iorb));
    10321031    iorb_done(iorb);
    10331032  }
     
    12301229
    12311230      if (aws->complete) {
    1232         /* this IORB is complete */
    1233         aws_free(aws);
    1234 
    1235         /* move IORB to our temporary done queue */
     1231        /* this IORB is complete; move IORB to our temporary done queue */
    12361232        iorb_queue_del(&ai->ports[p].iorb_queue, iorb);
    12371233        iorb_queue_add(&done_queue, iorb);
     
    12501246    next = iorb->pNxtIORB;
    12511247    iorb->Status = IORB_DONE;
     1248    aws_free(iorb_workspace(iorb));
    12521249    if (iorb->RequestControl & IORB_ASYNC_POST) {
    12531250      iorb->NotifyAddress(iorb);
  • trunk/src/os2ahci/ata.c

    r60 r66  
    422422
    423423  if (rc != 0) {
    424     free(aws->buf);
    425424    iorb_seterr(iorb, IOERR_CMD_ADD_SOFTWARE_FAILURE);
    426425  }
     
    636635    iorb_requeue(iorb);
    637636  }
    638 
    639637}
    640638
  • trunk/src/os2ahci/atapi.c

    r65 r66  
    284284  }
    285285
    286   /* free sense buffer */
    287   aws_free(aws);
    288 
    289 }
    290 
     286  /* mark IORB as complete */
     287  aws->complete = 1;
     288}
     289
  • trunk/src/os2ahci/ctxhook.c

    r63 r66  
    117117        need_reset = 0;
    118118
     119        dprintf("port %d, TF_DATA: 0x%lx\n", p, readl(port_mmio + PORT_TFDATA));
     120
    119121        /* get "current command slot"; only valid if there are no NCQ cmds */
    120122        ccs = (int) ((readl(port_mmio + PORT_CMD) >> 8) & 0x0f);
    121123
    122        for (iorb = ai->ports[p].iorb_queue.root; iorb != NULL; iorb = next) {
     124        for (iorb = ai->ports[p].iorb_queue.root; iorb != NULL; iorb = next) {
    123125          ADD_WORKSPACE _far *aws = add_workspace(iorb);
    124126          next = iorb->pNxtIORB;
     
    285287
    286288    /* move IORB to the local 'done' queue */
    287     aws_free(add_workspace(iorb));
    288289    iorb_queue_del(&abort_queue, iorb);
    289290    iorb_queue_add(&done_queue, iorb);
     
    331332          if (add_workspace(iorb)->queued_hw) {
    332333            /* this IORB had already been queued to HW when we reset the port */
    333             aws_free(add_workspace(iorb));
    334334            if (add_workspace(iorb)->idempotent) {
    335335              /* We can retry this IORB; just reset its status and it will be
    336336               * picked up by subsequent trigger_engine() calls.
    337337               */
    338               memset(&iorb->ADDWorkSpace, sizeof(iorb->ADDWorkSpace), 0x00);
     338              requeue_iorb(iorn);
    339339
    340340            } else {
     
    356356    next = iorb->pNxtIORB;
    357357    iorb->Status = IORB_DONE | IORB_ERROR;
     358    aws_free(add_workspace(iorb));
    358359    if (iorb->RequestControl & IORB_ASYNC_POST) {
    359360      iorb->NotifyAddress(iorb);
  • trunk/src/os2ahci/libc.c

    r37 r66  
    9595/******************************************************************************
    9696 * Initialize COM1 to 115200,n,8,1
     97 *
     98 * NOTE: Something is wrong with this code, or the init sequence, but we never
     99 *       got around to fixing it because it works fine on Virtualbox, and on
     100 *       physical machines we tend to have the kernel debugger running on the
     101 *       same port simply because serial ports are not that plenty on PCs
     102 *       these days, thus KDB will set port parameters for us. This is going
     103 *       to be fixed eventually...
    97104 */
    98105void init_com1(void)
Note: See TracChangeset for help on using the changeset viewer.