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


2612         }
2613 
2614         adv_reg_p->pcie_ue_tgt_addr = flt_addr;
2615         adv_reg_p->pcie_ue_tgt_bdf = flt_bdf;
2616         adv_reg_p->pcie_ue_tgt_trans = flt_trans_type;
2617 
2618         return (DDI_SUCCESS);
2619 }
2620 
2621 #define PCIE_EREPORT    DDI_IO_CLASS "." PCI_ERROR_SUBCLASS "." PCIEX_FABRIC
2622 static int
2623 pf_ereport_setup(dev_info_t *dip, uint64_t ena, nvlist_t **ereport,
2624     nvlist_t **detector, errorq_elem_t **eqep)
2625 {
2626         struct i_ddi_fmhdl *fmhdl = DEVI(dip)->devi_fmhdl;
2627         char device_path[MAXPATHLEN];
2628         nv_alloc_t *nva;
2629 
2630         *eqep = errorq_reserve(fmhdl->fh_errorq);
2631         if (*eqep == NULL) {
2632                 atomic_add_64(&fmhdl->fh_kstat.fek_erpt_dropped.value.ui64, 1);
2633                 return (DDI_FAILURE);
2634         }
2635 
2636         *ereport = errorq_elem_nvl(fmhdl->fh_errorq, *eqep);
2637         nva = errorq_elem_nva(fmhdl->fh_errorq, *eqep);
2638 
2639         ASSERT(*ereport);
2640         ASSERT(nva);
2641 
2642         /*
2643          * Use the dev_path/devid for this device instance.
2644          */
2645         *detector = fm_nvlist_create(nva);
2646         if (dip == ddi_root_node()) {
2647                 device_path[0] = '/';
2648                 device_path[1] = '\0';
2649         } else {
2650                 (void) ddi_pathname(dip, device_path);
2651         }
2652 




2612         }
2613 
2614         adv_reg_p->pcie_ue_tgt_addr = flt_addr;
2615         adv_reg_p->pcie_ue_tgt_bdf = flt_bdf;
2616         adv_reg_p->pcie_ue_tgt_trans = flt_trans_type;
2617 
2618         return (DDI_SUCCESS);
2619 }
2620 
2621 #define PCIE_EREPORT    DDI_IO_CLASS "." PCI_ERROR_SUBCLASS "." PCIEX_FABRIC
2622 static int
2623 pf_ereport_setup(dev_info_t *dip, uint64_t ena, nvlist_t **ereport,
2624     nvlist_t **detector, errorq_elem_t **eqep)
2625 {
2626         struct i_ddi_fmhdl *fmhdl = DEVI(dip)->devi_fmhdl;
2627         char device_path[MAXPATHLEN];
2628         nv_alloc_t *nva;
2629 
2630         *eqep = errorq_reserve(fmhdl->fh_errorq);
2631         if (*eqep == NULL) {
2632                 atomic_inc_64(&fmhdl->fh_kstat.fek_erpt_dropped.value.ui64);
2633                 return (DDI_FAILURE);
2634         }
2635 
2636         *ereport = errorq_elem_nvl(fmhdl->fh_errorq, *eqep);
2637         nva = errorq_elem_nva(fmhdl->fh_errorq, *eqep);
2638 
2639         ASSERT(*ereport);
2640         ASSERT(nva);
2641 
2642         /*
2643          * Use the dev_path/devid for this device instance.
2644          */
2645         *detector = fm_nvlist_create(nva);
2646         if (dip == ddi_root_node()) {
2647                 device_path[0] = '/';
2648                 device_path[1] = '\0';
2649         } else {
2650                 (void) ddi_pathname(dip, device_path);
2651         }
2652