Home
last modified time | relevance | path

Searched refs:nr_pages (Results 1 – 25 of 124) sorted by relevance

12345

/drivers/media/v4l2-core/
Dvideobuf-dma-sg.c66 int nr_pages) in videobuf_vmalloc_to_sg() argument
72 sglist = vzalloc(nr_pages * sizeof(*sglist)); in videobuf_vmalloc_to_sg()
75 sg_init_table(sglist, nr_pages); in videobuf_vmalloc_to_sg()
76 for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { in videobuf_vmalloc_to_sg()
96 int nr_pages, int offset, size_t size) in videobuf_pages_to_sg() argument
103 sglist = vmalloc(nr_pages * sizeof(*sglist)); in videobuf_pages_to_sg()
106 sg_init_table(sglist, nr_pages); in videobuf_pages_to_sg()
114 for (i = 1; i < nr_pages; i++) { in videobuf_pages_to_sg()
177 dma->nr_pages = last-first+1; in videobuf_dma_init_user_locked()
178 dma->pages = kmalloc(dma->nr_pages * sizeof(struct page *), GFP_KERNEL); in videobuf_dma_init_user_locked()
[all …]
/drivers/misc/mic/scif/
Dscif_rma.c91 scif_create_pinned_pages(int nr_pages, int prot) in scif_create_pinned_pages() argument
100 pin->pages = scif_zalloc(nr_pages * sizeof(*pin->pages)); in scif_create_pinned_pages()
126 for (j = 0; j < pin->nr_pages; j++) { in scif_destroy_pinned_pages()
135 pin->nr_pages * sizeof(*pin->pages)); in scif_destroy_pinned_pages()
149 struct scif_window *scif_create_window(struct scif_endpt *ep, int nr_pages, in scif_create_window() argument
159 window->dma_addr = scif_zalloc(nr_pages * sizeof(*window->dma_addr)); in scif_create_window()
163 window->num_pages = scif_zalloc(nr_pages * sizeof(*window->num_pages)); in scif_create_window()
181 nr_pages * sizeof(*window->dma_addr)); in scif_create_window()
198 int nr_pages = window->nr_pages; in scif_destroy_incomplete_window() local
223 scif_free(window->dma_addr, nr_pages * sizeof(*window->dma_addr)); in scif_destroy_incomplete_window()
[all …]
Dscif_mmap.c43 req.nr_bytes = recv_window->nr_pages << PAGE_SHIFT; in scif_recv_munmap()
57 scif_put_window(window, window->nr_pages); in scif_recv_munmap()
139 scif_put_window(window, window->nr_pages); in __scif_cleanup_rma_for_zombies()
227 int nr_pages, err, i; in scif_get_pages() local
242 nr_pages = len >> PAGE_SHIFT; in scif_get_pages()
268 (*pages)->phys_addr = scif_zalloc(nr_pages * sizeof(dma_addr_t)); in scif_get_pages()
276 ((*pages)->va = scif_zalloc(nr_pages * sizeof(void *))); in scif_get_pages()
284 (*pages)->nr_pages = nr_pages; in scif_get_pages()
287 for (i = 0; i < nr_pages; i++) { in scif_get_pages()
300 scif_get_window(window, nr_pages); in scif_get_pages()
[all …]
Dscif_rma.h187 s64 nr_pages; member
243 s64 nr_pages; member
310 s64 offset, int nr_pages, s64 *out_offset);
315 struct scif_window *scif_create_window(struct scif_endpt *ep, int nr_pages,
426 static inline void scif_get_window(struct scif_window *window, int nr_pages) in scif_get_window() argument
428 window->ref_count += nr_pages; in scif_get_window()
431 static inline void scif_put_window(struct scif_window *window, int nr_pages) in scif_put_window() argument
433 window->ref_count -= nr_pages; in scif_put_window()
436 static inline void scif_set_window_ref(struct scif_window *window, int nr_pages) in scif_set_window_ref() argument
438 window->ref_count = nr_pages; in scif_set_window_ref()
Dscif_rma_list.c74 scif_set_window_ref(window, window->nr_pages); in scif_insert_window()
101 (window->nr_pages << PAGE_SHIFT); in scif_query_tcw()
109 (window->nr_pages << PAGE_SHIFT); in scif_query_tcw()
157 (window->nr_pages << PAGE_SHIFT); in scif_query_window()
204 s64 offset, int nr_pages) in scif_rma_list_unregister() argument
214 end_offset = window->offset + (window->nr_pages << PAGE_SHIFT); in scif_rma_list_unregister()
216 nr_pages); in scif_rma_list_unregister()
220 nr_pages -= loop_nr_pages; in scif_rma_list_unregister()
222 if (!nr_pages) in scif_rma_list_unregister()
/drivers/xen/
Dballoon.c420 static enum bp_state increase_reservation(unsigned long nr_pages) in increase_reservation() argument
431 if (nr_pages > ARRAY_SIZE(frame_list)) in increase_reservation()
432 nr_pages = ARRAY_SIZE(frame_list); in increase_reservation()
435 for (i = 0; i < nr_pages; i++) { in increase_reservation()
437 nr_pages = i; in increase_reservation()
449 reservation.nr_extents = nr_pages; in increase_reservation()
491 static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) in decrease_reservation() argument
504 if (nr_pages > ARRAY_SIZE(frame_list)) in decrease_reservation()
505 nr_pages = ARRAY_SIZE(frame_list); in decrease_reservation()
507 for (i = 0; i < nr_pages; i++) { in decrease_reservation()
[all …]
Dprivcmd.c66 unsigned long nr_pages);
454 unsigned long nr_pages; in privcmd_ioctl_mmap_batch() local
482 nr_pages = DIV_ROUND_UP(m.num, XEN_PFN_PER_PAGE); in privcmd_ioctl_mmap_batch()
483 if ((m.num <= 0) || (nr_pages > (LONG_MAX >> PAGE_SHIFT))) in privcmd_ioctl_mmap_batch()
525 m.addr + (nr_pages << PAGE_SHIFT) != vma->vm_end) { in privcmd_ioctl_mmap_batch()
530 ret = alloc_empty_pages(vma, nr_pages); in privcmd_ioctl_mmap_batch()
537 m.addr + (nr_pages << PAGE_SHIFT) > vma->vm_end) { in privcmd_ioctl_mmap_batch()
541 if (privcmd_vma_range_is_mapped(vma, m.addr, nr_pages)) { in privcmd_ioctl_mmap_batch()
586 struct page *pages[], unsigned int nr_pages) in lock_pages() argument
597 if (requested > nr_pages) in lock_pages()
[all …]
Dxlate_mmu.c223 unsigned long nr_pages; in xen_xlate_map_ballooned_pages() local
226 nr_pages = DIV_ROUND_UP(nr_grant_frames, XEN_PFN_PER_PAGE); in xen_xlate_map_ballooned_pages()
227 pages = kcalloc(nr_pages, sizeof(pages[0]), GFP_KERNEL); in xen_xlate_map_ballooned_pages()
236 rc = alloc_xenballooned_pages(nr_pages, pages); in xen_xlate_map_ballooned_pages()
239 nr_pages, rc); in xen_xlate_map_ballooned_pages()
249 vaddr = vmap(pages, nr_pages, 0, PAGE_KERNEL); in xen_xlate_map_ballooned_pages()
252 nr_pages, rc); in xen_xlate_map_ballooned_pages()
253 free_xenballooned_pages(nr_pages, pages); in xen_xlate_map_ballooned_pages()
/drivers/net/ethernet/ibm/ehea/
Dehea_qmr.c107 int i, nr_pages; in hw_queue_dtor() local
114 nr_pages = queue->queue_length / queue->pagesize; in hw_queue_dtor()
116 for (i = 0; i < nr_pages; i += pages_per_kpage) in hw_queue_dtor()
153 ret = hw_queue_ctor(&cq->hw_queue, cq->attr.nr_pages, in ehea_create_cq()
158 for (counter = 0; counter < cq->attr.nr_pages; counter++) { in ehea_create_cq()
171 cq, hret, counter, cq->attr.nr_pages); in ehea_create_cq()
175 if (counter == (cq->attr.nr_pages - 1)) { in ehea_create_cq()
275 ret = hw_queue_ctor(&eq->hw_queue, eq->attr.nr_pages, in ehea_create_eq()
282 for (i = 0; i < eq->attr.nr_pages; i++) { in ehea_create_eq()
296 if (i == (eq->attr.nr_pages - 1)) { in ehea_create_eq()
[all …]
/drivers/staging/android/ion/
Dion_cma_heap.c44 unsigned long nr_pages = size >> PAGE_SHIFT; in ion_cma_allocate() local
51 pages = cma_alloc(cma_heap->cma, nr_pages, align, GFP_KERNEL); in ion_cma_allocate()
56 unsigned long nr_clear_pages = nr_pages; in ion_cma_allocate()
88 cma_release(cma_heap->cma, pages, nr_pages); in ion_cma_allocate()
96 unsigned long nr_pages = PAGE_ALIGN(buffer->size) >> PAGE_SHIFT; in ion_cma_free() local
99 cma_release(cma_heap->cma, pages, nr_pages); in ion_cma_free()
/drivers/misc/genwqe/
Dcard_utils.c306 sgl->nr_pages = DIV_ROUND_UP(sgl->fpage_offs + user_size, PAGE_SIZE); in genwqe_alloc_sync_sgl()
310 __func__, user_addr, user_size, sgl->nr_pages, in genwqe_alloc_sync_sgl()
315 sgl->sgl_size = genwqe_sgl_size(sgl->nr_pages); in genwqe_alloc_sync_sgl()
394 while (p < sgl->nr_pages) { in genwqe_setup_sgl()
412 } else if ((p == sgl->nr_pages - 1) && in genwqe_setup_sgl()
433 if (p == sgl->nr_pages) in genwqe_setup_sgl()
449 if (p == sgl->nr_pages) in genwqe_setup_sgl()
531 static int free_user_pages(struct page **page_list, unsigned int nr_pages, in free_user_pages() argument
536 for (i = 0; i < nr_pages; i++) { in free_user_pages()
590 m->nr_pages = DIV_ROUND_UP(offs + size, PAGE_SIZE); in genwqe_user_vmap()
[all …]
/drivers/media/pci/cx23885/
Dcx23885-alsa.c80 static int cx23885_alsa_dma_init(struct cx23885_audio_dev *chip, int nr_pages) in cx23885_alsa_dma_init() argument
86 buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); in cx23885_alsa_dma_init()
88 dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages); in cx23885_alsa_dma_init()
94 nr_pages << PAGE_SHIFT); in cx23885_alsa_dma_init()
96 memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT); in cx23885_alsa_dma_init()
97 buf->nr_pages = nr_pages; in cx23885_alsa_dma_init()
99 buf->sglist = vzalloc(buf->nr_pages * sizeof(*buf->sglist)); in cx23885_alsa_dma_init()
103 sg_init_table(buf->sglist, buf->nr_pages); in cx23885_alsa_dma_init()
104 for (i = 0; i < buf->nr_pages; i++) { in cx23885_alsa_dma_init()
126 buf->nr_pages, PCI_DMA_FROMDEVICE); in cx23885_alsa_dma_map()
/drivers/edac/
Die31200_edac.c462 unsigned long nr_pages; in ie31200_probe1() local
464 nr_pages = IE31200_PAGES(dimm_info[j][i].size, skl); in ie31200_probe1()
465 if (nr_pages == 0) in ie31200_probe1()
469 nr_pages = nr_pages / 2; in ie31200_probe1()
473 dimm->nr_pages = nr_pages; in ie31200_probe1()
474 edac_dbg(0, "set nr pages: 0x%lx\n", nr_pages); in ie31200_probe1()
485 dimm->nr_pages = nr_pages; in ie31200_probe1()
486 edac_dbg(0, "set nr pages: 0x%lx\n", nr_pages); in ie31200_probe1()
Dpasemi_edac.c157 dimm->nr_pages = 128 << (20 - PAGE_SHIFT); in pasemi_edac_init_csrows()
160 dimm->nr_pages = 256 << (20 - PAGE_SHIFT); in pasemi_edac_init_csrows()
164 dimm->nr_pages = 512 << (20 - PAGE_SHIFT); in pasemi_edac_init_csrows()
167 dimm->nr_pages = 1024 << (20 - PAGE_SHIFT); in pasemi_edac_init_csrows()
170 dimm->nr_pages = 2048 << (20 - PAGE_SHIFT); in pasemi_edac_init_csrows()
180 csrow->last_page = csrow->first_page + dimm->nr_pages - 1; in pasemi_edac_init_csrows()
181 last_page_in_mmc += dimm->nr_pages; in pasemi_edac_init_csrows()
Dcell_edac.c135 u32 nr_pages; in cell_edac_init_csrows() local
149 nr_pages = resource_size(&r) >> PAGE_SHIFT; in cell_edac_init_csrows()
150 csrow->last_page = csrow->first_page + nr_pages - 1; in cell_edac_init_csrows()
156 dimm->nr_pages = nr_pages / csrow->nr_channels; in cell_edac_init_csrows()
162 csrow->first_page, nr_pages); in cell_edac_init_csrows()
Di3200_edac.c392 unsigned long nr_pages; in i3200_probe1() local
398 nr_pages = drb_to_nr_pages(drbs, stacked, j, i); in i3200_probe1()
399 if (nr_pages == 0) in i3200_probe1()
403 stacked ? " (stacked)" : "", PAGES_TO_MiB(nr_pages)); in i3200_probe1()
405 dimm->nr_pages = nr_pages; in i3200_probe1()
406 dimm->grain = nr_pages << PAGE_SHIFT; in i3200_probe1()
Dedac_mc_sysfs.c187 u32 nr_pages = 0; in csrow_size_show() local
190 nr_pages += csrow->channels[i]->dimm->nr_pages; in csrow_size_show()
191 return sprintf(data, "%u\n", PAGES_TO_MiB(nr_pages)); in csrow_size_show()
392 if (!csrow->channels[idx]->dimm->nr_pages) in csrow_dev_is_visible()
417 int chan, nr_pages = 0; in nr_pages_per_csrow() local
420 nr_pages += csrow->channels[chan]->dimm->nr_pages; in nr_pages_per_csrow()
422 return nr_pages; in nr_pages_per_csrow()
550 return sprintf(data, "%u\n", PAGES_TO_MiB(dimm->nr_pages)); in dimmdev_size_show()
840 total_pages += dimm->nr_pages; in mci_size_mb_show()
990 if (!dimm->nr_pages) in edac_create_sysfs_mci_device()
[all …]
Dx38_edac.c373 unsigned long nr_pages; in x38_probe1() local
376 nr_pages = drb_to_nr_pages(drbs, stacked, in x38_probe1()
380 if (nr_pages == 0) in x38_probe1()
386 dimm->nr_pages = nr_pages / x38_channel_num; in x38_probe1()
387 dimm->grain = nr_pages << PAGE_SHIFT; in x38_probe1()
/drivers/firmware/efi/libstub/
Defi-stub-helper.c180 unsigned long nr_pages; in efi_high_alloc() local
206 nr_pages = size / EFI_PAGE_SIZE; in efi_high_alloc()
217 if (desc->num_pages < nr_pages) in efi_high_alloc()
250 nr_pages, &max_addr); in efi_high_alloc()
275 unsigned long nr_pages; in efi_low_alloc() local
300 nr_pages = size / EFI_PAGE_SIZE; in efi_low_alloc()
311 if (desc->num_pages < nr_pages) in efi_low_alloc()
331 nr_pages, &start); in efi_low_alloc()
349 unsigned long nr_pages; in efi_free() local
354 nr_pages = round_up(size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE; in efi_free()
[all …]
/drivers/hwtracing/intel_th/
Dmsu.c117 unsigned long nr_pages; member
511 reg = msc->nr_pages; in msc_configure()
564 msc->single_sz = reg & ((msc->nr_pages << PAGE_SHIFT) - 1); in msc_disable()
630 unsigned long nr_pages = size >> PAGE_SHIFT; in msc_buffer_contig_alloc() local
655 msc->nr_pages = nr_pages; in msc_buffer_contig_alloc()
683 for (off = 0; off < msc->nr_pages << PAGE_SHIFT; off += PAGE_SIZE) { in msc_buffer_contig_free()
690 msc->nr_pages = 0; in msc_buffer_contig_free()
703 if (pgoff >= msc->nr_pages) in msc_buffer_contig_get_page()
763 msc->nr_pages += nr_blocks; in msc_buffer_win_alloc()
793 msc->nr_pages -= win->nr_blocks; in msc_buffer_win_free()
[all …]
/drivers/s390/char/
Dvmcp.c62 int nr_pages, order; in vmcp_response_alloc() local
65 nr_pages = ALIGN(session->bufsize, PAGE_SIZE) >> PAGE_SHIFT; in vmcp_response_alloc()
72 page = cma_alloc(vmcp_cma, nr_pages, 0, GFP_KERNEL); in vmcp_response_alloc()
83 int nr_pages, order; in vmcp_response_free() local
89 nr_pages = ALIGN(session->bufsize, PAGE_SIZE) >> PAGE_SHIFT; in vmcp_response_free()
92 cma_release(vmcp_cma, page, nr_pages); in vmcp_response_free()
/drivers/media/pci/cx25821/
Dcx25821-alsa.c66 int nr_pages; member
143 static int cx25821_alsa_dma_init(struct cx25821_audio_dev *chip, int nr_pages) in cx25821_alsa_dma_init() argument
149 buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); in cx25821_alsa_dma_init()
151 dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages); in cx25821_alsa_dma_init()
157 nr_pages << PAGE_SHIFT); in cx25821_alsa_dma_init()
159 memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT); in cx25821_alsa_dma_init()
160 buf->nr_pages = nr_pages; in cx25821_alsa_dma_init()
162 buf->sglist = vzalloc(buf->nr_pages * sizeof(*buf->sglist)); in cx25821_alsa_dma_init()
166 sg_init_table(buf->sglist, buf->nr_pages); in cx25821_alsa_dma_init()
167 for (i = 0; i < buf->nr_pages; i++) { in cx25821_alsa_dma_init()
[all …]
/drivers/base/
Dmemory.c233 unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; in memory_block_action() local
243 ret = online_pages(start_pfn, nr_pages, online_type); in memory_block_action()
246 ret = offline_pages(start_pfn, nr_pages); in memory_block_action()
393 unsigned long nr_pages, int online_type, in print_allowed_zone() argument
398 zone = zone_for_pfn_range(online_type, nid, start_pfn, nr_pages); in print_allowed_zone()
410 unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; in show_valid_zones() local
419 if (!test_pages_in_a_zone(start_pfn, start_pfn + nr_pages, &valid_start_pfn, &valid_end_pfn)) in show_valid_zones()
423 nr_pages = valid_end_pfn - start_pfn; in show_valid_zones()
435 default_zone = zone_for_pfn_range(MMOP_ONLINE_KEEP, nid, start_pfn, nr_pages); in show_valid_zones()
438 print_allowed_zone(buf, nid, start_pfn, nr_pages, MMOP_ONLINE_KERNEL, in show_valid_zones()
[all …]
/drivers/xen/xenbus/
Dxenbus_client.c362 unsigned int nr_pages, grant_ref_t *grefs) in xenbus_grant_ring() argument
367 for (i = 0; i < nr_pages; i++) { in xenbus_grant_ring()
557 unsigned int nr_pages = XENBUS_PAGES(nr_grefs); in xenbus_map_ring_valloc_hvm() local
568 err = alloc_xenballooned_pages(nr_pages, node->hvm.pages); in xenbus_map_ring_valloc_hvm()
583 addr = vmap(node->hvm.pages, nr_pages, VM_MAP | VM_IOREMAP, in xenbus_map_ring_valloc_hvm()
604 addr, nr_pages); in xenbus_map_ring_valloc_hvm()
607 free_xenballooned_pages(nr_pages, node->hvm.pages); in xenbus_map_ring_valloc_hvm()
824 unsigned int nr_pages; in xenbus_unmap_ring_vfree_hvm() local
844 nr_pages = XENBUS_PAGES(node->nr_handles); in xenbus_unmap_ring_vfree_hvm()
854 free_xenballooned_pages(nr_pages, node->hvm.pages); in xenbus_unmap_ring_vfree_hvm()
[all …]
/drivers/media/pci/cx88/
Dcx88-alsa.c59 int nr_pages; member
283 static int cx88_alsa_dma_init(struct cx88_audio_dev *chip, int nr_pages) in cx88_alsa_dma_init() argument
289 buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); in cx88_alsa_dma_init()
291 dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages); in cx88_alsa_dma_init()
296 (unsigned long)buf->vaddr, nr_pages << PAGE_SHIFT); in cx88_alsa_dma_init()
298 memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT); in cx88_alsa_dma_init()
299 buf->nr_pages = nr_pages; in cx88_alsa_dma_init()
301 buf->sglist = vzalloc(buf->nr_pages * sizeof(*buf->sglist)); in cx88_alsa_dma_init()
305 sg_init_table(buf->sglist, buf->nr_pages); in cx88_alsa_dma_init()
306 for (i = 0; i < buf->nr_pages; i++) { in cx88_alsa_dma_init()
[all …]

12345