/drivers/media/v4l2-core/ |
D | videobuf-dma-sg.c | 66 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/xen/ |
D | balloon.c | 327 static enum bp_state increase_reservation(unsigned long nr_pages) in increase_reservation() argument 340 nr_pages = min(nr_pages, balloon_stats.balloon_hotplug); in increase_reservation() 341 balloon_stats.hotplug_pages += nr_pages; in increase_reservation() 342 balloon_stats.balloon_hotplug -= nr_pages; in increase_reservation() 347 if (nr_pages > ARRAY_SIZE(frame_list)) in increase_reservation() 348 nr_pages = ARRAY_SIZE(frame_list); in increase_reservation() 351 for (i = 0; i < nr_pages; i++) { in increase_reservation() 353 nr_pages = i; in increase_reservation() 361 reservation.nr_extents = nr_pages; in increase_reservation() 397 static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) in decrease_reservation() argument [all …]
|
D | privcmd.c | 49 unsigned long nr_pages); 378 unsigned long nr_pages; in privcmd_ioctl_mmap_batch() local 402 nr_pages = m.num; in privcmd_ioctl_mmap_batch() 403 if ((m.num <= 0) || (nr_pages > (LONG_MAX >> PAGE_SHIFT))) in privcmd_ioctl_mmap_batch() 445 m.addr + (nr_pages << PAGE_SHIFT) != vma->vm_end) { in privcmd_ioctl_mmap_batch() 457 m.addr + (nr_pages << PAGE_SHIFT) > vma->vm_end) { in privcmd_ioctl_mmap_batch() 461 if (privcmd_vma_range_is_mapped(vma, m.addr, nr_pages)) { in privcmd_ioctl_mmap_batch() 592 unsigned long nr_pages) in privcmd_vma_range_is_mapped() argument 594 return apply_to_page_range(vma->vm_mm, addr, nr_pages << PAGE_SHIFT, in privcmd_vma_range_is_mapped()
|
/drivers/gpu/drm/radeon/ |
D | drm_buffer.c | 46 int nr_pages = size / PAGE_SIZE + 1; in drm_buffer_alloc() local 51 *buf = kzalloc(sizeof(struct drm_buffer) + nr_pages*sizeof(char *), in drm_buffer_alloc() 57 size, nr_pages); in drm_buffer_alloc() 63 for (idx = 0; idx < nr_pages; ++idx) { in drm_buffer_alloc() 73 idx + 1, size, nr_pages); in drm_buffer_alloc() 100 int nr_pages = size / PAGE_SIZE + 1; in drm_buffer_copy_from_user() local 110 for (idx = 0; idx < nr_pages; ++idx) { in drm_buffer_copy_from_user() 134 int nr_pages = buf->size / PAGE_SIZE + 1; in drm_buffer_free() local 136 for (idx = 0; idx < nr_pages; ++idx) in drm_buffer_free()
|
/drivers/net/ethernet/ibm/ehea/ |
D | ehea_qmr.c | 107 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/firmware/efi/libstub/ |
D | efi-stub-helper.c | 148 unsigned long nr_pages; in efi_high_alloc() local 165 nr_pages = round_up(size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE; in efi_high_alloc() 176 if (desc->num_pages < nr_pages) in efi_high_alloc() 209 nr_pages, &max_addr); in efi_high_alloc() 234 unsigned long nr_pages; in efi_low_alloc() local 250 nr_pages = round_up(size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE; in efi_low_alloc() 261 if (desc->num_pages < nr_pages) in efi_low_alloc() 281 nr_pages, &start); in efi_low_alloc() 299 unsigned long nr_pages; in efi_free() local 304 nr_pages = round_up(size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE; in efi_free() [all …]
|
/drivers/misc/genwqe/ |
D | card_utils.c | 305 sgl->nr_pages = DIV_ROUND_UP(sgl->fpage_offs + user_size, PAGE_SIZE); in genwqe_alloc_sync_sgl() 309 __func__, user_addr, user_size, sgl->nr_pages, in genwqe_alloc_sync_sgl() 314 sgl->sgl_size = genwqe_sgl_size(sgl->nr_pages); in genwqe_alloc_sync_sgl() 392 while (p < sgl->nr_pages) { in genwqe_setup_sgl() 410 } else if ((p == sgl->nr_pages - 1) && in genwqe_setup_sgl() 431 if (p == sgl->nr_pages) in genwqe_setup_sgl() 447 if (p == sgl->nr_pages) in genwqe_setup_sgl() 529 static int free_user_pages(struct page **page_list, unsigned int nr_pages, in free_user_pages() argument 534 for (i = 0; i < nr_pages; i++) { in free_user_pages() 584 m->nr_pages = DIV_ROUND_UP(offs + size, PAGE_SIZE); in genwqe_user_vmap() [all …]
|
/drivers/edac/ |
D | ie31200_edac.c | 406 unsigned long nr_pages; in ie31200_probe1() local 408 nr_pages = IE31200_PAGES(dimm_info[j][i].size); in ie31200_probe1() 409 if (nr_pages == 0) in ie31200_probe1() 413 nr_pages = nr_pages / 2; in ie31200_probe1() 417 dimm->nr_pages = nr_pages; in ie31200_probe1() 418 edac_dbg(0, "set nr pages: 0x%lx\n", nr_pages); in ie31200_probe1() 426 dimm->nr_pages = nr_pages; in ie31200_probe1() 427 edac_dbg(0, "set nr pages: 0x%lx\n", nr_pages); in ie31200_probe1()
|
D | pasemi_edac.c | 157 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()
|
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()
|
D | i3200_edac.c | 395 unsigned long nr_pages; in i3200_probe1() local 401 nr_pages = drb_to_nr_pages(drbs, stacked, j, i); in i3200_probe1() 402 if (nr_pages == 0) in i3200_probe1() 406 stacked ? " (stacked)" : "", PAGES_TO_MiB(nr_pages)); in i3200_probe1() 408 dimm->nr_pages = nr_pages; in i3200_probe1() 409 dimm->grain = nr_pages << PAGE_SHIFT; in i3200_probe1()
|
D | edac_mc_sysfs.c | 187 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() 361 int chan, nr_pages = 0; in nr_pages_per_csrow() local 364 nr_pages += csrow->channels[chan]->dimm->nr_pages; in nr_pages_per_csrow() 366 return nr_pages; in nr_pages_per_csrow() 395 if (!csrow->channels[chan]->dimm->nr_pages) in edac_create_csrow_object() 450 if (!csrow->channels[chan]->dimm->nr_pages) in edac_create_csrow_objects() 473 if (!csrow->channels[chan]->dimm->nr_pages) in edac_delete_csrow_objects() 535 return sprintf(data, "%u\n", PAGES_TO_MiB(dimm->nr_pages)); in dimmdev_size_show() [all …]
|
D | x38_edac.c | 376 unsigned long nr_pages; in x38_probe1() local 379 nr_pages = drb_to_nr_pages(drbs, stacked, in x38_probe1() 383 if (nr_pages == 0) in x38_probe1() 389 dimm->nr_pages = nr_pages / x38_channel_num; in x38_probe1() 390 dimm->grain = nr_pages << PAGE_SHIFT; in x38_probe1()
|
D | ghes_edac.c | 111 dimm->nr_pages = MiB_TO_PAGES(32);/* Unknown */ in ghes_edac_dmidecode() 113 dimm->nr_pages = MiB_TO_PAGES(entry->extended_size); in ghes_edac_dmidecode() 116 dimm->nr_pages = MiB_TO_PAGES((entry->size & in ghes_edac_dmidecode() 119 dimm->nr_pages = MiB_TO_PAGES(entry->size); in ghes_edac_dmidecode() 174 if (dimm->nr_pages) { in ghes_edac_dmidecode() 177 PAGES_TO_MiB(dimm->nr_pages), in ghes_edac_dmidecode() 512 dimm->nr_pages = 1; in ghes_edac_register()
|
D | edac_mc.c | 92 edac_dbg(4, " dimm->nr_pages = 0x%x\n", dimm->nr_pages); in edac_mc_dump_dimm() 94 edac_dbg(4, " dimm->nr_pages = 0x%x\n", dimm->nr_pages); in edac_mc_dump_dimm() 734 u32 nr_pages = 0; in edac_mc_add_mc() local 738 nr_pages += csrow->channels[j]->dimm->nr_pages; in edac_mc_add_mc() 739 if (!nr_pages) in edac_mc_add_mc() 743 if (csrow->channels[j]->dimm->nr_pages) in edac_mc_add_mc() 747 if (mci->dimms[i]->nr_pages) in edac_mc_add_mc() 890 n += dimm->nr_pages; in edac_mc_find_csrow_by_page() 1222 if (e->enable_per_layer_report && dimm->nr_pages) { in edac_mc_handle_error()
|
D | i82975x_edac.c | 376 u32 cumul_size, nr_pages; in i82975x_init_csrows() local 407 nr_pages = cumul_size - last_cumul_size; in i82975x_init_csrows() 408 if (!nr_pages) in i82975x_init_csrows() 421 dimm->nr_pages = nr_pages / csrow->nr_channels; in i82975x_init_csrows()
|
D | i3000_edac.c | 317 unsigned long last_cumul_size, nr_pages; in i3000_probe1() local 408 nr_pages = cumul_size - last_cumul_size; in i3000_probe1() 414 dimm->nr_pages = nr_pages / nr_channels; in i3000_probe1()
|
D | i82875p_edac.c | 351 u32 cumul_size, nr_pages; in i82875p_init_csrows() local 374 nr_pages = cumul_size - last_cumul_size; in i82875p_init_csrows() 380 dimm->nr_pages = nr_pages / nr_chans; in i82875p_init_csrows()
|
D | amd76x_edac.c | 211 dimm->nr_pages = (mba_mask + 1) >> PAGE_SHIFT; in amd76x_init_csrows() 212 csrow->last_page = csrow->first_page + dimm->nr_pages - 1; in amd76x_init_csrows() 214 dimm->grain = dimm->nr_pages << PAGE_SHIFT; in amd76x_init_csrows()
|
/drivers/media/pci/cx23885/ |
D | cx23885-alsa.c | 83 static int cx23885_alsa_dma_init(struct cx23885_audio_dev *chip, int nr_pages) in cx23885_alsa_dma_init() argument 89 buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); in cx23885_alsa_dma_init() 91 dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages); in cx23885_alsa_dma_init() 97 nr_pages << PAGE_SHIFT); in cx23885_alsa_dma_init() 99 memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT); in cx23885_alsa_dma_init() 100 buf->nr_pages = nr_pages; in cx23885_alsa_dma_init() 102 buf->sglist = vzalloc(buf->nr_pages * sizeof(*buf->sglist)); in cx23885_alsa_dma_init() 106 sg_init_table(buf->sglist, buf->nr_pages); in cx23885_alsa_dma_init() 107 for (i = 0; i < buf->nr_pages; i++) { in cx23885_alsa_dma_init() 129 buf->nr_pages, PCI_DMA_FROMDEVICE); in cx23885_alsa_dma_map()
|
/drivers/infiniband/hw/ehca/ |
D | ehca_eq.c | 59 u32 nr_pages; in ehca_create_eq() local 83 &nr_pages, &eq->ist); in ehca_create_eq() 90 ret = ipz_queue_ctor(NULL, &eq->ipz_queue, nr_pages, in ehca_create_eq() 97 for (i = 0; i < nr_pages; i++) { in ehca_create_eq() 110 if (i == (nr_pages - 1)) { in ehca_create_eq()
|
/drivers/gpu/drm/exynos/ |
D | exynos_drm_buf.c | 25 unsigned int nr_pages; in lowlevel_buffer_allocate() local 54 nr_pages = buf->size >> PAGE_SHIFT; in lowlevel_buffer_allocate() 60 buf->pages = drm_calloc_large(nr_pages, sizeof(struct page *)); in lowlevel_buffer_allocate() 77 while (i < nr_pages) { in lowlevel_buffer_allocate() 93 buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages); in lowlevel_buffer_allocate()
|
/drivers/media/common/saa7146/ |
D | saa7146_core.c | 149 static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) in vmalloc_to_sg() argument 155 sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL); in vmalloc_to_sg() 158 sg_init_table(sglist, nr_pages); in vmalloc_to_sg() 159 for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { in vmalloc_to_sg() 251 int nr_pages = 0; in saa7146_pgtable_build_single() local 270 nr_pages++; in saa7146_pgtable_build_single() 277 for(i=nr_pages;i<1024;i++) { in saa7146_pgtable_build_single()
|
/drivers/media/pci/saa7134/ |
D | saa7134-alsa.c | 278 static int saa7134_alsa_dma_init(struct saa7134_dev *dev, int nr_pages) in saa7134_alsa_dma_init() argument 284 dma->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); in saa7134_alsa_dma_init() 286 dprintk("vmalloc_32(%d pages) failed\n", nr_pages); in saa7134_alsa_dma_init() 292 nr_pages << PAGE_SHIFT); in saa7134_alsa_dma_init() 294 memset(dma->vaddr, 0, nr_pages << PAGE_SHIFT); in saa7134_alsa_dma_init() 295 dma->nr_pages = nr_pages; in saa7134_alsa_dma_init() 297 dma->sglist = vzalloc(dma->nr_pages * sizeof(*dma->sglist)); in saa7134_alsa_dma_init() 301 sg_init_table(dma->sglist, dma->nr_pages); in saa7134_alsa_dma_init() 302 for (i = 0; i < dma->nr_pages; i++) { in saa7134_alsa_dma_init() 324 dma->nr_pages, PCI_DMA_FROMDEVICE); in saa7134_alsa_dma_map()
|
/drivers/video/fbdev/ |
D | pvr2fb.c | 679 unsigned int nr_pages; in pvr2fb_write() local 683 nr_pages = (count + PAGE_SIZE - 1) >> PAGE_SHIFT; in pvr2fb_write() 685 pages = kmalloc(nr_pages * sizeof(struct page *), GFP_KERNEL); in pvr2fb_write() 691 nr_pages, WRITE, 0, pages, NULL); in pvr2fb_write() 694 if (ret < nr_pages) { in pvr2fb_write() 695 nr_pages = ret; in pvr2fb_write() 704 end = (unsigned long)page_address(pages[nr_pages]); in pvr2fb_write() 705 len = nr_pages << PAGE_SHIFT; in pvr2fb_write() 723 for (i = 0; i < nr_pages; i++, dst += PAGE_SIZE) { in pvr2fb_write() 739 for (i = 0; i < nr_pages; i++) in pvr2fb_write()
|