| /freebsd/stand/kboot/libkboot/ |
| H A D | seg.c | 12 static struct memory_segments *segs; variable 19 if (segs) in init_avail() 20 free(segs); in init_avail() 23 free(segs); in init_avail() 24 segs = malloc(sizeof(*segs) * segalloc); in init_avail() 25 if (segs == NULL) in init_avail() 42 segs = realloc(segs, segalloc * sizeof(*segs)); in need_avail() 43 if (segs == NULL) in need_avail() 59 segs[nr_seg - 1].end + 1 == start && in add_avail() 60 segs[nr_seg - 1].type == type) { in add_avail() [all …]
|
| /freebsd/sys/kern/ |
| H A D | subr_bus_dma.c | 155 struct mbuf *m, bus_dma_segment_t *segs, int *nsegs, int flags) in _bus_dmamap_load_mbuf_epg() argument 178 flags, segs, nsegs); in _bus_dmamap_load_mbuf_epg() 195 m->m_epg_pa[i] + segoff, seglen, flags, segs, nsegs); in _bus_dmamap_load_mbuf_epg() 203 &m->m_epg_trail[off], len, kernel_pmap, flags, segs, in _bus_dmamap_load_mbuf_epg() 214 struct mbuf *m, bus_dma_segment_t *segs, int *nsegs, int flags) in _bus_dmamap_load_single_mbuf() argument 220 error = _bus_dmamap_load_mbuf_epg(dmat, map, m, segs, nsegs, in _bus_dmamap_load_single_mbuf() 224 kernel_pmap, flags | BUS_DMA_LOAD_MBUF, segs, nsegs); in _bus_dmamap_load_single_mbuf() 235 struct mbuf *m0, bus_dma_segment_t *segs, int *nsegs, int flags) in _bus_dmamap_load_mbuf_sg() argument 245 map, m, segs, nsegs, flags); in _bus_dmamap_load_mbuf_sg() 249 flags | BUS_DMA_LOAD_MBUF, segs, nsegs); in _bus_dmamap_load_mbuf_sg() [all …]
|
| H A D | subr_busdma_bounce.c | 451 bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) in _bus_dmamap_addseg() argument 475 segs[seg].ds_addr = curaddr; in _bus_dmamap_addseg() 476 segs[seg].ds_len = sgsize; in _bus_dmamap_addseg() 478 if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && in _bus_dmamap_addseg() 479 (segs[seg].ds_len + sgsize) <= dmat_maxsegsz(dmat) && in _bus_dmamap_addseg() 480 vm_addr_bound_ok(segs[seg].ds_addr, in _bus_dmamap_addseg() 481 segs[seg].ds_len + sgsize, dmat_boundary(dmat))) in _bus_dmamap_addseg() 482 segs[seg].ds_len += sgsize; in _bus_dmamap_addseg() 486 segs[seg].ds_addr = curaddr; in _bus_dmamap_addseg() 487 segs[seg].ds_len = sgsize; in _bus_dmamap_addseg() [all …]
|
| /freebsd/libexec/rtld-elf/ |
| H A D | map_object.c | 67 Elf_Phdr **segs; in map_object() local 116 segs = alloca(sizeof(segs[0]) * hdr->e_phnum); in map_object() 126 segs[++nsegs] = phdr; in map_object() 127 if ((segs[nsegs]->p_align & (page_size - 1)) != 0) { in map_object() 133 if ((segs[nsegs]->p_flags & PF_X) == PF_X) { in map_object() 135 rtld_round_page(segs[nsegs]->p_vaddr + in map_object() 136 segs[nsegs]->p_memsz)); in map_object() 199 base_vaddr = rtld_trunc_page(segs[0]->p_vaddr); in map_object() 200 base_vlimit = rtld_round_page(segs[nsegs]->p_vaddr + in map_object() 201 segs[nsegs]->p_memsz); in map_object() [all …]
|
| /freebsd/sys/powerpc/pseries/ |
| H A D | plpar_iommu.c | 159 phyp_iommu_map(device_t dev, bus_dma_segment_t *segs, int *nsegs, in phyp_iommu_map() argument 178 allocsize = round_page(segs[i].ds_len + in phyp_iommu_map() 179 (segs[i].ds_addr & PAGE_MASK)); in phyp_iommu_map() 188 KASSERT((alloced + (segs[i].ds_addr & PAGE_MASK)) % in phyp_iommu_map() 192 tce = trunc_page(segs[i].ds_addr); in phyp_iommu_map() 203 segs[i].ds_addr = alloced + (segs[i].ds_addr & PAGE_MASK); in phyp_iommu_map() 204 KASSERT(segs[i].ds_addr > 0, ("Address needs to be positive")); in phyp_iommu_map() 205 KASSERT(segs[i].ds_addr + segs[i].ds_len < maxaddr, in phyp_iommu_map() 217 phyp_iommu_unmap(device_t dev, bus_dma_segment_t *segs, int nsegs, void *cookie) in phyp_iommu_unmap() argument 226 pageround = trunc_page(segs[i].ds_addr); in phyp_iommu_unmap() [all …]
|
| H A D | phyp_llan.c | 122 static void llan_rx_load_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, 275 llan_rx_load_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int err) in llan_rx_load_cb() argument 279 sc->rx_buf_phys = segs[0].ds_addr; in llan_rx_load_cb() 280 sc->rx_buf_len = segs[0].ds_len - 2*PAGE_SIZE; in llan_rx_load_cb() 281 sc->input_buf_phys = segs[0].ds_addr + segs[0].ds_len - PAGE_SIZE; in llan_rx_load_cb() 282 sc->filter_buf_phys = segs[0].ds_addr + segs[0].ds_len - 2*PAGE_SIZE; in llan_rx_load_cb() 326 bus_dma_segment_t segs[1]; in llan_add_rxbuf() local 346 segs, &nsegs, BUS_DMA_NOWAIT); in llan_add_rxbuf() 362 rx->rx_bufdesc |= (((uint64_t)segs[0].ds_len) << 32); in llan_add_rxbuf() 363 rx->rx_bufdesc |= segs[0].ds_addr; in llan_add_rxbuf() [all …]
|
| /freebsd/sys/dev/ice/ |
| H A D | ice_flow.c | 417 * @segs: array of one or more packet segments that describe the flow 420 static int ice_flow_val_hdrs(struct ice_flow_seg_info *segs, u8 segs_cnt) 426 if (segs[i].hdrs & ICE_FLOW_SEG_HDRS_L3_MASK && in ice_flow_val_hdrs() 427 !ice_is_pow2(segs[i].hdrs & ICE_FLOW_SEG_HDRS_L3_MASK)) in ice_flow_val_hdrs() 431 if (segs[i].hdrs & ICE_FLOW_SEG_HDRS_L4_MASK && in ice_flow_val_hdrs() 432 !ice_is_pow2(segs[i].hdrs & ICE_FLOW_SEG_HDRS_L4_MASK)) in ice_flow_val_hdrs() 461 hdrs = prof->segs[i].hdrs; in ice_flow_proc_seg_hdrs() 571 flds = params->prof->segs[seg].fields; in ice_flow_xtract_fld() 644 prot_id = (params->prof->segs[seg].hdrs & ICE_FLOW_SEG_HDR_IPV4) ? in ice_flow_xtract_fld() 728 ice_cp_bitmap(match, params->prof->segs[ in ice_flow_create_xtrct_seq() 422 ice_flow_val_hdrs(struct ice_flow_seg_info * segs,u8 segs_cnt) ice_flow_val_hdrs() argument 791 ice_flow_find_prof_conds(struct ice_hw * hw,enum ice_block blk,enum ice_flow_dir dir,struct ice_flow_seg_info * segs,u8 segs_cnt,u16 vsi_handle,u32 conds) ice_flow_find_prof_conds() argument 841 ice_flow_find_prof(struct ice_hw * hw,enum ice_block blk,enum ice_flow_dir dir,struct ice_flow_seg_info * segs,u8 segs_cnt) ice_flow_find_prof() argument 910 ice_flow_add_prof_sync(struct ice_hw * hw,enum ice_block blk,enum ice_flow_dir dir,u64 prof_id,struct ice_flow_seg_info * segs,u8 segs_cnt,struct ice_flow_action * acts,u8 acts_cnt,struct ice_flow_prof ** prof) ice_flow_add_prof_sync() argument 1103 ice_flow_add_prof(struct ice_hw * hw,enum ice_block blk,enum ice_flow_dir dir,u64 prof_id,struct ice_flow_seg_info * segs,u8 segs_cnt,struct ice_flow_action * acts,u8 acts_cnt,struct ice_flow_prof ** prof) ice_flow_add_prof() argument 1283 ice_flow_set_rss_seg_info(struct ice_flow_seg_info * segs,u8 seg_cnt,const struct ice_rss_hash_cfg * cfg) ice_flow_set_rss_seg_info() argument 1554 struct ice_flow_seg_info *segs; ice_add_rss_cfg_sync() local 1704 struct ice_flow_seg_info *segs; ice_rem_rss_cfg_sync() local [all...] |
| /freebsd/sys/riscv/include/ |
| H A D | bus_dma.h | 87 bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp) in _bus_dmamap_load_phys() argument 92 return (tc->impl->load_phys(dmat, map, buf, buflen, flags, segs, in _bus_dmamap_load_phys() 98 bus_size_t tlen, int ma_offs, int flags, bus_dma_segment_t *segs, in _bus_dmamap_load_ma() argument 105 segs, segp)); in _bus_dmamap_load_ma() 110 bus_size_t buflen, struct pmap *pmap, int flags, bus_dma_segment_t *segs, in _bus_dmamap_load_buffer() argument 116 return (tc->impl->load_buffer(dmat, map, buf, buflen, pmap, flags, segs, in _bus_dmamap_load_buffer() 132 bus_dma_segment_t *segs, int nsegs, int error) in _bus_dmamap_complete() argument 137 return (tc->impl->map_complete(dmat, map, segs, nsegs, error)); in _bus_dmamap_complete()
|
| H A D | bus_dma_impl.h | 63 bus_dma_segment_t *segs, int *segp); 66 bus_dma_segment_t *segs, int *segp); 69 bus_dma_segment_t *segs, int *segp); 74 bus_dma_segment_t *segs, int nsegs, int error);
|
| /freebsd/sys/powerpc/include/ |
| H A D | bus_dma.h | 115 bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp) in _bus_dmamap_load_phys() argument 120 return (tc->impl->load_phys(dmat, map, buf, buflen, flags, segs, in _bus_dmamap_load_phys() 126 bus_size_t tlen, int ma_offs, int flags, bus_dma_segment_t *segs, in _bus_dmamap_load_ma() argument 133 segs, segp)); in _bus_dmamap_load_ma() 138 bus_size_t buflen, struct pmap *pmap, int flags, bus_dma_segment_t *segs, in _bus_dmamap_load_buffer() argument 144 return (tc->impl->load_buffer(dmat, map, buf, buflen, pmap, flags, segs, in _bus_dmamap_load_buffer() 160 bus_dma_segment_t *segs, int nsegs, int error) in _bus_dmamap_complete() argument 165 return (tc->impl->map_complete(dmat, map, segs, nsegs, error)); in _bus_dmamap_complete()
|
| H A D | bus_dma_impl.h | 63 bus_dma_segment_t *segs, int *segp); 66 bus_dma_segment_t *segs, int *segp); 69 bus_dma_segment_t *segs, int *segp); 74 bus_dma_segment_t *segs, int nsegs, int error);
|
| /freebsd/sys/x86/include/ |
| H A D | bus_dma.h | 133 bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp) in _bus_dmamap_load_phys() argument 138 return (tc->impl->load_phys(dmat, map, buf, buflen, flags, segs, in _bus_dmamap_load_phys() 144 bus_size_t tlen, int ma_offs, int flags, bus_dma_segment_t *segs, in _bus_dmamap_load_ma() argument 151 segs, segp)); in _bus_dmamap_load_ma() 160 bus_size_t buflen, struct pmap *pmap, int flags, bus_dma_segment_t *segs, in _bus_dmamap_load_buffer() argument 166 return (tc->impl->load_buffer(dmat, map, buf, buflen, pmap, flags, segs, in _bus_dmamap_load_buffer() 184 bus_dma_segment_t *segs, int nsegs, int error) in _bus_dmamap_complete() argument 189 return (tc->impl->map_complete(dmat, map, segs, nsegs, error)); in _bus_dmamap_complete()
|
| H A D | busdma_impl.h | 65 bus_dma_segment_t *segs, int *segp); 68 bus_dma_segment_t *segs, int *segp); 71 bus_dma_segment_t *segs, int *segp); 76 bus_dma_segment_t *segs, int nsegs, int error);
|
| /freebsd/sys/dev/cxgb/sys/ |
| H A D | uipc_mvec.c | 53 struct mbuf **m, bus_dma_segment_t *segs, int *nsegs) in busdma_map_sg_collapse() argument 63 err = bus_dmamap_load_mbuf_sg(tag, map, *m, segs, &seg_count, 0); in busdma_map_sg_collapse() 94 struct mbuf *m, bus_dma_segment_t *segs, int *nsegs) in busdma_map_sg_vec() argument 98 for (*nsegs = 0; m != NULL; segs += n, *nsegs += n, m = m->m_nextpkt) in busdma_map_sg_vec() 99 bus_dmamap_load_mbuf_sg(tag, map, m, segs, &n, 0); in busdma_map_sg_vec()
|
| /freebsd/sys/dev/qat/qat/ |
| H A D | qat_ocf_mem_pool.c | 23 qat_ocf_alloc_single_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) in qat_ocf_alloc_single_cb() argument 31 dma_mem->dma_seg = segs[0]; in qat_ocf_alloc_single_cb() 36 bus_dma_segment_t *segs, in qat_ocf_populate_buf_list_cb() argument 49 segment_addr = segs[iseg].ds_addr; in qat_ocf_populate_buf_list_cb() 50 segment_len = segs[iseg].ds_len; in qat_ocf_populate_buf_list_cb() 73 bus_dma_segment_t *segs, in qat_ocf_crypto_load_aadbuf_cb() argument 88 &qat_cookie->src_buffers, segs, nseg, 0, 0); in qat_ocf_crypto_load_aadbuf_cb() 93 bus_dma_segment_t *segs, in qat_ocf_crypto_load_buf_cb() argument 113 &qat_cookie->src_buffers, segs, nseg, start_segment, skip_bytes); in qat_ocf_crypto_load_buf_cb() 118 bus_dma_segment_t *segs, in qat_ocf_crypto_load_obuf_cb() argument [all …]
|
| /freebsd/sys/powerpc/powerpc/ |
| H A D | busdma_bounce.c | 541 bus_dma_segment_t *segs, in bounce_bus_dmamap_load_phys() argument 548 if (segs == NULL) in bounce_bus_dmamap_load_phys() 549 segs = map->segments; in bounce_bus_dmamap_load_phys() 568 if (!_bus_dmamap_addsegs(dmat, map, curaddr, sgsize, segs, in bounce_bus_dmamap_load_phys() 584 bus_dma_segment_t *segs, int *segp) in bounce_bus_dmamap_load_ma() argument 588 segs, segp)); in bounce_bus_dmamap_load_ma() 601 bus_dma_segment_t *segs, in bounce_bus_dmamap_load_buffer() argument 609 if (segs == NULL) in bounce_bus_dmamap_load_buffer() 610 segs = map->segments; in bounce_bus_dmamap_load_buffer() 646 if (!_bus_dmamap_addsegs(dmat, map, curaddr, sgsize, segs, in bounce_bus_dmamap_load_buffer() [all …]
|
| /freebsd/sys/sys/ |
| H A D | bus_dma_internal.h | 39 bus_dmamap_t map, bus_dma_segment_t *segs, 44 int flags, bus_dma_segment_t *segs, int *segp); 48 int flags, bus_dma_segment_t *segs, int *segp); 52 int flags, bus_dma_segment_t *segs, int *segp);
|
| /freebsd/sys/dev/sfxge/ |
| H A D | sfxge_dma.c | 50 sfxge_dma_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) in sfxge_dma_cb() argument 61 *addr = segs[0].ds_addr; in sfxge_dma_cb() 66 struct mbuf **mp, bus_dma_segment_t *segs, in sfxge_dma_map_sg_collapse() argument 81 psegs = segs; in sfxge_dma_map_sg_collapse() 84 sfxge_map_mbuf_fast(tag, map, m, segs); in sfxge_dma_map_sg_collapse() 101 err = bus_dmamap_load_mbuf_sg(tag, map, *mp, segs, &seg_count, 0); in sfxge_dma_map_sg_collapse()
|
| /freebsd/sys/dev/oce/ |
| H A D | oce_util.c | 45 bus_dma_segment_t *segs, 134 oce_dma_map_addr(void *arg, bus_dma_segment_t * segs, int nseg, int error) in oce_dma_map_addr() argument 141 *paddr = segs->ds_addr; in oce_dma_map_addr() 216 oce_dma_map_ring(void *arg, bus_dma_segment_t * segs, int nseg, int error) in oce_dma_map_ring() argument 225 dpt->paddrs[i].lo = ADDR_LO(segs[i].ds_addr); in oce_dma_map_ring() 226 dpt->paddrs[i].hi = ADDR_HI(segs[i].ds_addr); in oce_dma_map_ring()
|
| /freebsd/sys/contrib/openzfs/module/zfs/ |
| H A D | vdev_removal.c | 1157 spa_vdev_copy_segment(vdev_t *vd, zfs_range_tree_t *segs, in spa_vdev_copy_segment() argument 1166 uint64_t start = zfs_range_tree_min(segs); in spa_vdev_copy_segment() 1172 uint64_t size = zfs_range_tree_span(segs); in spa_vdev_copy_segment() 1173 if (zfs_range_tree_span(segs) > maxalloc) { in spa_vdev_copy_segment() 1181 zfs_rs_set_start(&search, segs, start + maxalloc); in spa_vdev_copy_segment() 1182 zfs_rs_set_end(&search, segs, start + maxalloc); in spa_vdev_copy_segment() 1183 (void) zfs_btree_find(&segs->rt_root, &search, &where); in spa_vdev_copy_segment() 1184 zfs_range_seg_t *rs = zfs_btree_prev(&segs->rt_root, &where, in spa_vdev_copy_segment() 1187 size = zfs_rs_get_end(rs, segs) - start; in spa_vdev_copy_segment() 1225 zfs_range_seg_t *rs = zfs_btree_first(&segs->rt_root, &where); in spa_vdev_copy_segment() [all …]
|
| /freebsd/sys/dev/rtwn/pci/ |
| H A D | rtwn_pci_tx.c | 97 bus_dma_segment_t segs[1]; in rtwn_pci_tx_start_frame() local 135 error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, m, segs, in rtwn_pci_tx_start_frame() 153 segs, &nsegs, BUS_DMA_NOWAIT); in rtwn_pci_tx_start_frame() 167 rtwn_pci_tx_postsetup(pc, txd, segs); in rtwn_pci_tx_start_frame() 204 bus_dma_segment_t segs[1]; in rtwn_pci_tx_start_beacon() local 231 data->map, m, segs, &nsegs, BUS_DMA_NOWAIT); in rtwn_pci_tx_start_beacon() 240 rtwn_pci_tx_postsetup(pc, txd, segs); in rtwn_pci_tx_start_beacon()
|
| /freebsd/sys/x86/x86/ |
| H A D | busdma_bounce.c | 633 vm_paddr_t buf, bus_size_t buflen, int flags, bus_dma_segment_t *segs, in bounce_bus_dmamap_load_phys() argument 643 if (segs == NULL) in bounce_bus_dmamap_load_phys() 644 segs = dmat->segments; in bounce_bus_dmamap_load_phys() 666 if (!_bus_dmamap_addsegs(dmat, map, curaddr, sgsize, segs, in bounce_bus_dmamap_load_phys() 685 bus_size_t buflen, pmap_t pmap, int flags, bus_dma_segment_t *segs, in bounce_bus_dmamap_load_buffer() argument 696 if (segs == NULL) in bounce_bus_dmamap_load_buffer() 697 segs = dmat->segments; in bounce_bus_dmamap_load_buffer() 733 if (!_bus_dmamap_addsegs(dmat, map, curaddr, sgsize, segs, in bounce_bus_dmamap_load_buffer() 749 bus_dma_segment_t *segs, int *segp) in bounce_bus_dmamap_load_ma() argument 762 flags, segs, segp); in bounce_bus_dmamap_load_ma() [all …]
|
| /freebsd/sys/arm64/include/ |
| H A D | bus_dma_impl.h | 63 bus_dma_segment_t *segs, int *segp); 66 bus_dma_segment_t *segs, int *segp); 69 bus_dma_segment_t *segs, int *segp); 74 bus_dma_segment_t *segs, int nsegs, int error);
|
| /freebsd/sys/dev/usb/ |
| H A D | usb_busdma.c | 414 usb_pc_alloc_mem_cb(void *arg, bus_dma_segment_t *segs, in usb_pc_alloc_mem_cb() argument 417 usb_pc_common_mem_cb(arg, segs, nseg, error, 0); in usb_pc_alloc_mem_cb() 424 usb_pc_load_mem_cb(void *arg, bus_dma_segment_t *segs, in usb_pc_load_mem_cb() argument 427 usb_pc_common_mem_cb(arg, segs, nseg, error, 1); in usb_pc_load_mem_cb() 434 usb_pc_common_mem_cb(void *arg, bus_dma_segment_t *segs, in usb_pc_common_mem_cb() argument 460 pg->physaddr = rounddown2(segs->ds_addr, USB_PAGE_SIZE); in usb_pc_common_mem_cb() 461 rem = segs->ds_addr & (USB_PAGE_SIZE - 1); in usb_pc_common_mem_cb() 469 if (((segs[x].ds_addr + segs[x].ds_len) & (USB_PAGE_SIZE - 1)) == in usb_pc_common_mem_cb() 470 ((segs[x + 1].ds_addr & (USB_PAGE_SIZE - 1)))) in usb_pc_common_mem_cb() 485 if (off >= (segs->ds_len + rem)) { in usb_pc_common_mem_cb() [all …]
|
| /freebsd/sys/dev/liquidio/ |
| H A D | lio_rxtx.c | 58 bus_dma_segment_t segs[LIO_MAX_SG]; in lio_xmit() local 91 status = bus_dmamap_load_mbuf_sg(iq->txtag, map, *m_headp, segs, &nsegs, in lio_xmit() 104 *m_headp, segs, &nsegs, in lio_xmit() 142 cmdsetup.s.u.datasize = segs[0].ds_len; in lio_xmit() 145 dptr = segs[0].ds_addr; in lio_xmit() 172 g->sg[(i >> 2)].ptr[(i & 3)] = segs[i].ds_addr; in lio_xmit() 173 lio_add_sg_size(&g->sg[(i >> 2)], segs[i].ds_len, in lio_xmit()
|