Home
last modified time | relevance | path

Searched refs:heap (Results 1 – 25 of 143) sorted by relevance

123456

/openbmc/linux/lib/
H A Dtest_min_heap.c33 struct min_heap *heap, in pop_verify_heap() argument
36 int *values = heap->data; in pop_verify_heap()
41 min_heap_pop(heap, funcs); in pop_verify_heap()
42 while (heap->nr > 0) { in pop_verify_heap()
57 min_heap_pop(heap, funcs); in pop_verify_heap()
66 struct min_heap heap = { in test_heapify_all() local
79 min_heapify_all(&heap, &funcs); in test_heapify_all()
80 err = pop_verify_heap(min_heap, &heap, &funcs); in test_heapify_all()
84 heap.nr = ARRAY_SIZE(values); in test_heapify_all()
85 for (i = 0; i < heap.nr; i++) in test_heapify_all()
[all …]
/openbmc/linux/include/linux/
H A Dmin_heap.h35 void min_heapify(struct min_heap *heap, int pos, in min_heapify() argument
39 void *data = heap->data; in min_heapify()
42 if (pos * 2 + 1 >= heap->nr) in min_heapify()
51 if (pos * 2 + 2 < heap->nr) { in min_heapify()
68 void min_heapify_all(struct min_heap *heap, in min_heapify_all() argument
73 for (i = heap->nr / 2; i >= 0; i--) in min_heapify_all()
74 min_heapify(heap, i, func); in min_heapify_all()
79 void min_heap_pop(struct min_heap *heap, in min_heap_pop() argument
82 void *data = heap->data; in min_heap_pop()
84 if (WARN_ONCE(heap->nr <= 0, "Popping an empty heap")) in min_heap_pop()
[all …]
H A Ddma-heap.h24 struct dma_buf *(*allocate)(struct dma_heap *heap,
51 void *dma_heap_get_drvdata(struct dma_heap *heap);
60 const char *dma_heap_get_name(struct dma_heap *heap);
/openbmc/linux/drivers/dma-buf/
H A Ddma-heap.c52 static int dma_heap_buffer_alloc(struct dma_heap *heap, size_t len, in dma_heap_buffer_alloc() argument
67 dmabuf = heap->ops->allocate(heap, len, fd_flags, heap_flags); in dma_heap_buffer_alloc()
81 struct dma_heap *heap; in dma_heap_open() local
83 heap = xa_load(&dma_heap_minors, iminor(inode)); in dma_heap_open()
84 if (!heap) { in dma_heap_open()
90 file->private_data = heap; in dma_heap_open()
99 struct dma_heap *heap = file->private_data; in dma_heap_ioctl_allocate() local
111 fd = dma_heap_buffer_alloc(heap, heap_allocation->len, in dma_heap_ioctl_allocate()
202 void *dma_heap_get_drvdata(struct dma_heap *heap) in dma_heap_get_drvdata() argument
204 return heap->priv; in dma_heap_get_drvdata()
[all …]
/openbmc/u-boot/lib/bzip2/
H A Dbzlib_huffman.c77 zz = z; tmp = heap[zz]; \
78 while (weight[tmp] < weight[heap[zz >> 1]]) { \
79 heap[zz] = heap[zz >> 1]; \
82 heap[zz] = tmp; \
88 zz = z; tmp = heap[zz]; \
93 weight[heap[yy+1]] < weight[heap[yy]]) \
95 if (weight[tmp] < weight[heap[yy]]) break; \
96 heap[zz] = heap[yy]; \
99 heap[zz] = tmp; \
116 Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ]; in BZ2_hbMakeCodeLengths() local
[all …]
/openbmc/u-boot/fs/ubifs/
H A Dlprops.c53 static void move_up_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, in move_up_lpt_heap() argument
66 val2 = get_heap_comp_val(heap->arr[ppos], cat); in move_up_lpt_heap()
70 heap->arr[ppos]->hpos = hpos; in move_up_lpt_heap()
71 heap->arr[hpos] = heap->arr[ppos]; in move_up_lpt_heap()
72 heap->arr[ppos] = lprops; in move_up_lpt_heap()
90 static void adjust_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, in adjust_lpt_heap() argument
100 val2 = get_heap_comp_val(heap->arr[ppos], cat); in adjust_lpt_heap()
104 heap->arr[ppos]->hpos = hpos; in adjust_lpt_heap()
105 heap->arr[hpos] = heap->arr[ppos]; in adjust_lpt_heap()
106 heap->arr[ppos] = lprops; in adjust_lpt_heap()
[all …]
/openbmc/linux/fs/ubifs/
H A Dlprops.c50 static void move_up_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, in move_up_lpt_heap() argument
63 val2 = get_heap_comp_val(heap->arr[ppos], cat); in move_up_lpt_heap()
67 heap->arr[ppos]->hpos = hpos; in move_up_lpt_heap()
68 heap->arr[hpos] = heap->arr[ppos]; in move_up_lpt_heap()
69 heap->arr[ppos] = lprops; in move_up_lpt_heap()
87 static void adjust_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, in adjust_lpt_heap() argument
97 val2 = get_heap_comp_val(heap->arr[ppos], cat); in adjust_lpt_heap()
101 heap->arr[ppos]->hpos = hpos; in adjust_lpt_heap()
102 heap->arr[hpos] = heap->arr[ppos]; in adjust_lpt_heap()
103 heap->arr[ppos] = lprops; in adjust_lpt_heap()
[all …]
H A Dfind.c45 struct ubifs_lpt_heap *heap; in valuable() local
51 heap = &c->lpt_heap[cat - 1]; in valuable()
52 if (heap->cnt < heap->max_cnt) in valuable()
129 struct ubifs_lpt_heap *heap; in scan_for_dirty() local
134 heap = &c->lpt_heap[LPROPS_FREE - 1]; in scan_for_dirty()
135 for (i = 0; i < heap->cnt; i++) { in scan_for_dirty()
136 lprops = heap->arr[i]; in scan_for_dirty()
226 struct ubifs_lpt_heap *heap, *idx_heap; in ubifs_find_dirty_leb() local
272 heap = &c->lpt_heap[LPROPS_DIRTY - 1]; in ubifs_find_dirty_leb()
292 if (heap->cnt) { in ubifs_find_dirty_leb()
[all …]
/openbmc/linux/tools/include/nolibc/
H A Dstdlib.h72 struct nolibc_heap *heap; in free() local
77 heap = container_of(ptr, struct nolibc_heap, user_p); in free()
78 munmap(heap, heap->len); in free()
133 struct nolibc_heap *heap; in malloc() local
136 len = sizeof(*heap) + len; in malloc()
138 heap = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, in malloc()
140 if (__builtin_expect(heap == MAP_FAILED, 0)) in malloc()
143 heap->len = len; in malloc()
144 return heap->user_p; in malloc()
167 struct nolibc_heap *heap; in realloc() local
[all …]
/openbmc/linux/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/
H A Dbase.c255 nvkm_mmu_type(struct nvkm_mmu *mmu, int heap, u8 type) in nvkm_mmu_type() argument
257 if (heap >= 0 && !WARN_ON(mmu->type_nr == ARRAY_SIZE(mmu->type))) { in nvkm_mmu_type()
258 mmu->type[mmu->type_nr].type = type | mmu->heap[heap].type; in nvkm_mmu_type()
259 mmu->type[mmu->type_nr].heap = heap; in nvkm_mmu_type()
268 if (!WARN_ON(mmu->heap_nr == ARRAY_SIZE(mmu->heap))) { in nvkm_mmu_heap()
269 mmu->heap[mmu->heap_nr].type = type; in nvkm_mmu_heap()
270 mmu->heap[mmu->heap_nr].size = size; in nvkm_mmu_heap()
282 int heap; in nvkm_mmu_host() local
285 heap = nvkm_mmu_heap(mmu, NVKM_MEM_HOST, ~0ULL); in nvkm_mmu_host()
286 nvkm_mmu_type(mmu, heap, type); in nvkm_mmu_host()
[all …]
/openbmc/linux/drivers/gpu/drm/nouveau/include/nvkm/core/
H A Dmm.h12 u8 heap; member
34 int nvkm_mm_init(struct nvkm_mm *, u8 heap, u32 offset, u32 length, u32 block);
36 int nvkm_mm_head(struct nvkm_mm *, u8 heap, u8 type, u32 size_max,
38 int nvkm_mm_tail(struct nvkm_mm *, u8 heap, u8 type, u32 size_max,
44 nvkm_mm_heap_size(struct nvkm_mm *mm, u8 heap) in nvkm_mm_heap_size() argument
49 if (node->heap == heap) in nvkm_mm_heap_size()
/openbmc/linux/drivers/gpu/drm/nouveau/nvkm/core/
H A Dmm.c99 b->heap = a->heap; in region_head()
111 nvkm_mm_head(struct nvkm_mm *mm, u8 heap, u8 type, u32 size_max, u32 size_min, in nvkm_mm_head() argument
122 if (unlikely(heap != NVKM_MM_HEAP_ANY)) { in nvkm_mm_head()
123 if (this->heap != heap) in nvkm_mm_head()
175 b->heap = a->heap; in region_tail()
186 nvkm_mm_tail(struct nvkm_mm *mm, u8 heap, u8 type, u32 size_max, u32 size_min, in nvkm_mm_tail() argument
198 if (unlikely(heap != NVKM_MM_HEAP_ANY)) { in nvkm_mm_tail()
199 if (this->heap != heap) in nvkm_mm_tail()
240 nvkm_mm_init(struct nvkm_mm *mm, u8 heap, u32 offset, u32 length, u32 block) in nvkm_mm_init() argument
277 node->heap = heap; in nvkm_mm_init()
H A Dgpuobj.c180 ret = nvkm_mm_head(&parent->heap, 0, 1, size, size, in nvkm_gpuobj_ctor()
183 ret = nvkm_mm_tail(&parent->heap, 0, 1, size, size, in nvkm_gpuobj_ctor()
211 return nvkm_mm_init(&gpuobj->heap, 0, 0, gpuobj->size, 1); in nvkm_gpuobj_ctor()
220 nvkm_mm_free(&gpuobj->parent->heap, &gpuobj->node); in nvkm_gpuobj_del()
221 nvkm_mm_fini(&gpuobj->heap); in nvkm_gpuobj_del()
/openbmc/linux/drivers/gpu/drm/nouveau/nvif/
H A Dmmu.c35 kfree(mmu->heap); in nvif_mmu_dtor()
53 mmu->heap = NULL; in nvif_mmu_ctor()
72 mmu->heap = kmalloc_array(mmu->heap_nr, sizeof(*mmu->heap), in nvif_mmu_ctor()
76 if (ret = -ENOMEM, !mmu->heap || !mmu->type) in nvif_mmu_ctor()
92 mmu->heap[i].size = args.size; in nvif_mmu_ctor()
112 mmu->type[i].heap = args.heap; in nvif_mmu_ctor()
/openbmc/linux/Documentation/ABI/testing/
H A Dsysfs-kernel-mm-cma6 heap name (also sometimes called CMA areas).
8 Each CMA heap subdirectory (that is, each
9 /sys/kernel/mm/cma/<cma-heap-name> directory) contains the
15 What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_success
21 What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_fail
/openbmc/linux/drivers/dma-buf/heaps/
H A DKconfig5 Choose this option to enable the system dmabuf heap. The system heap
12 Choose this option to enable dma-buf CMA heap. This heap is backed
H A Dcma_heap.c27 struct dma_heap *heap; member
32 struct cma_heap *heap; member
248 struct cma_heap *cma_heap = buffer->heap; in cma_heap_dma_buf_release()
276 static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, in cma_heap_allocate() argument
281 struct cma_heap *cma_heap = dma_heap_get_drvdata(heap); in cma_heap_allocate()
340 buffer->heap = cma_heap; in cma_heap_allocate()
344 exp_info.exp_name = dma_heap_get_name(heap); in cma_heap_allocate()
384 cma_heap->heap = dma_heap_add(&exp_info); in __add_cma_heap()
385 if (IS_ERR(cma_heap->heap)) { in __add_cma_heap()
386 int ret = PTR_ERR(cma_heap->heap); in __add_cma_heap()
/openbmc/linux/drivers/md/bcache/
H A Dmovinggc.c194 return (b = heap_peek(&ca->heap)) ? GC_SECTORS_USED(b) : 0; in bucket_heap_top()
212 ca->heap.used = 0; in bch_moving_gc()
221 if (!heap_full(&ca->heap)) { in bch_moving_gc()
223 heap_add(&ca->heap, b, bucket_cmp); in bch_moving_gc()
224 } else if (bucket_cmp(b, heap_peek(&ca->heap))) { in bch_moving_gc()
228 ca->heap.data[0] = b; in bch_moving_gc()
229 heap_sift(&ca->heap, 0, bucket_cmp); in bch_moving_gc()
234 heap_pop(&ca->heap, b, bucket_cmp); in bch_moving_gc()
238 while (heap_pop(&ca->heap, b, bucket_cmp)) in bch_moving_gc()
H A Dutil.h40 #define init_heap(heap, _size, gfp) \ argument
43 (heap)->used = 0; \
44 (heap)->size = (_size); \
45 _bytes = (heap)->size * sizeof(*(heap)->data); \
46 (heap)->data = kvmalloc(_bytes, (gfp) & GFP_KERNEL); \
47 (heap)->data; \
50 #define free_heap(heap) \ argument
52 kvfree((heap)->data); \
53 (heap)->data = NULL; \
H A Dalloc.c184 ca->heap.used = 0; in invalidate_buckets_lru()
190 if (!heap_full(&ca->heap)) in invalidate_buckets_lru()
191 heap_add(&ca->heap, b, bucket_max_cmp); in invalidate_buckets_lru()
192 else if (bucket_max_cmp(b, heap_peek(&ca->heap))) { in invalidate_buckets_lru()
193 ca->heap.data[0] = b; in invalidate_buckets_lru()
194 heap_sift(&ca->heap, 0, bucket_max_cmp); in invalidate_buckets_lru()
198 for (i = ca->heap.used / 2 - 1; i >= 0; --i) in invalidate_buckets_lru()
199 heap_sift(&ca->heap, i, bucket_min_cmp); in invalidate_buckets_lru()
202 if (!heap_pop(&ca->heap, b, bucket_min_cmp)) { in invalidate_buckets_lru()
/openbmc/linux/lib/zlib_deflate/
H A Ddeftree.c298 top = s->heap[SMALLEST]; \
299 s->heap[SMALLEST] = s->heap[s->heap_len--]; \
323 int v = s->heap[k]; in pqdownheap()
328 smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { in pqdownheap()
332 if (smaller(tree, v, s->heap[j], s->depth)) break; in pqdownheap()
335 s->heap[k] = s->heap[j]; k = j; in pqdownheap()
340 s->heap[k] = v; in pqdownheap()
376 tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ in gen_bitlen()
379 n = s->heap[h]; in gen_bitlen()
420 m = s->heap[--h]; in gen_bitlen()
[all …]
/openbmc/u-boot/lib/zlib/
H A Dtrees.c440 top = s->heap[SMALLEST]; \
441 s->heap[SMALLEST] = s->heap[s->heap_len--]; \
464 int v = s->heap[k];
469 smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
473 if (smaller(tree, v, s->heap[j], s->depth)) break;
476 s->heap[k] = s->heap[j]; k = j;
481 s->heap[k] = v;
516 tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
519 n = s->heap[h];
560 m = s->heap[--h];
[all …]
/openbmc/openbmc/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/
H A D02-Makefile.in.patch53 OBJS = arg_check.o compat.o dmalloc_rand.o dmalloc_tab.o env.o heap.o
215 error_val.h heap.h
218 + error_val.h heap.h
249 error_val.h heap.h
252 + error_val.h heap.h
273 heap.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
274 dmalloc_loc.h error.h error_val.h heap.h
275 +heap_sl.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
276 + dmalloc_loc.h error.h error_val.h heap.h
280 debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
[all …]
/openbmc/linux/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/
H A Dnv04.c31 struct nvkm_mm heap; member
103 nvkm_mm_free(&iobj->imem->heap, &iobj->node); in nv04_instobj_dtor()
136 ret = nvkm_mm_head(&imem->heap, 0, 1, size, size, align ? align : 1, &iobj->node); in nv04_instobj_new()
167 ret = nvkm_mm_init(&imem->heap, 0, 0, imem->base.reserved, 1); in nv04_instmem_oneinit()
205 nvkm_mm_fini(&imem->heap); in nv04_instmem_dtor()
H A Dnv40.c32 struct nvkm_mm heap; member
103 nvkm_mm_free(&iobj->imem->heap, &iobj->node); in nv40_instobj_dtor()
136 ret = nvkm_mm_head(&imem->heap, 0, 1, size, size, align ? align : 1, &iobj->node); in nv40_instobj_new()
179 ret = nvkm_mm_init(&imem->heap, 0, 0, imem->base.reserved, 1); in nv40_instmem_oneinit()
221 nvkm_mm_fini(&imem->heap); in nv40_instmem_dtor()

123456