Home
last modified time | relevance | path

Searched refs:alloc (Results 1 – 25 of 787) sorted by relevance

12345678910>>...32

/openbmc/linux/drivers/android/
H A Dbinder_alloc.c60 static size_t binder_alloc_buffer_size(struct binder_alloc *alloc, in binder_alloc_buffer_size() argument
63 if (list_is_last(&buffer->entry, &alloc->buffers)) in binder_alloc_buffer_size()
64 return alloc->buffer + alloc->buffer_size - buffer->user_data; in binder_alloc_buffer_size()
68 static void binder_insert_free_buffer(struct binder_alloc *alloc, in binder_insert_free_buffer() argument
71 struct rb_node **p = &alloc->free_buffers.rb_node; in binder_insert_free_buffer()
79 new_buffer_size = binder_alloc_buffer_size(alloc, new_buffer); in binder_insert_free_buffer()
83 alloc->pid, new_buffer_size, new_buffer); in binder_insert_free_buffer()
90 buffer_size = binder_alloc_buffer_size(alloc, buffer); in binder_insert_free_buffer()
98 rb_insert_color(&new_buffer->rb_node, &alloc->free_buffers); in binder_insert_free_buffer()
102 struct binder_alloc *alloc, struct binder_buffer *new_buffer) in binder_insert_allocated_buffer_locked() argument
[all …]
H A Dbinder_alloc_selftest.c92 static bool check_buffer_pages_allocated(struct binder_alloc *alloc, in check_buffer_pages_allocated() argument
103 page_index = (page_addr - alloc->buffer) / PAGE_SIZE; in check_buffer_pages_allocated()
104 if (!alloc->pages[page_index].page_ptr || in check_buffer_pages_allocated()
105 !list_empty(&alloc->pages[page_index].lru)) { in check_buffer_pages_allocated()
107 alloc->pages[page_index].page_ptr ? in check_buffer_pages_allocated()
115 static void binder_selftest_alloc_buf(struct binder_alloc *alloc, in binder_selftest_alloc_buf() argument
122 buffers[i] = binder_alloc_new_buf(alloc, sizes[i], 0, 0, 0, 0); in binder_selftest_alloc_buf()
124 !check_buffer_pages_allocated(alloc, buffers[i], in binder_selftest_alloc_buf()
132 static void binder_selftest_free_buf(struct binder_alloc *alloc, in binder_selftest_free_buf() argument
139 binder_alloc_free_buf(alloc, buffers[seq[i]]); in binder_selftest_free_buf()
[all …]
H A Dbinder_alloc.h72 struct binder_alloc *alloc; member
117 void binder_selftest_alloc(struct binder_alloc *alloc);
119 static inline void binder_selftest_alloc(struct binder_alloc *alloc) {} in binder_selftest_alloc() argument
124 extern struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc,
130 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 …]
H A Dbinder_trace.h319 TP_PROTO(struct binder_alloc *alloc, bool allocate,
321 TP_ARGS(alloc, allocate, start, end),
329 __entry->proc = alloc->pid;
331 __entry->offset = start - alloc->buffer;
340 TP_PROTO(const struct binder_alloc *alloc, size_t page_index),
341 TP_ARGS(alloc, page_index),
347 __entry->proc = alloc->pid;
355 TP_PROTO(const struct binder_alloc *alloc, size_t page_index),
356 TP_ARGS(alloc, page_index));
359 TP_PROTO(const struct binder_alloc *alloc, size_t page_index),
[all …]
/openbmc/linux/drivers/infiniband/hw/cxgb4/
H A Did_table.c44 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 += get_random_u32_below(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 …]
/openbmc/linux/sound/isa/gus/
H A Dgus_mem.c18 void snd_gf1_mem_lock(struct snd_gf1_mem * alloc, int xup) in snd_gf1_mem_lock() argument
21 mutex_lock(&alloc->memory_mutex); in snd_gf1_mem_lock()
23 mutex_unlock(&alloc->memory_mutex); in snd_gf1_mem_lock()
28 snd_gf1_mem_xalloc(struct snd_gf1_mem *alloc, struct snd_gf1_mem_block *block, in snd_gf1_mem_xalloc() argument
43 pblock = alloc->first; in snd_gf1_mem_xalloc()
49 if (pblock == alloc->first) in snd_gf1_mem_xalloc()
50 alloc->first = nblock; in snd_gf1_mem_xalloc()
53 mutex_unlock(&alloc->memory_mutex); in snd_gf1_mem_xalloc()
59 if (alloc->last == NULL) { in snd_gf1_mem_xalloc()
61 alloc->first = alloc->last = nblock; in snd_gf1_mem_xalloc()
[all …]
/openbmc/qemu/tests/qemu-iotests/
H A D27161 expected_alloc="$alloc" # Space-separated list of allocated subcluster indexes
156 alloc="0"; zero=""
160 alloc="0 1"; zero=""
164 alloc="0 1 2"; zero=""
168 alloc="0 1 2 3"; zero=""
172 alloc="$(seq 0 6)"; zero=""
176 alloc="$(seq 0 9)"; zero=""
180 alloc="$(seq 0 9) 16"; zero=""
184 alloc="$(seq 0 9) 16 31"; zero=""
186 alloc="0 1" ; zero=""
[all …]
/openbmc/linux/drivers/infiniband/hw/mthca/
H A Dmthca_allocator.c40 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 …]
H A Dmthca_uar.c40 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()
/openbmc/linux/fs/ocfs2/
H A Dlocalalloc.c35 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc);
38 struct ocfs2_dinode *alloc,
42 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc);
46 struct ocfs2_dinode *alloc,
271 struct ocfs2_dinode *alloc = NULL; in ocfs2_load_local_alloc() local
305 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; in ocfs2_load_local_alloc()
306 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_load_local_alloc()
308 if (!(le32_to_cpu(alloc->i_flags) & in ocfs2_load_local_alloc()
325 num_used = ocfs2_local_alloc_count_bits(alloc); in ocfs2_load_local_alloc()
330 || alloc->id1.bitmap1.i_used in ocfs2_load_local_alloc()
[all …]
/openbmc/linux/fs/xfs/libxfs/
H A Dxfs_alloc_btree.c129 len = rec->alloc.ar_blockcount; in xfs_allocbt_update_lastrec()
132 if (be32_to_cpu(rec->alloc.ar_blockcount) <= in xfs_allocbt_update_lastrec()
135 len = rec->alloc.ar_blockcount; in xfs_allocbt_update_lastrec()
185 key->alloc.ar_startblock = rec->alloc.ar_startblock; in xfs_allocbt_init_key_from_rec()
186 key->alloc.ar_blockcount = rec->alloc.ar_blockcount; in xfs_allocbt_init_key_from_rec()
196 x = be32_to_cpu(rec->alloc.ar_startblock); in xfs_bnobt_init_high_key_from_rec()
197 x += be32_to_cpu(rec->alloc.ar_blockcount) - 1; in xfs_bnobt_init_high_key_from_rec()
198 key->alloc.ar_startblock = cpu_to_be32(x); in xfs_bnobt_init_high_key_from_rec()
199 key->alloc.ar_blockcount = 0; in xfs_bnobt_init_high_key_from_rec()
207 key->alloc.ar_blockcount = rec->alloc.ar_blockcount; in xfs_cntbt_init_high_key_from_rec()
[all …]
/openbmc/linux/rust/alloc/
H A Draw_vec.rs5 use core::alloc::LayoutError;
13 use crate::alloc::handle_alloc_error;
14 use crate::alloc::{Allocator, Global, Layout};
56 alloc: A, field
122 pub const fn new_in(alloc: A) -> Self { in new_in()
124 Self { ptr: Unique::dangling(), cap: 0, alloc } in new_in()
131 pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { in with_capacity_in()
132 Self::allocate_in(capacity, AllocInit::Uninitialized, alloc) in with_capacity_in()
138 pub fn try_with_capacity_in(capacity: usize, alloc: A) -> Result<Self, TryReserveError> { in try_with_capacity_in()
139 Self::try_allocate_in(capacity, AllocInit::Uninitialized, alloc) in try_with_capacity_in()
[all …]
H A Dslice.rs27 use crate::alloc::Allocator;
29 use crate::alloc::{self, Global};
94 use core::alloc::Allocator;
105 let (b, alloc) = Box::into_raw_with_allocator(b); in into_vec()
106 Vec::from_raw_parts_in(b as *mut T, len, len, alloc) in into_vec()
112 pub fn to_vec<T: ConvertVec, A: Allocator>(s: &[T], alloc: A) -> Vec<T, A> { in to_vec()
113 T::to_vec(s, alloc) in to_vec()
118 fn to_vec<A: Allocator>(s: &[Self], alloc: A) -> Vec<Self, A> in to_vec()
126 default fn to_vec<A: Allocator>(s: &[Self], alloc: A) -> Vec<Self, A> { in to_vec()
141 let mut vec = Vec::with_capacity_in(s.len(), alloc); in to_vec()
[all …]
H A Dboxed.rs171 use crate::alloc::{handle_alloc_error, WriteCloneIntoRaw};
172 use crate::alloc::{AllocError, Allocator, Global, Layout};
382 pub fn new_in(x: T, alloc: A) -> Self in new_in()
386 let mut boxed = Self::new_uninit_in(alloc); in new_in()
410 pub fn try_new_in(x: T, alloc: A) -> Result<Self, AllocError> in try_new_in()
414 let mut boxed = Self::try_new_uninit_in(alloc)?; in try_new_in()
445 pub fn new_uninit_in(alloc: A) -> Box<mem::MaybeUninit<T>, A> in new_uninit_in()
452 match Box::try_new_uninit_in(alloc) { in new_uninit_in()
482 pub fn try_new_uninit_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError> in try_new_uninit_in()
490 alloc.allocate(layout)?.cast() in try_new_uninit_in()
[all …]
/openbmc/qemu/tests/qtest/
H A Digb-test.c48 static void igb_send_verify(QE1000E *d, int *test_sockets, QGuestAllocator *alloc) in igb_send_verify() argument
56 uint64_t data = guest_alloc(alloc, sizeof(buffer)); in igb_send_verify()
85 guest_free(alloc, data); in igb_send_verify()
88 static void igb_receive_verify(QE1000E *d, int *test_sockets, QGuestAllocator *alloc) in igb_receive_verify() argument
112 uint64_t data = guest_alloc(alloc, sizeof(buffer)); in igb_receive_verify()
133 guest_free(alloc, data); in igb_receive_verify()
136 static void test_e1000e_init(void *obj, void *data, QGuestAllocator * alloc) in test_e1000e_init() argument
141 static void test_igb_tx(void *obj, void *data, QGuestAllocator * alloc) in test_igb_tx() argument
153 igb_send_verify(d, data, alloc); in test_igb_tx()
156 static void test_igb_rx(void *obj, void *data, QGuestAllocator * alloc) in test_igb_rx() argument
[all …]
H A De1000e-test.c44 static void e1000e_send_verify(QE1000E *d, int *test_sockets, QGuestAllocator *alloc) in e1000e_send_verify() argument
52 uint64_t data = guest_alloc(alloc, sizeof(buffer)); in e1000e_send_verify()
82 guest_free(alloc, data); in e1000e_send_verify()
85 static void e1000e_receive_verify(QE1000E *d, int *test_sockets, QGuestAllocator *alloc) in e1000e_receive_verify() argument
109 uint64_t data = guest_alloc(alloc, sizeof(buffer)); in e1000e_receive_verify()
130 guest_free(alloc, data); in e1000e_receive_verify()
133 static void test_e1000e_init(void *obj, void *data, QGuestAllocator * alloc) in test_e1000e_init() argument
138 static void test_e1000e_tx(void *obj, void *data, QGuestAllocator * alloc) in test_e1000e_tx() argument
150 e1000e_send_verify(d, data, alloc); in test_e1000e_tx()
153 static void test_e1000e_rx(void *obj, void *data, QGuestAllocator * alloc) in test_e1000e_rx() argument
[all …]
H A Dvirtio-iommu-test.c24 static QGuestAllocator *alloc; variable
76 ro_addr = guest_alloc(alloc, ro_size); in send_attach_detach()
77 wr_addr = guest_alloc(alloc, wr_size); in send_attach_detach()
87 guest_free(alloc, ro_addr); in send_attach_detach()
88 guest_free(alloc, wr_addr); in send_attach_detach()
121 ro_addr = guest_alloc(alloc, ro_size); in send_map()
122 wr_addr = guest_alloc(alloc, wr_size); in send_map()
132 guest_free(alloc, ro_addr); in send_map()
133 guest_free(alloc, wr_addr); in send_map()
161 ro_addr = guest_alloc(alloc, ro_size); in send_unmap()
[all …]
H A Dtulip-test.c37 static void *tulip_pci_create(void *pci_bus, QGuestAllocator *alloc, void *addr) in tulip_pci_create() argument
48 static void tulip_large_tx(void *obj, void *data, QGuestAllocator *alloc) in tulip_large_tx() argument
60 context_pa = guest_alloc(alloc, sizeof(context)); in tulip_large_tx()
61 guest_pa = guest_alloc(alloc, 4096); in tulip_large_tx()
73 guest_free(alloc, context_pa); in tulip_large_tx()
74 guest_free(alloc, guest_pa); in tulip_large_tx()
/openbmc/linux/lib/zstd/compress/
H A Dzstd_cwksp.h247 void* const alloc = (BYTE*)ws->allocStart - bytes; in ZSTD_cwksp_reserve_internal_buffer_space() local
250 alloc, bytes, ZSTD_cwksp_available_space(ws) - bytes); in ZSTD_cwksp_reserve_internal_buffer_space()
252 assert(alloc >= bottom); in ZSTD_cwksp_reserve_internal_buffer_space()
253 if (alloc < bottom) { in ZSTD_cwksp_reserve_internal_buffer_space()
260 if (alloc < ws->tableValidEnd) { in ZSTD_cwksp_reserve_internal_buffer_space()
261 ws->tableValidEnd = alloc; in ZSTD_cwksp_reserve_internal_buffer_space()
263 ws->allocStart = alloc; in ZSTD_cwksp_reserve_internal_buffer_space()
264 return alloc; in ZSTD_cwksp_reserve_internal_buffer_space()
295 void* const alloc = ws->objectEnd; in ZSTD_cwksp_internal_advance_phase() local
296 … size_t const bytesToAlign = ZSTD_cwksp_bytes_to_align_ptr(alloc, ZSTD_CWKSP_ALIGNMENT_BYTES); in ZSTD_cwksp_internal_advance_phase()
[all …]
/openbmc/qemu/tests/qtest/libqos/
H A Drtas.c30 static uint64_t qrtas_call(QTestState *qts, QGuestAllocator *alloc, in qrtas_call() argument
38 target_args = guest_alloc(alloc, nargs * sizeof(uint32_t)); in qrtas_call()
39 target_ret = guest_alloc(alloc, nret * sizeof(uint32_t)); in qrtas_call()
45 guest_free(alloc, target_ret); in qrtas_call()
46 guest_free(alloc, target_args); in qrtas_call()
51 int qrtas_get_time_of_day(QTestState *qts, QGuestAllocator *alloc, in qrtas_get_time_of_day() argument
57 res = qrtas_call(qts, alloc, "get-time-of-day", 0, NULL, 8, ret); in qrtas_get_time_of_day()
75 uint32_t qrtas_ibm_read_pci_config(QTestState *qts, QGuestAllocator *alloc, in qrtas_ibm_read_pci_config() argument
86 res = qrtas_call(qts, alloc, "ibm,read-pci-config", 4, args, 2, ret); in qrtas_ibm_read_pci_config()
98 int qrtas_ibm_write_pci_config(QTestState *qts, QGuestAllocator *alloc, in qrtas_ibm_write_pci_config() argument
[all …]
H A Dppc64_pseries-machine.c36 QGuestAllocator alloc; member
54 QGuestAllocator *alloc) in qos_create_QSPAPR_host() argument
57 qpci_init_spapr(&host->pci, qts, alloc); in qos_create_QSPAPR_host()
65 alloc_destroy(&machine->alloc); in spapr_destructor()
72 return &machine->alloc; in spapr_get_driver()
96 spapr_alloc_init(&machine->alloc, qts, ALLOC_NO_FLAGS); in qos_create_machine_spapr()
98 qos_create_QSPAPR_host(&machine->bridge, qts, &machine->alloc); in qos_create_machine_spapr()
H A Dx86_64_pc-machine.c37 QGuestAllocator alloc; member
55 QGuestAllocator *alloc) in qos_create_i440FX_host() argument
58 qpci_init_pc(&host->pci, qts, alloc); in qos_create_i440FX_host()
66 alloc_destroy(&machine->alloc); in pc_destructor()
73 return &machine->alloc; in pc_get_driver()
97 pc_alloc_init(&machine->alloc, qts, ALLOC_NO_FLAGS); in qos_create_machine_pc()
98 qos_create_i440FX_host(&machine->bridge, qts, &machine->alloc); in qos_create_machine_pc()
/openbmc/linux/tools/perf/util/
H A Dstrbuf.c22 sb->alloc = sb->len = 0; in strbuf_init()
31 if (sb->alloc) { in strbuf_release()
39 char *res = sb->alloc ? sb->buf : NULL; in strbuf_detach()
51 if (nr < sb->alloc) in strbuf_grow()
57 if (alloc_nr(sb->alloc) > nr) in strbuf_grow()
58 nr = alloc_nr(sb->alloc); in strbuf_grow()
64 buf = realloc(sb->alloc ? sb->buf : NULL, nr * sizeof(*buf)); in strbuf_grow()
69 sb->alloc = nr; in strbuf_grow()
106 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); in strbuf_addv()
117 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap_saved); in strbuf_addv()
[all …]
/openbmc/linux/tools/lib/subcmd/
H A Dsubcmd-util.h38 #define ALLOC_GROW(x, nr, alloc) \ argument
40 if ((nr) > alloc) { \
41 if (alloc_nr(alloc) < (nr)) \
42 alloc = (nr); \
44 alloc = alloc_nr(alloc); \
45 x = xrealloc((x), alloc * sizeof(*(x))); \
/openbmc/linux/net/core/
H A Dpage_pool.c298 pool->alloc.cache[pool->alloc.count++] = page; in page_pool_refill_alloc_cache()
310 } while (pool->alloc.count < PP_ALLOC_CACHE_REFILL); in page_pool_refill_alloc_cache()
313 if (likely(pool->alloc.count > 0)) { in page_pool_refill_alloc_cache()
314 page = pool->alloc.cache[--pool->alloc.count]; in page_pool_refill_alloc_cache()
327 if (likely(pool->alloc.count)) { in __page_pool_get_cached()
329 page = pool->alloc.cache[--pool->alloc.count]; in __page_pool_get_cached()
430 if (unlikely(pool->alloc.count > 0)) in __page_pool_alloc_pages_slow()
431 return pool->alloc.cache[--pool->alloc.count]; in __page_pool_alloc_pages_slow()
434 memset(&pool->alloc.cache, 0, sizeof(void *) * bulk); in __page_pool_alloc_pages_slow()
437 pool->alloc.cache); in __page_pool_alloc_pages_slow()
[all …]

12345678910>>...32