Print this page
8368 remove warlock leftovers from usr/src/uts

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/aac/aac.c
          +++ new/usr/src/uts/common/io/aac/aac.c
↓ open down ↓ 659 lines elided ↑ open up ↑
 660  660          0xffffffffull,  /* max DMA xfer size */
 661  661          0xffffffffull,  /* segment boundary */
 662  662          1,              /* s/g list length */
 663  663          AAC_BLK_SIZE,   /* granularity of device */
 664  664          0               /* DMA transfer flags */
 665  665  };
 666  666  
 667  667  static int aac_tick = AAC_DEFAULT_TICK; /* tick for the internal timer */
 668  668  static uint32_t aac_timebase = 0;       /* internal timer in seconds */
 669  669  
 670      -/*
 671      - * Warlock directives
 672      - *
 673      - * Different variables with the same types have to be protected by the
 674      - * same mutex; otherwise, warlock will complain with "variables don't
 675      - * seem to be protected consistently". For example,
 676      - * aac_softstate::{q_wait, q_comp} are type of aac_cmd_queue, and protected
 677      - * by aac_softstate::{io_lock, q_comp_mutex} respectively. We have to
 678      - * declare them as protected explictly at aac_cmd_dequeue().
 679      - */
 680      -_NOTE(SCHEME_PROTECTS_DATA("unique per pkt", scsi_pkt scsi_cdb scsi_status \
 681      -    scsi_arq_status scsi_descr_sense_hdr scsi_information_sense_descr \
 682      -    mode_format mode_geometry mode_header aac_cmd))
 683      -_NOTE(SCHEME_PROTECTS_DATA("unique per aac_cmd", aac_fib ddi_dma_cookie_t \
 684      -    aac_sge))
 685      -_NOTE(SCHEME_PROTECTS_DATA("unique per aac_fib", aac_blockread aac_blockwrite \
 686      -    aac_blockread64 aac_raw_io aac_sg_entry aac_sg_entry64 aac_sg_entryraw \
 687      -    aac_sg_table aac_srb))
 688      -_NOTE(SCHEME_PROTECTS_DATA("unique to sync fib and cdb", scsi_inquiry))
 689      -_NOTE(SCHEME_PROTECTS_DATA("stable data", scsi_device scsi_address))
 690      -_NOTE(SCHEME_PROTECTS_DATA("unique to scsi_transport", buf))
 691      -
 692  670  int
 693  671  _init(void)
 694  672  {
 695  673          int rval = 0;
 696  674  
 697  675  #ifdef DEBUG
 698  676          mutex_init(&aac_prt_mutex, NULL, MUTEX_DRIVER, NULL);
 699  677  #endif
 700  678          DBCALLED(NULL, 1);
 701  679  
↓ open down ↓ 363 lines elided ↑ open up ↑
1065 1043   * DDI_FAILURE indicates an error condition and should almost never happen.
1066 1044   */
1067 1045  static int
1068 1046  aac_quiesce(dev_info_t *dip)
1069 1047  {
1070 1048          struct aac_softstate *softs = AAC_DIP2SOFTS(dip);
1071 1049  
1072 1050          if (softs == NULL)
1073 1051                  return (DDI_FAILURE);
1074 1052  
1075      -        _NOTE(ASSUMING_PROTECTED(softs->state))
1076 1053          AAC_DISABLE_INTR(softs);
1077 1054  
1078 1055          return (DDI_SUCCESS);
1079 1056  }
1080 1057  
1081 1058  /* ARGSUSED */
1082 1059  static int
1083 1060  aac_getinfo(dev_info_t *self, ddi_info_cmd_t infocmd, void *arg,
1084 1061      void **result)
1085 1062  {
↓ open down ↓ 683 lines elided ↑ open up ↑
1769 1746          return (rval);
1770 1747  }
1771 1748  
1772 1749  /*
1773 1750   * Set pkt_reason and OR in pkt_statistics flag
1774 1751   */
1775 1752  static void
1776 1753  aac_set_pkt_reason(struct aac_softstate *softs, struct aac_cmd *acp,
1777 1754      uchar_t reason, uint_t stat)
1778 1755  {
1779      -#ifndef __lock_lint
1780 1756          _NOTE(ARGUNUSED(softs))
1781      -#endif
1782 1757          if (acp->pkt->pkt_reason == CMD_CMPLT)
1783 1758                  acp->pkt->pkt_reason = reason;
1784 1759          acp->pkt->pkt_statistics |= stat;
1785 1760  }
1786 1761  
1787 1762  /*
1788 1763   * Handle a finished pkt of soft SCMD
1789 1764   */
1790 1765  static void
1791 1766  aac_soft_callback(struct aac_softstate *softs, struct aac_cmd *acp)
↓ open down ↓ 1348 lines elided ↑ open up ↑
3140 3115  }
3141 3116  
3142 3117  /*
3143 3118   * Remove a cmd from the head of q
3144 3119   */
3145 3120  static struct aac_cmd *
3146 3121  aac_cmd_dequeue(struct aac_cmd_queue *q)
3147 3122  {
3148 3123          struct aac_cmd *acp;
3149 3124  
3150      -        _NOTE(ASSUMING_PROTECTED(*q))
3151      -
3152 3125          if ((acp = q->q_head) != NULL) {
3153 3126                  if ((q->q_head = acp->next) != NULL)
3154 3127                          acp->next = NULL;
3155 3128                  else
3156 3129                          q->q_tail = (struct aac_cmd *)&q->q_head;
3157 3130                  acp->prev = NULL;
3158 3131          }
3159 3132          return (acp);
3160 3133  }
3161 3134  
↓ open down ↓ 977 lines elided ↑ open up ↑
4139 4112          (void) snprintf(name, len, "%x,%x", tgt, lun);
4140 4113          return (DDI_SUCCESS);
4141 4114  }
4142 4115  
4143 4116  /*ARGSUSED*/
4144 4117  static int
4145 4118  aac_tran_tgt_init(dev_info_t *hba_dip, dev_info_t *tgt_dip,
4146 4119      scsi_hba_tran_t *tran, struct scsi_device *sd)
4147 4120  {
4148 4121          struct aac_softstate *softs = AAC_TRAN2SOFTS(tran);
4149      -#if defined(DEBUG) || defined(__lock_lint)
     4122 +#ifdef DEBUG
4150 4123          int ctl = ddi_get_instance(softs->devinfo_p);
4151 4124  #endif
4152 4125          uint16_t tgt = sd->sd_address.a_target;
4153 4126          uint8_t lun = sd->sd_address.a_lun;
4154 4127          struct aac_device *dvp;
4155 4128  
4156 4129          DBCALLED(softs, 2);
4157 4130  
4158 4131          if (ndi_dev_is_persistent_node(tgt_dip) == 0) {
4159 4132                  /*
↓ open down ↓ 62 lines elided ↑ open up ↑
4222 4195              "aac_tran_tgt_init: c%dt%dL%d ok (%s)", ctl, tgt, lun,
4223 4196              (dvp->type == AAC_DEV_PD) ? "pd" : "ld");
4224 4197          mutex_exit(&softs->io_lock);
4225 4198          return (DDI_SUCCESS);
4226 4199  }
4227 4200  
4228 4201  static void
4229 4202  aac_tran_tgt_free(dev_info_t *hba_dip, dev_info_t *tgt_dip,
4230 4203      scsi_hba_tran_t *hba_tran, struct scsi_device *sd)
4231 4204  {
4232      -#ifndef __lock_lint
4233 4205          _NOTE(ARGUNUSED(hba_dip, tgt_dip, hba_tran))
4234      -#endif
4235 4206  
4236 4207          struct aac_softstate *softs = SD2AAC(sd);
4237 4208          int tgt = sd->sd_address.a_target;
4238 4209  
4239 4210          mutex_enter(&softs->io_lock);
4240 4211          if (tgt < AAC_MAX_LD) {
4241 4212                  if (softs->containers[tgt].dev.dip == tgt_dip)
4242 4213                          softs->containers[tgt].dev.dip = NULL;
4243 4214          } else {
4244 4215                  if (softs->nondasds[AAC_PD(tgt)].dev.dip == tgt_dip)
↓ open down ↓ 1135 lines elided ↑ open up ↑
5380 5351                  }
5381 5352                  acp = new_acp = PKT2AC(pkt);
5382 5353                  acp->pkt = pkt;
5383 5354                  acp->cmdlen = cmdlen;
5384 5355  
5385 5356                  if (ap->a_target < AAC_MAX_LD) {
5386 5357                          acp->dvp = &softs->containers[ap->a_target].dev;
5387 5358                          acp->aac_cmd_fib = softs->aac_cmd_fib;
5388 5359                          acp->ac_comp = aac_ld_complete;
5389 5360                  } else {
5390      -                        _NOTE(ASSUMING_PROTECTED(softs->nondasds))
5391      -
5392 5361                          acp->dvp = &softs->nondasds[AAC_PD(ap->a_target)].dev;
5393 5362                          acp->aac_cmd_fib = softs->aac_cmd_fib_scsi;
5394 5363                          acp->ac_comp = aac_pd_complete;
5395 5364                  }
5396 5365          } else {
5397 5366                  acp = PKT2AC(pkt);
5398 5367                  new_acp = NULL;
5399 5368          }
5400 5369  
5401 5370          if (aac_cmd_dma_alloc(softs, acp, bp, flags, callback, arg) == AACOK)
↓ open down ↓ 3100 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX