/drivers/media/v4l2-core/ |
D | videobuf-dma-sg.c | 63 int nr_pages) in videobuf_vmalloc_to_sg() argument 69 sglist = vzalloc(array_size(nr_pages, sizeof(*sglist))); in videobuf_vmalloc_to_sg() 72 sg_init_table(sglist, nr_pages); in videobuf_vmalloc_to_sg() 73 for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { in videobuf_vmalloc_to_sg() 93 int nr_pages, int offset, size_t size) in videobuf_pages_to_sg() argument 100 sglist = vmalloc(array_size(nr_pages, sizeof(*sglist))); in videobuf_pages_to_sg() 103 sg_init_table(sglist, nr_pages); in videobuf_pages_to_sg() 111 for (i = 1; i < nr_pages; i++) { in videobuf_pages_to_sg() 174 dma->nr_pages = last-first+1; in videobuf_dma_init_user_locked() 175 dma->pages = kmalloc_array(dma->nr_pages, sizeof(struct page *), in videobuf_dma_init_user_locked() [all …]
|
/drivers/dma-buf/heaps/ |
D | deferred-free-helper.c | 28 size_t nr_pages) in deferred_free() argument 33 item->nr_pages = nr_pages; in deferred_free() 38 list_nr_pages += nr_pages; in deferred_free() 47 size_t nr_pages; in free_one_item() local 57 nr_pages = item->nr_pages; in free_one_item() 58 list_nr_pages -= nr_pages; in free_one_item() 62 return nr_pages; in free_one_item() 67 unsigned long nr_pages; in get_freelist_nr_pages() local 71 nr_pages = list_nr_pages; in get_freelist_nr_pages() 73 return nr_pages; in get_freelist_nr_pages()
|
/drivers/xen/ |
D | balloon.c | 404 static enum bp_state increase_reservation(unsigned long nr_pages) in increase_reservation() argument 410 if (nr_pages > ARRAY_SIZE(frame_list)) in increase_reservation() 411 nr_pages = ARRAY_SIZE(frame_list); in increase_reservation() 414 for (i = 0; i < nr_pages; i++) { in increase_reservation() 416 nr_pages = i; in increase_reservation() 424 rc = xenmem_reservation_increase(nr_pages, frame_list); in increase_reservation() 443 static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) in decrease_reservation() argument 451 if (nr_pages > ARRAY_SIZE(frame_list)) in decrease_reservation() 452 nr_pages = ARRAY_SIZE(frame_list); in decrease_reservation() 454 for (i = 0; i < nr_pages; i++) { in decrease_reservation() [all …]
|
D | unpopulated-alloc.c | 34 static int fill_list(unsigned int nr_pages) in fill_list() argument 39 unsigned int i, alloc_pages = round_up(nr_pages, PAGES_PER_SECTION); in fill_list() 158 int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages) in xen_alloc_unpopulated_pages() argument 169 return xen_alloc_ballooned_pages(nr_pages, pages); in xen_alloc_unpopulated_pages() 172 if (list_count < nr_pages) { in xen_alloc_unpopulated_pages() 173 ret = fill_list(nr_pages - list_count); in xen_alloc_unpopulated_pages() 178 for (i = 0; i < nr_pages; i++) { in xen_alloc_unpopulated_pages() 214 void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages) in xen_free_unpopulated_pages() argument 219 xen_free_ballooned_pages(nr_pages, pages); in xen_free_unpopulated_pages() 224 for (i = 0; i < nr_pages; i++) { in xen_free_unpopulated_pages()
|
D | privcmd.c | 65 unsigned long nr_pages); 450 unsigned long nr_pages; in privcmd_ioctl_mmap_batch() local 478 nr_pages = DIV_ROUND_UP(m.num, XEN_PFN_PER_PAGE); in privcmd_ioctl_mmap_batch() 479 if ((m.num <= 0) || (nr_pages > (LONG_MAX >> PAGE_SHIFT))) in privcmd_ioctl_mmap_batch() 521 m.addr + (nr_pages << PAGE_SHIFT) != vma->vm_end) { in privcmd_ioctl_mmap_batch() 526 ret = alloc_empty_pages(vma, nr_pages); in privcmd_ioctl_mmap_batch() 533 m.addr + (nr_pages << PAGE_SHIFT) > vma->vm_end) { in privcmd_ioctl_mmap_batch() 537 if (privcmd_vma_range_is_mapped(vma, m.addr, nr_pages)) { in privcmd_ioctl_mmap_batch() 582 struct page *pages[], unsigned int nr_pages, unsigned int *pinned) in lock_pages() argument 593 if (requested > nr_pages) in lock_pages() [all …]
|
D | xlate_mmu.c | 222 unsigned long nr_pages; in xen_xlate_map_ballooned_pages() local 225 nr_pages = DIV_ROUND_UP(nr_grant_frames, XEN_PFN_PER_PAGE); in xen_xlate_map_ballooned_pages() 226 pages = kcalloc(nr_pages, sizeof(pages[0]), GFP_KERNEL); in xen_xlate_map_ballooned_pages() 235 rc = xen_alloc_unpopulated_pages(nr_pages, pages); in xen_xlate_map_ballooned_pages() 238 nr_pages, rc); in xen_xlate_map_ballooned_pages() 248 vaddr = vmap(pages, nr_pages, 0, PAGE_KERNEL); in xen_xlate_map_ballooned_pages() 251 nr_pages, rc); in xen_xlate_map_ballooned_pages() 252 xen_free_unpopulated_pages(nr_pages, pages); in xen_xlate_map_ballooned_pages()
|
D | grant-table.c | 865 int gnttab_pages_set_private(int nr_pages, struct page **pages) in gnttab_pages_set_private() argument 869 for (i = 0; i < nr_pages; i++) { in gnttab_pages_set_private() 891 int gnttab_alloc_pages(int nr_pages, struct page **pages) in gnttab_alloc_pages() argument 895 ret = xen_alloc_unpopulated_pages(nr_pages, pages); in gnttab_alloc_pages() 899 ret = gnttab_pages_set_private(nr_pages, pages); in gnttab_alloc_pages() 901 gnttab_free_pages(nr_pages, pages); in gnttab_alloc_pages() 1030 void gnttab_pages_clear_private(int nr_pages, struct page **pages) in gnttab_pages_clear_private() argument 1034 for (i = 0; i < nr_pages; i++) { in gnttab_pages_clear_private() 1050 void gnttab_free_pages(int nr_pages, struct page **pages) in gnttab_free_pages() argument 1052 gnttab_pages_clear_private(nr_pages, pages); in gnttab_free_pages() [all …]
|
/drivers/firmware/efi/libstub/ |
D | relocate.c | 28 unsigned long nr_pages; in efi_low_alloc_above() local 45 nr_pages = size / EFI_PAGE_SIZE; in efi_low_alloc_above() 60 if (desc->num_pages < nr_pages) in efi_low_alloc_above() 74 EFI_LOADER_DATA, nr_pages, &start); in efi_low_alloc_above() 120 unsigned long nr_pages; in efi_relocate_kernel() local 138 nr_pages = round_up(alloc_size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE; in efi_relocate_kernel() 140 EFI_LOADER_DATA, nr_pages, &efi_addr); in efi_relocate_kernel()
|
/drivers/misc/bcm-vk/ |
D | bcm_vk_sg.c | 60 dma->nr_pages = last - first + 1; in bcm_vk_dma_alloc() 63 dma->pages = kmalloc_array(dma->nr_pages, in bcm_vk_dma_alloc() 70 data, vkdata->size, dma->nr_pages); in bcm_vk_dma_alloc() 76 dma->nr_pages, in bcm_vk_dma_alloc() 79 if (err != dma->nr_pages) { in bcm_vk_dma_alloc() 80 dma->nr_pages = (err >= 0) ? err : 0; in bcm_vk_dma_alloc() 82 err, dma->nr_pages); in bcm_vk_dma_alloc() 87 dma->sglen = (dma->nr_pages * sizeof(*sgdata)) + in bcm_vk_dma_alloc() 117 for (i = 1; i < dma->nr_pages; i++) { in bcm_vk_dma_alloc() 250 for (i = 0; i < dma->nr_pages; i++) in bcm_vk_dma_free()
|
/drivers/hwtracing/coresight/ |
D | coresight-tmc-etr.c | 43 int nr_pages; member 49 ((idx) % ((unsigned long)(buf)->nr_pages << PAGE_SHIFT)) 121 tmc_etr_sg_table_entries(int nr_pages) in tmc_etr_sg_table_entries() argument 123 unsigned long nr_sgpages = nr_pages * ETR_SG_PAGES_PER_SYSPAGE; in tmc_etr_sg_table_entries() 146 for (i = 0; i < tmc_pages->nr_pages; i++) { in tmc_pages_get_offset() 166 for (i = 0; i < tmc_pages->nr_pages; i++) { in tmc_pages_free() 178 tmc_pages->nr_pages = 0; in tmc_pages_free() 193 int i, nr_pages; in tmc_pages_alloc() local 198 nr_pages = tmc_pages->nr_pages; in tmc_pages_alloc() 199 tmc_pages->daddrs = kcalloc(nr_pages, sizeof(*tmc_pages->daddrs), in tmc_pages_alloc() [all …]
|
/drivers/net/ethernet/ibm/ehea/ |
D | ehea_qmr.c | 93 int i, nr_pages; in hw_queue_dtor() local 100 nr_pages = queue->queue_length / queue->pagesize; in hw_queue_dtor() 102 for (i = 0; i < nr_pages; i += pages_per_kpage) in hw_queue_dtor() 134 ret = hw_queue_ctor(&cq->hw_queue, cq->attr.nr_pages, in ehea_create_cq() 139 for (counter = 0; counter < cq->attr.nr_pages; counter++) { in ehea_create_cq() 152 cq, hret, counter, cq->attr.nr_pages); in ehea_create_cq() 156 if (counter == (cq->attr.nr_pages - 1)) { in ehea_create_cq() 255 ret = hw_queue_ctor(&eq->hw_queue, eq->attr.nr_pages, in ehea_create_eq() 262 for (i = 0; i < eq->attr.nr_pages; i++) { in ehea_create_eq() 276 if (i == (eq->attr.nr_pages - 1)) { in ehea_create_eq() [all …]
|
/drivers/xen/xenbus/ |
D | xenbus_client.c | 380 unsigned int nr_pages, grant_ref_t *grefs) in xenbus_setup_ring() argument 382 unsigned long ring_size = nr_pages * XEN_PAGE_SIZE; in xenbus_setup_ring() 394 ret = gnttab_alloc_grant_references(nr_pages, &gref_head); in xenbus_setup_ring() 397 nr_pages); in xenbus_setup_ring() 401 for (i = 0; i < nr_pages; i++) { in xenbus_setup_ring() 421 for (i = 0; i < nr_pages; i++) in xenbus_setup_ring() 438 void xenbus_teardown_ring(void **vaddr, unsigned int nr_pages, in xenbus_teardown_ring() argument 443 for (i = 0; i < nr_pages; i++) { in xenbus_teardown_ring() 451 free_pages_exact(*vaddr, nr_pages * XEN_PAGE_SIZE); in xenbus_teardown_ring() 666 unsigned int nr_pages = XENBUS_PAGES(nr_grefs); in xenbus_map_ring_hvm() local [all …]
|
/drivers/media/pci/cx23885/ |
D | cx23885-alsa.c | 72 unsigned long nr_pages) in cx23885_alsa_dma_init() argument 78 buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); in cx23885_alsa_dma_init() 80 dprintk(1, "vmalloc_32(%lu pages) failed\n", nr_pages); in cx23885_alsa_dma_init() 85 buf->vaddr, nr_pages << PAGE_SHIFT); in cx23885_alsa_dma_init() 87 memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT); in cx23885_alsa_dma_init() 88 buf->nr_pages = nr_pages; in cx23885_alsa_dma_init() 90 buf->sglist = vzalloc(array_size(sizeof(*buf->sglist), buf->nr_pages)); in cx23885_alsa_dma_init() 94 sg_init_table(buf->sglist, buf->nr_pages); in cx23885_alsa_dma_init() 95 for (i = 0; i < buf->nr_pages; i++) { in cx23885_alsa_dma_init() 117 buf->nr_pages, DMA_FROM_DEVICE); in cx23885_alsa_dma_map() [all …]
|
/drivers/misc/genwqe/ |
D | card_utils.c | 299 sgl->nr_pages = DIV_ROUND_UP(sgl->fpage_offs + user_size, PAGE_SIZE); in genwqe_alloc_sync_sgl() 303 __func__, user_addr, user_size, sgl->nr_pages, in genwqe_alloc_sync_sgl() 309 sgl->sgl_size = genwqe_sgl_size(sgl->nr_pages); in genwqe_alloc_sync_sgl() 388 while (p < sgl->nr_pages) { in genwqe_setup_sgl() 406 } else if ((p == sgl->nr_pages - 1) && in genwqe_setup_sgl() 427 if (p == sgl->nr_pages) in genwqe_setup_sgl() 443 if (p == sgl->nr_pages) in genwqe_setup_sgl() 566 m->nr_pages = DIV_ROUND_UP(offs + size, PAGE_SIZE); in genwqe_user_vmap() 568 m->page_list = kcalloc(m->nr_pages, in genwqe_user_vmap() 573 m->nr_pages = 0; in genwqe_user_vmap() [all …]
|
/drivers/virt/acrn/ |
D | mm.c | 158 int nr_pages, i = 0, order, nr_regions = 0; in acrn_vm_ram_map() local 194 nr_pages = memmap->len >> PAGE_SHIFT; in acrn_vm_ram_map() 195 pages = vzalloc(array_size(nr_pages, sizeof(*pages))); in acrn_vm_ram_map() 201 nr_pages, FOLL_WRITE | FOLL_LONGTERM, in acrn_vm_ram_map() 206 } else if (pinned != nr_pages) { in acrn_vm_ram_map() 212 remap_vaddr = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL); in acrn_vm_ram_map() 223 region_mapping->npages = nr_pages; in acrn_vm_ram_map() 238 while (i < nr_pages) { in acrn_vm_ram_map() 261 while (i < nr_pages) { in acrn_vm_ram_map()
|
/drivers/edac/ |
D | pasemi_edac.c | 145 dimm->nr_pages = 128 << (20 - PAGE_SHIFT); in pasemi_edac_init_csrows() 148 dimm->nr_pages = 256 << (20 - PAGE_SHIFT); in pasemi_edac_init_csrows() 152 dimm->nr_pages = 512 << (20 - PAGE_SHIFT); in pasemi_edac_init_csrows() 155 dimm->nr_pages = 1024 << (20 - PAGE_SHIFT); in pasemi_edac_init_csrows() 158 dimm->nr_pages = 2048 << (20 - PAGE_SHIFT); in pasemi_edac_init_csrows() 168 csrow->last_page = csrow->first_page + dimm->nr_pages - 1; in pasemi_edac_init_csrows() 169 last_page_in_mmc += dimm->nr_pages; in pasemi_edac_init_csrows()
|
D | ie31200_edac.c | 494 unsigned long nr_pages; in ie31200_probe1() local 496 nr_pages = IE31200_PAGES(dimm_info[j][i].size, skl); in ie31200_probe1() 497 if (nr_pages == 0) in ie31200_probe1() 501 nr_pages = nr_pages / 2; in ie31200_probe1() 503 dimm->nr_pages = nr_pages; in ie31200_probe1() 504 edac_dbg(0, "set nr pages: 0x%lx\n", nr_pages); in ie31200_probe1() 514 dimm->nr_pages = nr_pages; in ie31200_probe1() 515 edac_dbg(0, "set nr pages: 0x%lx\n", nr_pages); in ie31200_probe1()
|
D | ghes_edac.c | 122 dimm->nr_pages = MiB_TO_PAGES(32);/* Unknown */ in assign_dmi_dimm_info() 124 dimm->nr_pages = MiB_TO_PAGES(entry->extended_size); in assign_dmi_dimm_info() 127 dimm->nr_pages = MiB_TO_PAGES((entry->size & 0x7fff) << 10); in assign_dmi_dimm_info() 129 dimm->nr_pages = MiB_TO_PAGES(entry->size); in assign_dmi_dimm_info() 191 if (dimm->nr_pages) { in assign_dmi_dimm_info() 194 PAGES_TO_MiB(dimm->nr_pages), in assign_dmi_dimm_info() 468 dst->nr_pages = src->nr_pages; in ghes_edac_register() 487 dimm->nr_pages = 1; in ghes_edac_register()
|
D | i3200_edac.c | 391 unsigned long nr_pages; in i3200_probe1() local 396 nr_pages = drb_to_nr_pages(drbs, stacked, j, i); in i3200_probe1() 397 if (nr_pages == 0) in i3200_probe1() 401 stacked ? " (stacked)" : "", PAGES_TO_MiB(nr_pages)); in i3200_probe1() 403 dimm->nr_pages = nr_pages; in i3200_probe1() 404 dimm->grain = nr_pages << PAGE_SHIFT; in i3200_probe1()
|
D | cell_edac.c | 135 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()
|
/drivers/virtio/ |
D | virtio_mem.c | 273 unsigned long nr_pages); 275 unsigned long nr_pages); 889 const unsigned long nr_pages = PFN_DOWN(vm->sbm.sb_size); in virtio_mem_sbm_notify_going_offline() local 898 virtio_mem_fake_offline_going_offline(pfn, nr_pages); in virtio_mem_sbm_notify_going_offline() 905 const unsigned long nr_pages = PFN_DOWN(vm->sbm.sb_size); in virtio_mem_sbm_notify_cancel_offline() local 914 virtio_mem_fake_offline_cancel_offline(pfn, nr_pages); in virtio_mem_sbm_notify_cancel_offline() 921 unsigned long nr_pages) in virtio_mem_bbm_notify_going_offline() argument 930 virtio_mem_fake_offline_going_offline(pfn, nr_pages); in virtio_mem_bbm_notify_going_offline() 936 unsigned long nr_pages) in virtio_mem_bbm_notify_cancel_offline() argument 941 virtio_mem_fake_offline_cancel_offline(pfn, nr_pages); in virtio_mem_bbm_notify_cancel_offline() [all …]
|
/drivers/media/pci/cx25821/ |
D | cx25821-alsa.c | 57 unsigned long nr_pages; member 134 unsigned long nr_pages) in cx25821_alsa_dma_init() argument 140 buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); in cx25821_alsa_dma_init() 142 dprintk(1, "vmalloc_32(%lu pages) failed\n", nr_pages); in cx25821_alsa_dma_init() 148 nr_pages << PAGE_SHIFT); in cx25821_alsa_dma_init() 150 memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT); in cx25821_alsa_dma_init() 151 buf->nr_pages = nr_pages; in cx25821_alsa_dma_init() 153 buf->sglist = vzalloc(array_size(sizeof(*buf->sglist), buf->nr_pages)); in cx25821_alsa_dma_init() 157 sg_init_table(buf->sglist, buf->nr_pages); in cx25821_alsa_dma_init() 158 for (i = 0; i < buf->nr_pages; i++) { in cx25821_alsa_dma_init() [all …]
|
/drivers/s390/char/ |
D | vmcp.c | 63 int nr_pages, order; in vmcp_response_alloc() local 66 nr_pages = ALIGN(session->bufsize, PAGE_SIZE) >> PAGE_SHIFT; in vmcp_response_alloc() 73 page = cma_alloc(vmcp_cma, nr_pages, 0, false); in vmcp_response_alloc() 84 int nr_pages, order; in vmcp_response_free() local 90 nr_pages = ALIGN(session->bufsize, PAGE_SIZE) >> PAGE_SHIFT; in vmcp_response_free() 93 cma_release(vmcp_cma, page, nr_pages); in vmcp_response_free()
|
/drivers/base/ |
D | memory.c | 184 unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; in memory_block_online() local 190 start_pfn, nr_pages); in memory_block_online() 207 nr_pages - nr_vmemmap_pages, zone, mem->group); in memory_block_online() 234 unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; in memory_block_offline() local 251 nr_pages - nr_vmemmap_pages, mem->zone, mem->group); in memory_block_offline() 402 unsigned long start_pfn, unsigned long nr_pages, in print_allowed_zone() argument 407 zone = zone_for_pfn_range(online_type, nid, group, start_pfn, nr_pages); in print_allowed_zone() 419 unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; in valid_zones_show() local 442 start_pfn, nr_pages); in valid_zones_show() 445 len += print_allowed_zone(buf, len, nid, group, start_pfn, nr_pages, in valid_zones_show() [all …]
|
/drivers/media/pci/cx88/ |
D | cx88-alsa.c | 50 unsigned long nr_pages; member 274 unsigned long nr_pages) in cx88_alsa_dma_init() argument 280 buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); in cx88_alsa_dma_init() 282 dprintk(1, "vmalloc_32(%lu pages) failed\n", nr_pages); in cx88_alsa_dma_init() 287 buf->vaddr, nr_pages << PAGE_SHIFT); in cx88_alsa_dma_init() 289 memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT); in cx88_alsa_dma_init() 290 buf->nr_pages = nr_pages; in cx88_alsa_dma_init() 292 buf->sglist = vzalloc(array_size(sizeof(*buf->sglist), buf->nr_pages)); in cx88_alsa_dma_init() 296 sg_init_table(buf->sglist, buf->nr_pages); in cx88_alsa_dma_init() 297 for (i = 0; i < buf->nr_pages; i++) { in cx88_alsa_dma_init() [all …]
|