| /freebsd-12-stable/contrib/processor-trace/libipt/src/ |
| D | pt_packet_decoder.c | 200 static inline int pkt_to_user(struct pt_packet *upkt, size_t size, in pkt_to_user() argument 210 if (sizeof(*pkt) < size) { in pkt_to_user() 211 memset(upkt + sizeof(*pkt), 0, size - sizeof(*pkt)); in pkt_to_user() 213 size = sizeof(*pkt); in pkt_to_user() 216 memcpy(upkt, pkt, size); in pkt_to_user() 226 int errcode, size; in pt_pkt_next() local 243 size = dfun->packet(decoder, ppkt); in pt_pkt_next() 244 if (size < 0) in pt_pkt_next() 245 return size; in pt_pkt_next() 251 decoder->pos += size; in pt_pkt_next() [all …]
|
| /freebsd-12-stable/sys/contrib/ncsw/etc/ |
| D | memcpy.c | 39 void * MemCpy8(void* pDst, void* pSrc, uint32_t size) in MemCpy8() argument 43 for(i = 0; i < size; ++i) in MemCpy8() 49 void * MemSet8(void* pDst, int c, uint32_t size) in MemSet8() argument 53 for(i = 0; i < size; ++i) in MemSet8() 59 void * MemCpy32(void* pDst,void* pSrc, uint32_t size) in MemCpy32() argument 76 while((PTR_TO_UINT(p_Src8) & 3) && size) /* (pSrc mod 4) > 0 and size > 0 */ in MemCpy32() 79 size--; in MemCpy32() 83 while((PTR_TO_UINT(p_Dst8) & 3) && size) /* (pDst mod 4) > 0 and size > 0 */ in MemCpy32() 86 size--; in MemCpy32() 99 while (size >> 2) /* size >= 4 */ in MemCpy32() [all …]
|
| /freebsd-12-stable/contrib/jemalloc/src/ |
| D | pages.c | 49 static void os_pages_unmap(void *addr, size_t size); 54 os_pages_map(void *addr, size_t size, size_t alignment, bool *commit) { in os_pages_map() argument 56 assert(ALIGNMENT_CEILING(size, os_page) == size); in os_pages_map() 57 assert(size != 0); in os_pages_map() 69 ret = VirtualAlloc(addr, size, MEM_RESERVE | (*commit ? MEM_COMMIT : 0), in os_pages_map() 79 ret = mmap(addr, size, prot, mmap_flags, -1, 0); in os_pages_map() 89 os_pages_unmap(ret, size); in os_pages_map() 99 os_pages_trim(void *addr, size_t alloc_size, size_t leadsize, size_t size, in os_pages_trim() argument 103 assert(alloc_size >= leadsize + size); in os_pages_trim() 106 void *new_addr = os_pages_map(ret, size, PAGE, commit); in os_pages_trim() [all …]
|
| /freebsd-12-stable/contrib/netbsd-tests/lib/libc/db/ |
| D | h_lfsr.c | 83 key.size = (len & 0xff) + 1; in main() 85 memset(kb, c, key.size); in main() 86 val.size = (next(&len) & 0xff) + 1; in main() 90 key.size, val.size, c); in main() 94 key.size, val.size, c); in main() 97 key.size, val.size, c); in main() 105 key.size = (len & 0xff) + 1; in main() 107 memset(kb, c, key.size); in main() 112 key.size, val.size, c); in main() 116 key.size, val.size, c); in main() [all …]
|
| /freebsd-12-stable/contrib/llvm-project/compiler-rt/lib/asan/ |
| D | asan_interceptors_memintrinsics.h | 21 DECLARE_REAL(void*, memcpy, void *to, const void *from, uptr size) in DECLARE_REAL() argument 22 DECLARE_REAL(void*, memset, void *block, int c, uptr size) in DECLARE_REAL() 28 static inline bool QuickCheckForUnpoisonedRegion(uptr beg, uptr size) { in DECLARE_REAL() 29 if (size == 0) return true; in DECLARE_REAL() 30 if (size <= 32) in DECLARE_REAL() 32 !AddressIsPoisoned(beg + size - 1) && in DECLARE_REAL() 33 !AddressIsPoisoned(beg + size / 2); in DECLARE_REAL() 34 if (size <= 64) in DECLARE_REAL() 36 !AddressIsPoisoned(beg + size / 4) && in DECLARE_REAL() 37 !AddressIsPoisoned(beg + size - 1) && in DECLARE_REAL() [all …]
|
| /freebsd-12-stable/sys/dev/qlnx/qlnxe/ |
| D | ecore_iro.h | 36 #define YSTORM_FLOW_CONTROL_MODE_SIZE (IRO[0].size) 39 #define TSTORM_PORT_STAT_SIZE (IRO[1].size) 42 #define TSTORM_LL2_PORT_STAT_SIZE (IRO[2].size) 45 #define USTORM_VF_PF_CHANNEL_READY_SIZE (IRO[3].size) 48 #define USTORM_FLR_FINAL_ACK_SIZE (IRO[4].size) 51 #define USTORM_EQE_CONS_SIZE (IRO[5].size) 54 #define USTORM_ETH_QUEUE_ZONE_SIZE (IRO[6].size) 57 #define USTORM_COMMON_QUEUE_CONS_SIZE (IRO[7].size) 60 #define XSTORM_INTEG_TEST_DATA_SIZE (IRO[8].size) 63 #define YSTORM_INTEG_TEST_DATA_SIZE (IRO[9].size) [all …]
|
| /freebsd-12-stable/contrib/llvm-project/compiler-rt/lib/dfsan/ |
| D | dfsan_allocator.cpp | 32 void OnMap(uptr p, uptr size) const { dfsan_set_label(0, (void *)p, size); } in OnMap() 33 void OnUnmap(uptr p, uptr size) const { dfsan_set_label(0, (void *)p, size); } in OnUnmap() 80 static void *DFsanAllocate(uptr size, uptr alignment, bool zeroise) { in DFsanAllocate() argument 81 if (size > max_malloc_size) { in DFsanAllocate() 84 size); in DFsanAllocate() 88 ReportAllocationSizeTooBig(size, max_malloc_size, &stack); in DFsanAllocate() 94 allocated = allocator.Allocate(cache, size, alignment); in DFsanAllocate() 98 allocated = allocator.Allocate(cache, size, alignment); in DFsanAllocate() 105 ReportOutOfMemory(size, &stack); in DFsanAllocate() 109 meta->requested_size = size; in DFsanAllocate() [all …]
|
| /freebsd-12-stable/sys/compat/linuxkpi/common/include/linux/ |
| D | slab.h | 46 #define kvmalloc(size, flags) kmalloc(size, flags) argument 47 #define kvzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) argument 48 #define kvcalloc(n, size, flags) kvmalloc_array(n, size, (flags) | __GFP_ZERO) argument 49 #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) argument 50 #define kzalloc_node(size, flags, node) kmalloc_node(size, (flags) | __GFP_ZERO, node) argument 52 #define vzalloc(size) __vmalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, 0) argument 55 #define vmalloc_node(size, node) __vmalloc_node(size, GFP_KERNEL, node) argument 56 #define vmalloc_user(size) __vmalloc(size, GFP_KERNEL | __GFP_ZERO, 0) argument 57 #define vmalloc(size) __vmalloc(size, GFP_KERNEL, 0) argument 109 kmalloc(size_t size, gfp_t flags) in kmalloc() argument [all …]
|
| D | bitmap.h | 36 bitmap_zero(unsigned long *addr, const unsigned int size) in bitmap_zero() argument 38 memset(addr, 0, BITS_TO_LONGS(size) * sizeof(long)); in bitmap_zero() 42 bitmap_fill(unsigned long *addr, const unsigned int size) in bitmap_fill() argument 44 const unsigned int tail = size & (BITS_PER_LONG - 1); in bitmap_fill() 46 memset(addr, 0xff, BIT_WORD(size) * sizeof(long)); in bitmap_fill() 49 addr[BIT_WORD(size)] = BITMAP_LAST_WORD_MASK(tail); in bitmap_fill() 53 bitmap_full(unsigned long *addr, const unsigned int size) in bitmap_full() argument 55 const unsigned int end = BIT_WORD(size); in bitmap_full() 56 const unsigned int tail = size & (BITS_PER_LONG - 1); in bitmap_full() 74 bitmap_empty(unsigned long *addr, const unsigned int size) in bitmap_empty() argument [all …]
|
| D | bitops.h | 115 find_first_bit(const unsigned long *addr, unsigned long size) in find_first_bit() argument 120 for (bit = 0; size >= BITS_PER_LONG; in find_first_bit() 121 size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { in find_first_bit() 126 if (size) { in find_first_bit() 127 mask = (*addr) & BITMAP_LAST_WORD_MASK(size); in find_first_bit() 131 bit += size; in find_first_bit() 137 find_first_zero_bit(const unsigned long *addr, unsigned long size) in find_first_zero_bit() argument 142 for (bit = 0; size >= BITS_PER_LONG; in find_first_zero_bit() 143 size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { in find_first_zero_bit() 148 if (size) { in find_first_zero_bit() [all …]
|
| /freebsd-12-stable/contrib/apr/encoding/ |
| D | apr_escape.c | 46 apr_size_t size = 1; in apr_escape_shell() local 71 size++; in apr_escape_shell() 75 size++; in apr_escape_shell() 82 size++; in apr_escape_shell() 85 size++; in apr_escape_shell() 91 *len = size; in apr_escape_shell() 143 apr_size_t size = 1; in apr_unescape_url() local 184 size += 2; in apr_unescape_url() 194 size++; in apr_unescape_url() 222 size += 2; in apr_unescape_url() [all …]
|
| /freebsd-12-stable/contrib/llvm-project/compiler-rt/lib/sanitizer_common/ |
| D | sanitizer_allocator.cpp | 30 extern "C" void *__libc_malloc(uptr size); 32 extern "C" void *__libc_memalign(uptr alignment, uptr size); 34 extern "C" void *__libc_realloc(void *ptr, uptr size); 40 static void *__libc_memalign(uptr alignment, uptr size) { in __libc_memalign() argument 42 uptr error = posix_memalign(&p, alignment, size); in __libc_memalign() 51 static void *RawInternalAlloc(uptr size, InternalAllocatorCache *cache, in RawInternalAlloc() argument 56 return __libc_malloc(size); in RawInternalAlloc() 58 return __libc_memalign(alignment, size); in RawInternalAlloc() 66 return __libc_malloc(size); in RawInternalAlloc() 70 static void *RawInternalRealloc(void *ptr, uptr size, in RawInternalRealloc() argument [all …]
|
| /freebsd-12-stable/contrib/llvm-project/compiler-rt/lib/memprof/ |
| D | memprof_interceptors_memintrinsics.h | 21 DECLARE_REAL(void *, memcpy, void *to, const void *from, uptr size) in DECLARE_REAL() argument 22 DECLARE_REAL(void *, memset, void *block, int c, uptr size) in DECLARE_REAL() 30 #define ACCESS_MEMORY_RANGE(offset, size) \ in DECLARE_REAL() argument 32 __memprof_record_access_range(offset, size); \ in DECLARE_REAL() 38 #define MEMPROF_MEMCPY_IMPL(to, from, size) \ in DECLARE_REAL() argument 41 return internal_memcpy(to, from, size); \ in DECLARE_REAL() 43 return REAL(memcpy)(to, from, size); \ in DECLARE_REAL() 46 MEMPROF_READ_RANGE(from, size); \ in DECLARE_REAL() 47 MEMPROF_WRITE_RANGE(to, size); \ in DECLARE_REAL() 48 return REAL(memcpy)(to, from, size); \ in DECLARE_REAL() [all …]
|
| /freebsd-12-stable/lib/libc/stdlib/ |
| D | heapsort.c | 62 #define SWAP(a, b, count, size, tmp) { \ argument 63 count = size; \ 72 #define COPY(a, b, count, size, tmp1, tmp2) { \ argument 73 count = size; \ 88 #define CREATE(initval, nmemb, par_i, child_i, par, child, size, count, tmp) { \ argument 91 child = base + child_i * size; \ 92 if (child_i < nmemb && COMPAR(child, child + size) < 0) { \ 93 child += size; \ 96 par = base + par_i * size; \ 99 SWAP(par, child, count, size, tmp); \ [all …]
|
| /freebsd-12-stable/contrib/llvm-project/compiler-rt/lib/hwasan/ |
| D | hwasan_allocation_functions.cpp | 39 int __sanitizer_posix_memalign(void **memptr, uptr alignment, uptr size) { in __sanitizer_posix_memalign() argument 42 int res = hwasan_posix_memalign(memptr, alignment, size, &stack); in __sanitizer_posix_memalign() 46 void *__sanitizer_memalign(uptr alignment, uptr size) { in __sanitizer_memalign() argument 48 return hwasan_memalign(alignment, size, &stack); in __sanitizer_memalign() 51 void *__sanitizer_aligned_alloc(uptr alignment, uptr size) { in __sanitizer_aligned_alloc() argument 53 return hwasan_aligned_alloc(alignment, size, &stack); in __sanitizer_aligned_alloc() 56 void *__sanitizer___libc_memalign(uptr alignment, uptr size) { in __sanitizer___libc_memalign() argument 58 void *ptr = hwasan_memalign(alignment, size, &stack); in __sanitizer___libc_memalign() 60 DTLS_on_libc_memalign(ptr, size); in __sanitizer___libc_memalign() 64 void *__sanitizer_valloc(uptr size) { in __sanitizer_valloc() argument [all …]
|
| /freebsd-12-stable/contrib/llvm-project/compiler-rt/lib/lsan/ |
| D | lsan_allocator.cpp | 60 static void RegisterAllocation(const StackTrace &stack, void *p, uptr size) { in RegisterAllocation() argument 66 m->requested_size = size; in RegisterAllocation() 77 static void *ReportAllocationSizeTooBig(uptr size, const StackTrace &stack) { in ReportAllocationSizeTooBig() argument 79 Report("WARNING: LeakSanitizer failed to allocate 0x%zx bytes\n", size); in ReportAllocationSizeTooBig() 82 ReportAllocationSizeTooBig(size, max_malloc_size, &stack); in ReportAllocationSizeTooBig() 85 void *Allocate(const StackTrace &stack, uptr size, uptr alignment, in Allocate() argument 87 if (size == 0) in Allocate() 88 size = 1; in Allocate() 89 if (size > max_malloc_size) in Allocate() 90 return ReportAllocationSizeTooBig(size, stack); in Allocate() [all …]
|
| /freebsd-12-stable/sbin/hastd/ |
| D | hast_compression.c | 46 allzeros(const void *data, size_t size) in allzeros() argument 52 PJDLOG_ASSERT((size % sizeof(*p)) == 0); in allzeros() 64 size >>= 3; /* divide by 8 */ in allzeros() 65 if ((p[0] | p[size >> 1] | p[size - 1]) != 0) in allzeros() 68 for (i = 0; i < size; i++) in allzeros() 76 uint32_t size; in hast_hole_compress() local 82 newbuf = malloc(sizeof(size)); in hast_hole_compress() 88 size = htole32((uint32_t)*sizep); in hast_hole_compress() 89 bcopy(&size, newbuf, sizeof(size)); in hast_hole_compress() 90 *sizep = sizeof(size); in hast_hole_compress() [all …]
|
| /freebsd-12-stable/contrib/llvm-project/compiler-rt/lib/msan/ |
| D | msan_allocator.cpp | 32 void OnMap(uptr p, uptr size) const {} in OnMap() 33 void OnUnmap(uptr p, uptr size) const { in OnUnmap() 34 __msan_unpoison((void *)p, size); in OnUnmap() 39 ReleaseMemoryPagesToOS(shadow_p, shadow_p + size); in OnUnmap() 42 ReleaseMemoryPagesToOS(origin_p, origin_p + size); in OnUnmap() 154 static void *MsanAllocate(StackTrace *stack, uptr size, uptr alignment, in MsanAllocate() argument 156 if (size > max_malloc_size) { in MsanAllocate() 158 Report("WARNING: MemorySanitizer failed to allocate 0x%zx bytes\n", size); in MsanAllocate() 161 ReportAllocationSizeTooBig(size, max_malloc_size, stack); in MsanAllocate() 167 allocated = allocator.Allocate(cache, size, alignment); in MsanAllocate() [all …]
|
| /freebsd-12-stable/crypto/heimdal/lib/asn1/ |
| D | der_get.c | 46 unsigned *ret, size_t *size) in der_get_unsigned() argument 59 if(size) *size = oldlen; in der_get_unsigned() 65 int *ret, size_t *size) in der_get_integer() argument 79 if(size) *size = oldlen; in der_get_integer() 85 size_t *val, size_t *size) in der_get_length() argument 95 if(size) *size = 1; in der_get_length() 103 if(size) *size = 1; in der_get_length() 112 if(size) *size = l + 1; in der_get_length() 118 der_get_boolean(const unsigned char *p, size_t len, int *data, size_t *size) in der_get_boolean() argument 126 *size = 1; in der_get_boolean() [all …]
|
| /freebsd-12-stable/tools/tools/crypto/ |
| D | cryptocheck.c | 377 ocf_hash(struct alg *alg, const char *buffer, size_t size, char *digest, in ocf_hash() argument 398 cop.len = size; in ocf_hash() 406 size, crfind(crid)); in ocf_hash() 421 size_t size, void *digest_out, unsigned *digest_sz_out) in openssl_hash() argument 437 rc = EVP_DigestUpdate(mdctx, buffer, size); in openssl_hash() 454 run_hash_test(struct alg *alg, size_t size) in run_hash_test() argument 468 buffer = alloc_buffer(size); in run_hash_test() 472 openssl_hash(alg, md, buffer, size, control_digest, &digest_len); in run_hash_test() 475 if (!ocf_hash(alg, buffer, size, test_digest, &crid)) in run_hash_test() 480 alg->name, size); in run_hash_test() [all …]
|
| /freebsd-12-stable/contrib/llvm-project/compiler-rt/lib/tsan/rtl/ |
| D | tsan_new_delete.cpp | 27 DECLARE_REAL(void *, malloc, uptr size) 33 return InternalAlloc(size); \ 36 SCOPED_INTERCEPTOR_RAW(mangled_name, size); \ 37 p = user_alloc(thr, pc, size); \ 40 ReportOutOfMemory(size, &stack); \ 43 invoke_malloc_hook(p, size); \ 48 return InternalAlloc(size, nullptr, (uptr)align); \ 51 SCOPED_INTERCEPTOR_RAW(mangled_name, size); \ 52 p = user_memalign(thr, pc, (uptr)align, size); \ 55 ReportOutOfMemory(size, &stack); \ [all …]
|
| D | tsan_malloc_mac.cpp | 27 #define COMMON_MALLOC_MEMALIGN(alignment, size) \ argument 29 user_memalign(cur_thread(), StackTrace::GetCurrentPc(), alignment, size) 30 #define COMMON_MALLOC_MALLOC(size) \ argument 31 if (in_symbolizer()) return InternalAlloc(size); \ 32 SCOPED_INTERCEPTOR_RAW(malloc, size); \ 33 void *p = user_alloc(thr, pc, size) 34 #define COMMON_MALLOC_REALLOC(ptr, size) \ argument 35 if (in_symbolizer()) return InternalRealloc(ptr, size); \ 36 SCOPED_INTERCEPTOR_RAW(realloc, ptr, size); \ 37 void *p = user_realloc(thr, pc, ptr, size) [all …]
|
| /freebsd-12-stable/sys/kern/ |
| D | kern_malloc.c | 250 u_long size; in sysctl_kmem_map_size() local 252 size = uma_size(); in sysctl_kmem_map_size() 253 return (sysctl_handle_long(oidp, &size, 0, req)); in sysctl_kmem_map_size() 259 u_long size, limit; in sysctl_kmem_map_free() local 262 size = uma_size(); in sysctl_kmem_map_free() 264 if (size > limit) in sysctl_kmem_map_free() 265 size = 0; in sysctl_kmem_map_free() 267 size = limit - size; in sysctl_kmem_map_free() 268 return (sysctl_handle_long(oidp, &size, 0, req)); in sysctl_kmem_map_free() 366 malloc_type_zone_allocated(struct malloc_type *mtp, unsigned long size, in malloc_type_zone_allocated() argument [all …]
|
| /freebsd-12-stable/sys/vm/ |
| D | vm_kern.c | 142 kva_alloc(vm_size_t size) in kva_alloc() argument 146 size = round_page(size); in kva_alloc() 147 if (vmem_alloc(kernel_arena, size, M_BESTFIT | M_NOWAIT, &addr)) in kva_alloc() 163 kva_free(vm_offset_t addr, vm_size_t size) in kva_free() argument 166 size = round_page(size); in kva_free() 167 vmem_free(kernel_arena, addr, size); in kva_free() 208 kmem_alloc_attr_domain(int domain, vm_size_t size, int flags, vm_paddr_t low, in kmem_alloc_attr_domain() argument 219 size = round_page(size); in kmem_alloc_attr_domain() 221 if (vmem_alloc(vmem, size, M_BESTFIT | flags, &addr)) in kmem_alloc_attr_domain() 227 for (i = 0; i < size; i += PAGE_SIZE) { in kmem_alloc_attr_domain() [all …]
|
| /freebsd-12-stable/usr.sbin/fifolog/fifolog_create/ |
| D | fifolog_create.c | 55 int64_t size; in main() local 61 size = 0; in main() 74 if (expand_number(optarg, &size)) in main() 86 if (size != 0 && reccnt != 0 && recsize != 0) { /* N N N */ in main() 87 if (size != reccnt * recsize) in main() 89 } else if (size != 0 && reccnt != 0 && recsize == 0) { /* N N Z */ in main() 90 if (size % reccnt) in main() 93 recsize = size / reccnt; in main() 94 } else if (size != 0 && reccnt == 0 && recsize != 0) { /* N Z N */ in main() 95 if (size % recsize) in main() [all …]
|