/drivers/android/ |
D | binder_alloc.c | 64 static size_t binder_alloc_buffer_size(struct binder_alloc *alloc, in binder_alloc_buffer_size() argument 67 if (list_is_last(&buffer->entry, &alloc->buffers)) in binder_alloc_buffer_size() 68 return (u8 *)alloc->buffer + in binder_alloc_buffer_size() 69 alloc->buffer_size - (u8 *)buffer->data; in binder_alloc_buffer_size() 73 static void binder_insert_free_buffer(struct binder_alloc *alloc, in binder_insert_free_buffer() argument 76 struct rb_node **p = &alloc->free_buffers.rb_node; in binder_insert_free_buffer() 84 new_buffer_size = binder_alloc_buffer_size(alloc, new_buffer); in binder_insert_free_buffer() 88 alloc->pid, new_buffer_size, new_buffer); in binder_insert_free_buffer() 95 buffer_size = binder_alloc_buffer_size(alloc, buffer); in binder_insert_free_buffer() 103 rb_insert_color(&new_buffer->rb_node, &alloc->free_buffers); in binder_insert_free_buffer() [all …]
|
D | binder_alloc_selftest.c | 101 static bool check_buffer_pages_allocated(struct binder_alloc *alloc, in check_buffer_pages_allocated() argument 111 page_index = (page_addr - alloc->buffer) / PAGE_SIZE; in check_buffer_pages_allocated() 112 if (!alloc->pages[page_index].page_ptr || in check_buffer_pages_allocated() 113 !list_empty(&alloc->pages[page_index].lru)) { in check_buffer_pages_allocated() 115 alloc->pages[page_index].page_ptr ? in check_buffer_pages_allocated() 123 static void binder_selftest_alloc_buf(struct binder_alloc *alloc, in binder_selftest_alloc_buf() argument 130 buffers[i] = binder_alloc_new_buf(alloc, sizes[i], 0, 0, 0); in binder_selftest_alloc_buf() 132 !check_buffer_pages_allocated(alloc, buffers[i], in binder_selftest_alloc_buf() 140 static void binder_selftest_free_buf(struct binder_alloc *alloc, in binder_selftest_free_buf() argument 147 binder_alloc_free_buf(alloc, buffers[seq[i]]); in binder_selftest_free_buf() [all …]
|
D | binder_alloc.h | 73 struct binder_alloc *alloc; member 119 void binder_selftest_alloc(struct binder_alloc *alloc); 121 static inline void binder_selftest_alloc(struct binder_alloc *alloc) {} in binder_selftest_alloc() argument 126 extern struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc, 131 extern void binder_alloc_init(struct binder_alloc *alloc); 133 extern void binder_alloc_vma_close(struct binder_alloc *alloc); 135 binder_alloc_prepare_to_free(struct binder_alloc *alloc, 137 extern void binder_alloc_free_buf(struct binder_alloc *alloc, 139 extern int binder_alloc_mmap_handler(struct binder_alloc *alloc, 141 extern void binder_alloc_deferred_release(struct binder_alloc *alloc); [all …]
|
D | binder_trace.h | 298 TP_PROTO(struct binder_alloc *alloc, bool allocate, 300 TP_ARGS(alloc, allocate, start, end), 308 __entry->proc = alloc->pid; 310 __entry->offset = start - alloc->buffer; 319 TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 320 TP_ARGS(alloc, page_index), 326 __entry->proc = alloc->pid; 334 TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 335 TP_ARGS(alloc, page_index)); 338 TP_PROTO(const struct binder_alloc *alloc, size_t page_index), [all …]
|
/drivers/infiniband/hw/cxgb4/ |
D | id_table.c | 44 u32 c4iw_id_alloc(struct c4iw_id_table *alloc) in c4iw_id_alloc() argument 49 spin_lock_irqsave(&alloc->lock, flags); in c4iw_id_alloc() 51 obj = find_next_zero_bit(alloc->table, alloc->max, alloc->last); in c4iw_id_alloc() 52 if (obj >= alloc->max) in c4iw_id_alloc() 53 obj = find_first_zero_bit(alloc->table, alloc->max); in c4iw_id_alloc() 55 if (obj < alloc->max) { in c4iw_id_alloc() 56 if (alloc->flags & C4IW_ID_TABLE_F_RANDOM) in c4iw_id_alloc() 57 alloc->last += prandom_u32() % RANDOM_SKIP; in c4iw_id_alloc() 59 alloc->last = obj + 1; in c4iw_id_alloc() 60 if (alloc->last >= alloc->max) in c4iw_id_alloc() [all …]
|
/drivers/infiniband/hw/mthca/ |
D | mthca_allocator.c | 40 u32 mthca_alloc(struct mthca_alloc *alloc) in mthca_alloc() argument 45 spin_lock_irqsave(&alloc->lock, flags); in mthca_alloc() 47 obj = find_next_zero_bit(alloc->table, alloc->max, alloc->last); in mthca_alloc() 48 if (obj >= alloc->max) { in mthca_alloc() 49 alloc->top = (alloc->top + alloc->max) & alloc->mask; in mthca_alloc() 50 obj = find_first_zero_bit(alloc->table, alloc->max); in mthca_alloc() 53 if (obj < alloc->max) { in mthca_alloc() 54 set_bit(obj, alloc->table); in mthca_alloc() 55 obj |= alloc->top; in mthca_alloc() 59 spin_unlock_irqrestore(&alloc->lock, flags); in mthca_alloc() [all …]
|
D | mthca_uar.c | 40 uar->index = mthca_alloc(&dev->uar_table.alloc); in mthca_uar_alloc() 51 mthca_free(&dev->uar_table.alloc, uar->index); in mthca_uar_free() 58 ret = mthca_alloc_init(&dev->uar_table.alloc, in mthca_init_uar_table() 67 mthca_alloc_cleanup(&dev->uar_table.alloc); in mthca_init_uar_table() 77 mthca_alloc_cleanup(&dev->uar_table.alloc); in mthca_cleanup_uar_table()
|
D | mthca_pd.c | 46 pd->pd_num = mthca_alloc(&dev->pd_table.alloc); in mthca_pd_alloc() 56 mthca_free(&dev->pd_table.alloc, pd->pd_num); in mthca_pd_alloc() 66 mthca_free(&dev->pd_table.alloc, pd->pd_num); in mthca_pd_free() 71 return mthca_alloc_init(&dev->pd_table.alloc, in mthca_init_pd_table() 80 mthca_alloc_cleanup(&dev->pd_table.alloc); in mthca_cleanup_pd_table()
|
D | mthca_dev.h | 194 struct mthca_alloc alloc; member 200 struct mthca_alloc alloc; member 226 struct mthca_alloc alloc; member 239 struct mthca_alloc alloc; member 246 struct mthca_alloc alloc; member 253 struct mthca_alloc alloc; member 269 struct mthca_alloc alloc; member 274 struct mthca_alloc alloc; member 413 u32 mthca_alloc(struct mthca_alloc *alloc); 414 void mthca_free(struct mthca_alloc *alloc, u32 obj); [all …]
|
D | mthca_mcg.c | 148 index = mthca_alloc(&dev->mcg_table.alloc); in mthca_multicast_attach() 206 mthca_free(&dev->mcg_table.alloc, index); in mthca_multicast_attach() 286 mthca_free(&dev->mcg_table.alloc, amgm_index_to_free); in mthca_multicast_detach() 305 mthca_free(&dev->mcg_table.alloc, index); in mthca_multicast_detach() 320 err = mthca_alloc_init(&dev->mcg_table.alloc, in mthca_init_mcg_table() 334 mthca_alloc_cleanup(&dev->mcg_table.alloc); in mthca_cleanup_mcg_table()
|
D | mthca_av.c | 172 index = mthca_alloc(&dev->av_table.alloc); in mthca_create_ah() 244 mthca_free(&dev->av_table.alloc, in mthca_destroy_ah() 331 err = mthca_alloc_init(&dev->av_table.alloc, in mthca_init_av_table() 361 mthca_alloc_cleanup(&dev->av_table.alloc); in mthca_init_av_table() 373 mthca_alloc_cleanup(&dev->av_table.alloc); in mthca_cleanup_av_table()
|
D | mthca_srq.c | 229 srq->srqn = mthca_alloc(&dev->srq_table.alloc); in mthca_alloc_srq() 314 mthca_free(&dev->srq_table.alloc, srq->srqn); in mthca_alloc_srq() 360 mthca_free(&dev->srq_table.alloc, srq->srqn); in mthca_free_srq() 674 err = mthca_alloc_init(&dev->srq_table.alloc, in mthca_init_srq_table() 684 mthca_alloc_cleanup(&dev->srq_table.alloc); in mthca_init_srq_table() 695 mthca_alloc_cleanup(&dev->srq_table.alloc); in mthca_cleanup_srq_table()
|
/drivers/char/agp/ |
D | compat_ioctl.c | 151 struct agp_allocate32 alloc; in compat_agpioc_allocate_wrap() local 154 if (copy_from_user(&alloc, arg, sizeof(alloc))) in compat_agpioc_allocate_wrap() 157 memory = agp_allocate_memory_wrap(alloc.pg_count, alloc.type); in compat_agpioc_allocate_wrap() 162 alloc.key = memory->key; in compat_agpioc_allocate_wrap() 163 alloc.physical = memory->physical; in compat_agpioc_allocate_wrap() 165 if (copy_to_user(arg, &alloc, sizeof(alloc))) { in compat_agpioc_allocate_wrap()
|
D | frontend.c | 877 struct agp_allocate alloc; in agpioc_allocate_wrap() local 880 if (copy_from_user(&alloc, arg, sizeof(struct agp_allocate))) in agpioc_allocate_wrap() 883 if (alloc.type >= AGP_USER_TYPES) in agpioc_allocate_wrap() 886 memory = agp_allocate_memory_wrap(alloc.pg_count, alloc.type); in agpioc_allocate_wrap() 891 alloc.key = memory->key; in agpioc_allocate_wrap() 892 alloc.physical = memory->physical; in agpioc_allocate_wrap() 894 if (copy_to_user(arg, &alloc, sizeof(struct agp_allocate))) { in agpioc_allocate_wrap()
|
/drivers/gpu/drm/radeon/ |
D | radeon_mem.c | 223 drm_radeon_mem_alloc_t *alloc = data; in radeon_mem_alloc() local 231 heap = get_heap(dev_priv, alloc->region); in radeon_mem_alloc() 238 if (alloc->alignment < 12) in radeon_mem_alloc() 239 alloc->alignment = 12; in radeon_mem_alloc() 241 block = alloc_block(*heap, alloc->size, alloc->alignment, file_priv); in radeon_mem_alloc() 246 if (copy_to_user(alloc->region_offset, &block->start, in radeon_mem_alloc()
|
/drivers/mmc/core/ |
D | pwrseq.c | 22 struct mmc_pwrseq *(*alloc)(struct mmc_host *host, struct device *dev); member 28 .alloc = mmc_pwrseq_simple_alloc, 31 .alloc = mmc_pwrseq_emmc_alloc, 74 pwrseq = match->alloc(host, &pdev->dev); in mmc_pwrseq_alloc()
|
/drivers/md/bcache/ |
D | alloc.c | 546 struct bkey *alloc) in pick_data_bucket() argument 562 if (!ret->sectors_free && KEY_PTRS(alloc)) { in pick_data_bucket() 564 bkey_copy(&ret->key, alloc); in pick_data_bucket() 565 bkey_init(alloc); in pick_data_bucket() 588 BKEY_PADDED(key) alloc; in bch_alloc_sectors() 598 bkey_init(&alloc.key); in bch_alloc_sectors() 601 while (!(b = pick_data_bucket(c, k, write_point, &alloc.key))) { in bch_alloc_sectors() 608 if (bch_bucket_alloc_set(c, watermark, &alloc.key, 1, wait)) in bch_alloc_sectors() 619 if (KEY_PTRS(&alloc.key)) in bch_alloc_sectors() 620 bkey_put(c, &alloc.key); in bch_alloc_sectors()
|
/drivers/uwb/ |
D | drp-ie.c | 299 const struct uwb_drp_alloc *alloc; in uwb_drp_ie_to_bm() local 308 alloc = &drp_ie->allocs[cnt]; in uwb_drp_ie_to_bm() 309 zone_bm = le16_to_cpu(alloc->zone_bm); in uwb_drp_ie_to_bm() 310 mas_bm = le16_to_cpu(alloc->mas_bm); in uwb_drp_ie_to_bm()
|
/drivers/net/ethernet/ |
D | ec_bhf.c | 126 u8 *alloc; member 350 buf->alloc = dma_alloc_coherent(dev, buf->alloc_len, &buf->alloc_phys, in ec_bhf_alloc_dma_mem() 352 if (buf->alloc == NULL) { in ec_bhf_alloc_dma_mem() 358 buf->buf = buf->alloc + (buf->buf_phys - buf->alloc_phys); in ec_bhf_alloc_dma_mem() 436 dma_free_coherent(dev, priv->rx_buf.alloc_len, priv->rx_buf.alloc, in ec_bhf_open() 454 priv->tx_buf.alloc, priv->tx_buf.alloc_phys); in ec_bhf_stop() 456 priv->rx_buf.alloc, priv->rx_buf.alloc_phys); in ec_bhf_stop()
|
/drivers/base/ |
D | component.c | 22 size_t alloc; member 237 if (match && match->alloc == num) in component_match_realloc() 251 new->alloc = num; in component_match_realloc() 269 if (!match || match->num == match->alloc) { in component_match_add() 270 size_t new_size = match ? match->alloc + 16 : 15; in component_match_add()
|
/drivers/scsi/arm/ |
D | queue.c | 73 queue->alloc = q = kmalloc(sizeof(QE_t) * nqueues, GFP_KERNEL); in queue_initialise() 82 return queue->alloc != NULL; in queue_initialise() 94 kfree(queue->alloc); in queue_free()
|
/drivers/misc/mic/scif/ |
D | scif_rma.c | 196 struct scif_allocmsg *alloc = &window->alloc_handle; in scif_destroy_incomplete_window() local 201 err = wait_event_timeout(alloc->allocwq, in scif_destroy_incomplete_window() 202 alloc->state != OP_IN_PROGRESS, in scif_destroy_incomplete_window() 208 if (alloc->state == OP_COMPLETED) { in scif_destroy_incomplete_window() 760 struct scif_allocmsg *alloc = &window->alloc_handle; in scif_send_alloc_request() local 763 alloc->state = OP_IN_PROGRESS; in scif_send_alloc_request() 764 init_waitqueue_head(&alloc->allocwq); in scif_send_alloc_request() 786 struct scif_allocmsg *alloc = &window->alloc_handle; in scif_prep_remote_window() local 801 err = wait_event_timeout(alloc->allocwq, in scif_prep_remote_window() 802 alloc->state != OP_IN_PROGRESS, in scif_prep_remote_window() [all …]
|
/drivers/media/rc/ |
D | rc-main.c | 134 rc_map->alloc = roundup_pow_of_two(size * sizeof(struct rc_map_table)); in ir_create_table() 135 rc_map->size = rc_map->alloc / sizeof(struct rc_map_table); in ir_create_table() 136 rc_map->scan = kmalloc(rc_map->alloc, GFP_KERNEL); in ir_create_table() 141 rc_map->size, rc_map->alloc); in ir_create_table() 170 unsigned int oldalloc = rc_map->alloc; in ir_resize_table() 177 if (rc_map->alloc >= IR_TAB_MAX_SIZE) in ir_resize_table() 201 rc_map->alloc = newalloc; in ir_resize_table() 202 rc_map->size = rc_map->alloc / sizeof(struct rc_map_table); in ir_resize_table() 388 rc_map->size, rc_map->alloc); in ir_setkeytable()
|
/drivers/tee/ |
D | tee_shm_pool.c | 54 .alloc = pool_op_gen_alloc, 157 return mgr && mgr->ops && mgr->ops->alloc && mgr->ops->free && in check_mgr_ops()
|
/drivers/net/ethernet/micrel/ |
D | ksz884x.c | 1013 int alloc; member 3815 int alloc = info->alloc; in ksz_check_desc_num() local 3819 while (!(alloc & 1)) { in ksz_check_desc_num() 3821 alloc >>= 1; in ksz_check_desc_num() 3823 if (alloc != 1 || shift < MIN_DESC_SHIFT) { in ksz_check_desc_num() 3825 while (alloc) { in ksz_check_desc_num() 3827 alloc >>= 1; in ksz_check_desc_num() 3831 alloc = 1 << shift; in ksz_check_desc_num() 3832 info->alloc = alloc; in ksz_check_desc_num() 3834 info->mask = info->alloc - 1; in ksz_check_desc_num() [all …]
|