Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/psm/uppc.c
          +++ new/usr/src/uts/i86pc/io/psm/uppc.c
↓ open down ↓ 309 lines elided ↑ open up ↑
 310  310  /*ARGSUSED3*/
 311  311  static int
 312  312  uppc_addspl(int irqno, int ipl, int min_ipl, int max_ipl)
 313  313  {
 314  314          struct standard_pic *pp;
 315  315          int i;
 316  316          int startidx;
 317  317          uchar_t vectmask;
 318  318  
 319  319          if (irqno <= MAX_ISA_IRQ)
 320      -                atomic_add_16(&uppc_irq_shared_table[irqno], 1);
      320 +                atomic_inc_16(&uppc_irq_shared_table[irqno]);
 321  321  
 322  322          if (ipl != min_ipl)
 323  323                  return (0);
 324  324  
 325  325          if (irqno > 7) {
 326  326                  vectmask = 1 << (irqno - 8);
 327  327                  startidx = (ipl << 1);
 328  328          } else {
 329  329                  vectmask = 1 << irqno;
 330  330                  startidx = (ipl << 1) + 1;
↓ open down ↓ 22 lines elided ↑ open up ↑
 353  353  }
 354  354  
 355  355  static int
 356  356  uppc_delspl(int irqno, int ipl, int min_ipl, int max_ipl)
 357  357  {
 358  358          struct standard_pic *pp;
 359  359          int i;
 360  360          uchar_t vectmask;
 361  361  
 362  362          if (irqno <= MAX_ISA_IRQ)
 363      -                atomic_add_16(&uppc_irq_shared_table[irqno], -1);
      363 +                atomic_dec_16(&uppc_irq_shared_table[irqno]);
 364  364  
 365  365          /*
 366  366           * skip if we are not deleting the last handler
 367  367           * and the ipl is higher than minimum
 368  368           */
 369  369          if ((max_ipl != PSM_INVALID_IPL) && (ipl >= min_ipl))
 370  370                  return (0);
 371  371  
 372  372          if (irqno > 7) {
 373  373                  vectmask = 1 << (irqno - 8);
↓ open down ↓ 701 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX