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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86xpv/io/psm/xpv_uppc.c
          +++ new/usr/src/uts/i86xpv/io/psm/xpv_uppc.c
↓ open down ↓ 243 lines elided ↑ open up ↑
 244  244  
 245  245  
 246  246  /*ARGSUSED*/
 247  247  static int
 248  248  xen_uppc_addspl(int irqno, int ipl, int min_ipl, int max_ipl)
 249  249  {
 250  250          int ret = PSM_SUCCESS;
 251  251          cpuset_t cpus;
 252  252  
 253  253          if (irqno >= 0 && irqno <= MAX_ISA_IRQ)
 254      -                atomic_add_16(&xen_uppc_irq_shared_table[irqno], 1);
      254 +                atomic_inc_16(&xen_uppc_irq_shared_table[irqno]);
 255  255  
 256  256          /*
 257  257           * We are called at splhi() so we can't call anything that might end
 258  258           * up trying to context switch.
 259  259           */
 260  260          if (irqno >= PIRQ_BASE && irqno < NR_PIRQS &&
 261  261              DOMAIN_IS_INITDOMAIN(xen_info)) {
 262  262                  CPUSET_ZERO(cpus);
 263  263                  CPUSET_ADD(cpus, 0);
 264  264                  ec_setup_pirq(irqno, ipl, &cpus);
↓ open down ↓ 12 lines elided ↑ open up ↑
 277  277          return (ret);
 278  278  }
 279  279  
 280  280  /*ARGSUSED*/
 281  281  static int
 282  282  xen_uppc_delspl(int irqno, int ipl, int min_ipl, int max_ipl)
 283  283  {
 284  284          int err = PSM_SUCCESS;
 285  285  
 286  286          if (irqno >= 0 && irqno <= MAX_ISA_IRQ)
 287      -                atomic_add_16(&xen_uppc_irq_shared_table[irqno], -1);
      287 +                atomic_dec_16(&xen_uppc_irq_shared_table[irqno]);
 288  288  
 289  289          if (irqno >= PIRQ_BASE && irqno < NR_PIRQS &&
 290  290              DOMAIN_IS_INITDOMAIN(xen_info)) {
 291  291                  if (max_ipl == PSM_INVALID_IPL) {
 292  292                          /*
 293  293                           * unbind if no more sharers of this irq/evtchn
 294  294                           */
 295  295                          (void) ec_block_irq(irqno);
 296  296                          ec_unbind_irq(irqno);
 297  297                  } else {
↓ open down ↓ 627 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX