Searched refs:size (Results 1 - 200 of 11143) sorted by relevance

1234567891011>>

/linux-4.1.27/arch/cris/kernel/
H A Ddevicetree.c5 void __init early_init_dt_add_memory_arch(u64 base, u64 size) early_init_dt_add_memory_arch() argument
8 __func__, base, size); early_init_dt_add_memory_arch()
11 void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) early_init_dt_alloc_memory_arch() argument
13 return alloc_bootmem_align(size, align); early_init_dt_alloc_memory_arch()
/linux-4.1.27/drivers/gpu/drm/nouveau/include/nvif/
H A Dunpack.h5 ret = (size == sizeof(d)) ? 0 : -ENOSYS; \
12 if (_size <= size && (d).version >= (vl) && \
15 size = size - _size; \
16 ret = ((m) || !size) ? 0 : -E2BIG; \
/linux-4.1.27/include/acpi/
H A Dacpi_io.h10 acpi_size size) acpi_os_ioremap()
12 return ioremap_cache(phys, size); acpi_os_ioremap()
17 acpi_os_map_iomem(acpi_physical_address phys, acpi_size size);
18 void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size);
19 void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size);
9 acpi_os_ioremap(acpi_physical_address phys, acpi_size size) acpi_os_ioremap() argument
/linux-4.1.27/arch/arm/plat-omap/include/plat/
H A Dsram.h3 void omap_map_sram(unsigned long start, unsigned long size,
7 extern void *omap_sram_push_address(unsigned long size);
10 #define omap_sram_push(funcp, size) ({ \
12 void *_sram_address = omap_sram_push_address(size); \
14 _res = fncpy(_sram_address, &(funcp), size); \
/linux-4.1.27/tools/perf/
H A Dperf-read-vdso.c15 size_t size, written; main() local
20 size = end - start; main()
22 while (size) { main()
23 written = fwrite(start, 1, size, stdout); main()
27 size -= written; main()
/linux-4.1.27/lib/
H A Dsort.c11 static void u32_swap(void *a, void *b, int size) u32_swap() argument
18 static void generic_swap(void *a, void *b, int size) generic_swap() argument
26 } while (--size > 0); generic_swap()
33 * @size: size of each element
46 void sort(void *base, size_t num, size_t size, sort() argument
48 void (*swap_func)(void *, void *, int size)) sort()
51 int i = (num/2 - 1) * size, n = num * size, c, r; sort()
54 swap_func = (size == 4 ? u32_swap : generic_swap); sort()
57 for ( ; i >= 0; i -= size) { sort()
58 for (r = i; r * 2 + size < n; r = c) { sort()
59 c = r * 2 + size; sort()
60 if (c < n - size && sort()
61 cmp_func(base + c, base + c + size) < 0) sort()
62 c += size; sort()
65 swap_func(base + r, base + c, size); sort()
70 for (i = n - size; i > 0; i -= size) { sort()
71 swap_func(base, base + i, size); sort()
72 for (r = 0; r * 2 + size < i; r = c) { sort()
73 c = r * 2 + size; sort()
74 if (c < i - size && sort()
75 cmp_func(base + c, base + c + size) < 0) sort()
76 c += size; sort()
79 swap_func(base + r, base + c, size); sort()
H A Dtest_kasan.c23 size_t size = 123; kmalloc_oob_right() local
26 ptr = kmalloc(size, GFP_KERNEL); kmalloc_oob_right()
32 ptr[size] = 'x'; kmalloc_oob_right()
39 size_t size = 15; kmalloc_oob_left() local
42 ptr = kmalloc(size, GFP_KERNEL); kmalloc_oob_left()
55 size_t size = 4096; kmalloc_node_oob_right() local
58 ptr = kmalloc_node(size, GFP_KERNEL, 0); kmalloc_node_oob_right()
64 ptr[size] = 0; kmalloc_node_oob_right()
71 size_t size = KMALLOC_MAX_CACHE_SIZE + 10; kmalloc_large_oob_rigth() local
74 ptr = kmalloc(size, GFP_KERNEL); kmalloc_large_oob_rigth()
80 ptr[size] = 0; kmalloc_large_oob_rigth()
144 size_t size = 666; kmalloc_oob_in_memset() local
147 ptr = kmalloc(size, GFP_KERNEL); kmalloc_oob_in_memset()
153 memset(ptr, 0, size+5); kmalloc_oob_in_memset()
160 size_t size = 10; kmalloc_uaf() local
163 ptr = kmalloc(size, GFP_KERNEL); kmalloc_uaf()
176 size_t size = 33; kmalloc_uaf_memset() local
179 ptr = kmalloc(size, GFP_KERNEL); kmalloc_uaf_memset()
186 memset(ptr, 0, size); kmalloc_uaf_memset()
192 size_t size = 43; kmalloc_uaf2() local
195 ptr1 = kmalloc(size, GFP_KERNEL); kmalloc_uaf2()
202 ptr2 = kmalloc(size, GFP_KERNEL); kmalloc_uaf2()
215 size_t size = 200; kmem_cache_oob() local
217 size, 0, kmem_cache_oob()
231 *p = p[size]; kmem_cache_oob()
H A Diommu-helper.c19 unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, iommu_area_alloc() argument
27 size -= 1; iommu_area_alloc()
29 index = bitmap_find_next_zero_area(map, size, start, nr, align_mask); iommu_area_alloc()
30 if (index < size) { iommu_area_alloc()
H A Dfind_bit.c11 * size and improve performance, 2015.
61 unsigned long find_next_bit(const unsigned long *addr, unsigned long size, find_next_bit() argument
64 return _find_next_bit(addr, size, offset, 0UL); find_next_bit()
70 unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, find_next_zero_bit() argument
73 return _find_next_bit(addr, size, offset, ~0UL); find_next_zero_bit()
82 unsigned long find_first_bit(const unsigned long *addr, unsigned long size) find_first_bit() argument
86 for (idx = 0; idx * BITS_PER_LONG < size; idx++) { find_first_bit()
88 return min(idx * BITS_PER_LONG + __ffs(addr[idx]), size); find_first_bit()
91 return size; find_first_bit()
100 unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size) find_first_zero_bit() argument
104 for (idx = 0; idx * BITS_PER_LONG < size; idx++) { find_first_zero_bit()
106 return min(idx * BITS_PER_LONG + ffz(addr[idx]), size); find_first_zero_bit()
109 return size; find_first_zero_bit()
115 unsigned long find_last_bit(const unsigned long *addr, unsigned long size) find_last_bit() argument
117 if (size) { find_last_bit()
118 unsigned long val = BITMAP_LAST_WORD_MASK(size); find_last_bit()
119 unsigned long idx = (size-1) / BITS_PER_LONG; find_last_bit()
129 return size; find_last_bit()
177 long size, unsigned long offset) find_next_zero_bit_le()
179 return _find_next_bit_le(addr, size, offset, ~0UL); find_next_zero_bit_le()
186 long size, unsigned long offset) find_next_bit_le()
188 return _find_next_bit_le(addr, size, offset, 0UL); find_next_bit_le()
176 find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset) find_next_zero_bit_le() argument
185 find_next_bit_le(const void *addr, unsigned long size, unsigned long offset) find_next_bit_le() argument
/linux-4.1.27/arch/x86/mm/kmemcheck/
H A Dshadow.h13 enum kmemcheck_shadow kmemcheck_shadow_test(void *shadow, unsigned int size);
15 unsigned int size);
16 void kmemcheck_shadow_set(void *shadow, unsigned int size);
H A Dopcode.h6 void kmemcheck_opcode_decode(const uint8_t *op, unsigned int *size);
H A Dopcode.c34 * This is a VERY crude opcode decoder. We only need to find the size of the
39 void kmemcheck_opcode_decode(const uint8_t *op, unsigned int *size) kmemcheck_opcode_decode() argument
41 /* Default operand size */ kmemcheck_opcode_decode()
58 *size = 4; kmemcheck_opcode_decode()
66 *size = 1; kmemcheck_opcode_decode()
70 *size = 2; kmemcheck_opcode_decode()
77 *size = 8; kmemcheck_opcode_decode()
95 *size = (*op & 1) ? operand_size_override : 1; kmemcheck_opcode_decode()
/linux-4.1.27/arch/s390/mm/
H A Dmem_detect.c22 static inline void memblock_physmem_add(phys_addr_t start, phys_addr_t size) memblock_physmem_add() argument
24 memblock_add_range(&memblock.memory, start, size, 0, 0); memblock_physmem_add()
25 memblock_add_range(&memblock.physmem, start, size, 0, 0); memblock_physmem_add()
31 unsigned long addr, size; detect_memory_memblock() local
44 size = 0; detect_memory_memblock()
47 size += rzm; detect_memory_memblock()
48 if (max_physmem_end && addr + size >= max_physmem_end) detect_memory_memblock()
50 } while (type == tprot(addr + size)); detect_memory_memblock()
52 if (max_physmem_end && (addr + size > max_physmem_end)) detect_memory_memblock()
53 size = max_physmem_end - addr; detect_memory_memblock()
54 memblock_physmem_add(addr, size); detect_memory_memblock()
56 addr += size; detect_memory_memblock()
/linux-4.1.27/arch/powerpc/lib/
H A Dalloc.c9 void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask) zalloc_maybe_bootmem() argument
14 p = kzalloc(size, mask); zalloc_maybe_bootmem()
16 p = memblock_virt_alloc(size, 0); zalloc_maybe_bootmem()
H A Drheap.c139 blk->size = 0; get_slot()
157 int size; attach_free_block() local
162 size = blkn->size; attach_free_block()
164 e = s + size; attach_free_block()
176 be = bs + blk->size; attach_free_block()
193 if (before && s != (before->start + before->size)) attach_free_block()
215 before->size += size; attach_free_block()
221 after->start -= size; attach_free_block()
222 after->size += size; attach_free_block()
227 before->size += size + after->size; attach_free_block()
329 int rh_attach_region(rh_info_t * info, unsigned long start, int size) rh_attach_region() argument
337 e = s + size; rh_attach_region()
351 size = e - s; rh_attach_region()
360 blk->size = size; rh_attach_region()
370 unsigned long rh_detach_region(rh_info_t * info, unsigned long start, int size) rh_detach_region() argument
376 /* Validate size */ rh_detach_region()
377 if (size <= 0) rh_detach_region()
382 e = s + size; rh_detach_region()
399 be = blk->start + blk->size; rh_detach_region()
416 /* blk still in free list, with updated start and/or size */ rh_detach_region()
419 blk->start += size; rh_detach_region()
420 blk->size -= size; rh_detach_region()
424 blk->size = s - bs; rh_detach_region()
429 newblk->size = be - e; rh_detach_region()
442 unsigned long rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owner) rh_alloc_align() argument
449 /* Validate size, and alignment must be power of two */ rh_alloc_align()
450 if (size <= 0 || (alignment & (alignment - 1)) != 0) rh_alloc_align()
454 size = (size + (info->alignment - 1)) & ~(info->alignment - 1); rh_alloc_align()
462 if (size <= blk->size) { rh_alloc_align()
464 if (start + size <= blk->start + blk->size) rh_alloc_align()
474 if (blk->size == size) { rh_alloc_align()
487 spblk->size = sp_size; rh_alloc_align()
493 newblk->size = size; rh_alloc_align()
495 /* blk still in free list, with updated start and size rh_alloc_align()
497 blk->start = start + size; rh_alloc_align()
498 blk->size -= sp_size + size; rh_alloc_align()
500 if (blk->size == 0) { rh_alloc_align()
517 unsigned long rh_alloc(rh_info_t * info, int size, const char *owner) rh_alloc() argument
519 return rh_alloc_align(info, size, info->alignment, owner); rh_alloc()
527 unsigned long rh_alloc_fixed(rh_info_t * info, unsigned long start, int size, const char *owner) rh_alloc_fixed() argument
533 /* Validate size */ rh_alloc_fixed()
534 if (size <= 0) rh_alloc_fixed()
539 e = s + size; rh_alloc_fixed()
556 be = blk->start + blk->size; rh_alloc_fixed()
578 /* blk still in free list, with updated start and/or size */ rh_alloc_fixed()
581 blk->start += size; rh_alloc_fixed()
582 blk->size -= size; rh_alloc_fixed()
586 blk->size = s - bs; rh_alloc_fixed()
591 newblk2->size = be - e; rh_alloc_fixed()
598 newblk1->size = e - s; rh_alloc_fixed()
609 * The return value is the size of the deallocated block, or a negative number
616 int size; rh_free() local
627 if (blk == NULL || start > (blk->start + blk->size)) rh_free()
633 /* Get size of freed block */ rh_free()
634 size = blk->size; rh_free()
637 return size; rh_free()
668 stats->size = blk->size; list_for_each()
683 int size; rh_set_owner() local
694 if (blk == NULL || start > (blk->start + blk->size)) rh_set_owner()
698 size = blk->size; rh_set_owner()
700 return size; rh_set_owner()
723 st[i].start, st[i].start + st[i].size, rh_dump()
724 st[i].size); rh_dump()
734 st[i].start, st[i].start + st[i].size, rh_dump()
735 st[i].size, st[i].owner != NULL ? st[i].owner : ""); rh_dump()
744 blk, blk->start, blk->start + blk->size, blk->size); rh_dump_blk()
/linux-4.1.27/arch/blackfin/include/asm/
H A Dclkdev.h6 static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size) __clkdev_alloc() argument
8 return kzalloc(size, GFP_KERNEL); __clkdev_alloc()
H A Ddma-mapping.h13 void *dma_alloc_coherent(struct device *dev, size_t size,
15 void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
43 __dma_sync(dma_addr_t addr, size_t size, enum dma_data_direction dir);
45 __dma_sync_inline(dma_addr_t addr, size_t size, enum dma_data_direction dir) __dma_sync_inline() argument
51 flush_dcache_range(addr, addr + size); __dma_sync_inline()
56 invalidate_dcache_range(addr, addr + size); __dma_sync_inline()
61 _dma_sync(dma_addr_t addr, size_t size, enum dma_data_direction dir) _dma_sync() argument
64 __dma_sync_inline(addr, size, dir); _dma_sync()
66 __dma_sync(addr, size, dir); _dma_sync()
70 dma_map_single(struct device *dev, void *ptr, size_t size, dma_map_single() argument
73 _dma_sync((dma_addr_t)ptr, size, dir); dma_map_single()
79 unsigned long offset, size_t size, dma_map_page()
82 return dma_map_single(dev, page_address(page) + offset, size, dir); dma_map_page()
86 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, dma_unmap_single() argument
93 dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, dma_unmap_page() argument
96 dma_unmap_single(dev, dma_addr, size, dir); dma_unmap_page()
111 unsigned long offset, size_t size, dma_sync_single_range_for_cpu()
119 unsigned long offset, size_t size, dma_sync_single_range_for_device()
122 _dma_sync(handle + offset, size, dir); dma_sync_single_range_for_device()
126 dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, dma_sync_single_for_cpu() argument
129 dma_sync_single_range_for_cpu(dev, handle, 0, size, dir); dma_sync_single_for_cpu()
133 dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, dma_sync_single_for_device() argument
136 dma_sync_single_range_for_device(dev, handle, 0, size, dir); dma_sync_single_for_device()
151 dma_cache_sync(struct device *dev, void *vaddr, size_t size, dma_cache_sync() argument
154 _dma_sync((dma_addr_t)vaddr, size, dir); dma_cache_sync()
159 void *cpu_addr, dma_addr_t dma_addr, size_t size);
162 size_t size);
78 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
110 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t handle, unsigned long offset, size_t size, enum dma_data_direction dir) dma_sync_single_range_for_cpu() argument
118 dma_sync_single_range_for_device(struct device *dev, dma_addr_t handle, unsigned long offset, size_t size, enum dma_data_direction dir) dma_sync_single_range_for_device() argument
/linux-4.1.27/arch/ia64/include/uapi/asm/
H A Dustack.h5 * Constants for the user stack size
9 /* Make a default stack size of 2GiB */
/linux-4.1.27/arch/m68k/include/asm/
H A Dnubus.h19 unsigned long size) nubus_remap_nocache_ser()
21 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); nubus_remap_nocache_ser()
25 unsigned long size) nubus_remap_nocache_nonser()
27 return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER); nubus_remap_nocache_nonser()
31 unsigned long size) nbus_remap_writethrough()
33 return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); nbus_remap_writethrough()
37 unsigned long size) nubus_remap_fullcache()
39 return __ioremap(physaddr, size, IOMAP_FULL_CACHING); nubus_remap_fullcache()
18 nubus_remap_nocache_ser(unsigned long physaddr, unsigned long size) nubus_remap_nocache_ser() argument
24 nubus_remap_nocache_nonser(unsigned long physaddr, unsigned long size) nubus_remap_nocache_nonser() argument
30 nbus_remap_writethrough(unsigned long physaddr, unsigned long size) nbus_remap_writethrough() argument
36 nubus_remap_fullcache(unsigned long physaddr, unsigned long size) nubus_remap_fullcache() argument
H A Dzorro.h19 unsigned long size) z_remap_nocache_ser()
21 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); z_remap_nocache_ser()
25 unsigned long size) z_remap_nocache_nonser()
27 return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER); z_remap_nocache_nonser()
31 unsigned long size) z_remap_writethrough()
33 return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); z_remap_writethrough()
36 unsigned long size) z_remap_fullcache()
38 return __ioremap(physaddr, size, IOMAP_FULL_CACHING); z_remap_fullcache()
18 z_remap_nocache_ser(unsigned long physaddr, unsigned long size) z_remap_nocache_ser() argument
24 z_remap_nocache_nonser(unsigned long physaddr, unsigned long size) z_remap_nocache_nonser() argument
30 z_remap_writethrough(unsigned long physaddr, unsigned long size) z_remap_writethrough() argument
35 z_remap_fullcache(unsigned long physaddr, unsigned long size) z_remap_fullcache() argument
H A Ddma-mapping.h23 static inline void *dma_alloc_attrs(struct device *dev, size_t size, dma_alloc_attrs() argument
28 return dma_alloc_coherent(dev, size, dma_handle, flag); dma_alloc_attrs()
31 static inline void dma_free_attrs(struct device *dev, size_t size, dma_free_attrs() argument
36 dma_free_coherent(dev, size, cpu_addr, dma_handle); dma_free_attrs()
39 static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, dma_alloc_noncoherent() argument
42 return dma_alloc_coherent(dev, size, handle, flag); dma_alloc_noncoherent()
44 static inline void dma_free_noncoherent(struct device *dev, size_t size, dma_free_noncoherent() argument
47 dma_free_coherent(dev, size, addr, handle); dma_free_noncoherent()
49 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, dma_cache_sync() argument
58 size_t size, enum dma_data_direction dir) dma_unmap_single()
63 unsigned long, size_t size,
66 size_t size, enum dma_data_direction dir) dma_unmap_page()
83 dma_addr_t dma_handle, unsigned long offset, size_t size, dma_sync_single_range_for_device()
87 dma_sync_single_for_device(dev, dma_handle, offset + size, direction); dma_sync_single_range_for_device()
91 size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu()
101 dma_addr_t dma_handle, unsigned long offset, size_t size, dma_sync_single_range_for_cpu()
105 dma_sync_single_for_cpu(dev, dma_handle, offset + size, direction); dma_sync_single_range_for_cpu()
115 void *cpu_addr, dma_addr_t dma_addr, size_t size);
118 size_t size);
57 dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) dma_unmap_single() argument
65 dma_unmap_page(struct device *dev, dma_addr_t address, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
82 dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_device() argument
90 dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu() argument
100 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_cpu() argument
H A Dflat.h10 #define flat_reloc_valid(reloc, size) ((reloc) <= (size))
H A Dmcfdma.h47 #define MCFDMA_DCR_SSIZE_MASK 0x0030 /* Src xfer size */
48 #define MCFDMA_DCR_SSIZE_LONG 0x0000 /* Src xfer size, 00 = longw */
49 #define MCFDMA_DCR_SSIZE_BYTE 0x0010 /* Src xfer size, 01 = byte */
50 #define MCFDMA_DCR_SSIZE_WORD 0x0020 /* Src xfer size, 10 = word */
51 #define MCFDMA_DCR_SSIZE_LINE 0x0030 /* Src xfer size, 11 = line */
53 #define MCFDMA_DCR_DSIZE_MASK 0x0006 /* Dest xfer size */
54 #define MCFDMA_DCR_DSIZE_LONG 0x0000 /* Dest xfer size, 00 = long */
55 #define MCFDMA_DCR_DSIZE_BYTE 0x0002 /* Dest xfer size, 01 = byte */
56 #define MCFDMA_DCR_DSIZE_WORD 0x0004 /* Dest xfer size, 10 = word */
57 #define MCFDMA_DCR_DSIZE_LINE 0x0006 /* Dest xfer size, 11 = line */
90 #define MCFDMA_DMR_DSTS_OFF 0x8 /* offset to the destination size bits */
91 #define MCFDMA_DMR_DSTS_LONG 0x00000000L /* Long destination size */
92 #define MCFDMA_DMR_DSTS_BYTE 0x00000100L /* Byte destination size */
93 #define MCFDMA_DMR_DSTS_WORD 0x00000200L /* Word destination size */
94 #define MCFDMA_DMR_DSTS_LINE 0x00000300L /* Line destination size */
102 #define MCFDMA_DMR_SRCS_OFF 0x0 /* Offset to the source size bits */
103 #define MCFDMA_DMR_SRCS_LONG 0x00000000L /* Long source size */
104 #define MCFDMA_DMR_SRCS_BYTE 0x00000001L /* Byte source size */
105 #define MCFDMA_DMR_SRCS_WORD 0x00000002L /* Word source size */
106 #define MCFDMA_DMR_SRCS_LINE 0x00000003L /* Line source size */
/linux-4.1.27/include/asm-generic/bitops/
H A Dfind.h9 * @size: The bitmap size in bits
12 * If no bits are set, returns @size.
15 size, unsigned long offset);
23 * @size: The bitmap size in bits
26 * If no bits are zero, returns @size.
29 long size, unsigned long offset);
37 * @size: The maximum number of bits to search
40 * If no bits are set, returns @size.
43 unsigned long size);
48 * @size: The maximum number of bits to search
51 * If no bits are zero, returns @size.
54 unsigned long size);
57 #define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
58 #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
H A Dle.h12 unsigned long size, unsigned long offset) find_next_zero_bit_le()
14 return find_next_zero_bit(addr, size, offset); find_next_zero_bit_le()
18 unsigned long size, unsigned long offset) find_next_bit_le()
20 return find_next_bit(addr, size, offset); find_next_bit_le()
24 unsigned long size) find_first_zero_bit_le()
26 return find_first_zero_bit(addr, size); find_first_zero_bit_le()
35 unsigned long size, unsigned long offset);
40 unsigned long size, unsigned long offset);
44 #define find_first_zero_bit_le(addr, size) \
45 find_next_zero_bit_le((addr), (size), 0)
11 find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset) find_next_zero_bit_le() argument
17 find_next_bit_le(const void *addr, unsigned long size, unsigned long offset) find_next_bit_le() argument
23 find_first_zero_bit_le(const void *addr, unsigned long size) find_first_zero_bit_le() argument
/linux-4.1.27/include/linux/
H A Dcirc_buf.h15 #define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size)-1))
17 /* Return space available, 0..size-1. We always leave one free char
20 #define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size))
25 #define CIRC_CNT_TO_END(head,tail,size) \
26 ({int end = (size) - (tail); \
27 int n = ((head) + end) & ((size)-1); \
31 #define CIRC_SPACE_TO_END(head,tail,size) \
32 ({int end = (size) - 1 - (head); \
33 int n = (end + (tail)) & ((size)-1); \
H A Dbootmem.h54 unsigned long size);
55 extern void free_bootmem(unsigned long physaddr, unsigned long size);
56 extern void free_bootmem_late(unsigned long physaddr, unsigned long size);
70 unsigned long size,
74 unsigned long size,
77 extern void *__alloc_bootmem(unsigned long size,
80 extern void *__alloc_bootmem_nopanic(unsigned long size,
84 unsigned long size,
88 unsigned long size,
92 unsigned long size,
96 unsigned long size,
100 extern void *__alloc_bootmem_low(unsigned long size,
103 void *__alloc_bootmem_low_nopanic(unsigned long size,
107 unsigned long size,
154 void *memblock_virt_alloc_try_nid_nopanic(phys_addr_t size,
157 void *memblock_virt_alloc_try_nid(phys_addr_t size, phys_addr_t align,
159 void __memblock_free_early(phys_addr_t base, phys_addr_t size);
160 void __memblock_free_late(phys_addr_t base, phys_addr_t size);
163 phys_addr_t size, phys_addr_t align) memblock_virt_alloc()
165 return memblock_virt_alloc_try_nid(size, align, BOOTMEM_LOW_LIMIT, memblock_virt_alloc()
171 phys_addr_t size, phys_addr_t align) memblock_virt_alloc_nopanic()
173 return memblock_virt_alloc_try_nid_nopanic(size, align, memblock_virt_alloc_nopanic()
184 phys_addr_t size, phys_addr_t align) memblock_virt_alloc_low()
186 return memblock_virt_alloc_try_nid(size, align, memblock_virt_alloc_low()
192 phys_addr_t size, phys_addr_t align) memblock_virt_alloc_low_nopanic()
194 return memblock_virt_alloc_try_nid_nopanic(size, align, memblock_virt_alloc_low_nopanic()
201 phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) memblock_virt_alloc_from_nopanic()
203 return memblock_virt_alloc_try_nid_nopanic(size, align, min_addr, memblock_virt_alloc_from_nopanic()
209 phys_addr_t size, int nid) memblock_virt_alloc_node()
211 return memblock_virt_alloc_try_nid(size, 0, BOOTMEM_LOW_LIMIT, memblock_virt_alloc_node()
216 phys_addr_t size, int nid) memblock_virt_alloc_node_nopanic()
218 return memblock_virt_alloc_try_nid_nopanic(size, 0, BOOTMEM_LOW_LIMIT, memblock_virt_alloc_node_nopanic()
224 phys_addr_t base, phys_addr_t size) memblock_free_early()
226 __memblock_free_early(base, size); memblock_free_early()
230 phys_addr_t base, phys_addr_t size, int nid) memblock_free_early_nid()
232 __memblock_free_early(base, size); memblock_free_early_nid()
236 phys_addr_t base, phys_addr_t size) memblock_free_late()
238 __memblock_free_late(base, size); memblock_free_late()
248 phys_addr_t size, phys_addr_t align) memblock_virt_alloc()
252 return __alloc_bootmem(size, align, BOOTMEM_LOW_LIMIT); memblock_virt_alloc()
256 phys_addr_t size, phys_addr_t align) memblock_virt_alloc_nopanic()
260 return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT); memblock_virt_alloc_nopanic()
264 phys_addr_t size, phys_addr_t align) memblock_virt_alloc_low()
268 return __alloc_bootmem_low(size, align, 0); memblock_virt_alloc_low()
272 phys_addr_t size, phys_addr_t align) memblock_virt_alloc_low_nopanic()
276 return __alloc_bootmem_low_nopanic(size, align, 0); memblock_virt_alloc_low_nopanic()
280 phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) memblock_virt_alloc_from_nopanic()
282 return __alloc_bootmem_nopanic(size, align, min_addr); memblock_virt_alloc_from_nopanic()
286 phys_addr_t size, int nid) memblock_virt_alloc_node()
288 return __alloc_bootmem_node(NODE_DATA(nid), size, SMP_CACHE_BYTES, memblock_virt_alloc_node()
293 phys_addr_t size, int nid) memblock_virt_alloc_node_nopanic()
295 return __alloc_bootmem_node_nopanic(NODE_DATA(nid), size, memblock_virt_alloc_node_nopanic()
300 static inline void * __init memblock_virt_alloc_try_nid(phys_addr_t size, memblock_virt_alloc_try_nid() argument
303 return __alloc_bootmem_node_high(NODE_DATA(nid), size, align, memblock_virt_alloc_try_nid()
308 phys_addr_t size, phys_addr_t align, memblock_virt_alloc_try_nid_nopanic()
311 return ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align, memblock_virt_alloc_try_nid_nopanic()
316 phys_addr_t base, phys_addr_t size) memblock_free_early()
318 free_bootmem(base, size); memblock_free_early()
322 phys_addr_t base, phys_addr_t size, int nid) memblock_free_early_nid()
324 free_bootmem_node(NODE_DATA(nid), base, size); memblock_free_early_nid() local
328 phys_addr_t base, phys_addr_t size) memblock_free_late()
330 free_bootmem_late(base, size); memblock_free_late()
335 extern void *alloc_remap(int nid, unsigned long size);
337 static inline void *alloc_remap(int nid, unsigned long size) alloc_remap() argument
162 memblock_virt_alloc( phys_addr_t size, phys_addr_t align) memblock_virt_alloc() argument
170 memblock_virt_alloc_nopanic( phys_addr_t size, phys_addr_t align) memblock_virt_alloc_nopanic() argument
183 memblock_virt_alloc_low( phys_addr_t size, phys_addr_t align) memblock_virt_alloc_low() argument
191 memblock_virt_alloc_low_nopanic( phys_addr_t size, phys_addr_t align) memblock_virt_alloc_low_nopanic() argument
200 memblock_virt_alloc_from_nopanic( phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) memblock_virt_alloc_from_nopanic() argument
208 memblock_virt_alloc_node( phys_addr_t size, int nid) memblock_virt_alloc_node() argument
215 memblock_virt_alloc_node_nopanic( phys_addr_t size, int nid) memblock_virt_alloc_node_nopanic() argument
223 memblock_free_early( phys_addr_t base, phys_addr_t size) memblock_free_early() argument
229 memblock_free_early_nid( phys_addr_t base, phys_addr_t size, int nid) memblock_free_early_nid() argument
235 memblock_free_late( phys_addr_t base, phys_addr_t size) memblock_free_late() argument
247 memblock_virt_alloc( phys_addr_t size, phys_addr_t align) memblock_virt_alloc() argument
255 memblock_virt_alloc_nopanic( phys_addr_t size, phys_addr_t align) memblock_virt_alloc_nopanic() argument
263 memblock_virt_alloc_low( phys_addr_t size, phys_addr_t align) memblock_virt_alloc_low() argument
271 memblock_virt_alloc_low_nopanic( phys_addr_t size, phys_addr_t align) memblock_virt_alloc_low_nopanic() argument
279 memblock_virt_alloc_from_nopanic( phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) memblock_virt_alloc_from_nopanic() argument
285 memblock_virt_alloc_node( phys_addr_t size, int nid) memblock_virt_alloc_node() argument
292 memblock_virt_alloc_node_nopanic( phys_addr_t size, int nid) memblock_virt_alloc_node_nopanic() argument
307 memblock_virt_alloc_try_nid_nopanic( phys_addr_t size, phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid) memblock_virt_alloc_try_nid_nopanic() argument
315 memblock_free_early( phys_addr_t base, phys_addr_t size) memblock_free_early() argument
321 memblock_free_early_nid( phys_addr_t base, phys_addr_t size, int nid) memblock_free_early_nid() argument
327 memblock_free_late( phys_addr_t base, phys_addr_t size) memblock_free_late() argument
H A Dnfs.h19 unsigned short size; member in struct:nfs_fh
24 * Returns a zero iff the size and data fields match.
25 * Checks only "size" bytes in the data field.
29 return a->size != b->size || memcmp(a->data, b->data, a->size) != 0; nfs_compare_fh()
34 target->size = source->size; nfs_copy_fh()
35 memcpy(target->data, source->data, source->size); nfs_copy_fh()
H A Diommu-helper.h6 static inline unsigned long iommu_device_max_index(unsigned long size, iommu_device_max_index() argument
10 if (size + offset > dma_mask) iommu_device_max_index()
13 return size; iommu_device_max_index()
19 extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
29 unsigned long size = (addr & (io_page_size - 1)) + len; iommu_num_pages() local
31 return DIV_ROUND_UP(size, io_page_size); iommu_num_pages()
H A Dposix_acl_xattr.h45 posix_acl_xattr_count(size_t size) posix_acl_xattr_count() argument
47 if (size < sizeof(posix_acl_xattr_header)) posix_acl_xattr_count()
49 size -= sizeof(posix_acl_xattr_header); posix_acl_xattr_count()
50 if (size % sizeof(posix_acl_xattr_entry)) posix_acl_xattr_count()
52 return size / sizeof(posix_acl_xattr_entry); posix_acl_xattr_count()
56 void posix_acl_fix_xattr_from_user(void *value, size_t size);
57 void posix_acl_fix_xattr_to_user(void *value, size_t size);
59 static inline void posix_acl_fix_xattr_from_user(void *value, size_t size) posix_acl_fix_xattr_from_user() argument
62 static inline void posix_acl_fix_xattr_to_user(void *value, size_t size) posix_acl_fix_xattr_to_user() argument
68 const void *value, size_t size);
70 const struct posix_acl *acl, void *buffer, size_t size);
H A Dtty_flip.h6 extern int tty_buffer_request_room(struct tty_port *port, size_t size);
8 const unsigned char *chars, const char *flags, size_t size);
10 const unsigned char *chars, char flag, size_t size);
12 unsigned char **chars, size_t size);
23 if (!change && tb->used < tb->size) { tty_insert_flip_char()
33 const unsigned char *chars, size_t size) tty_insert_flip_string()
35 return tty_insert_flip_string_fixed_flag(port, chars, TTY_NORMAL, size); tty_insert_flip_string()
32 tty_insert_flip_string(struct tty_port *port, const unsigned char *chars, size_t size) tty_insert_flip_string() argument
H A Dlz4.h17 * Provides the maximum size that LZ4 may output in a "worst case" scenario
28 * src_len : size of the original data
30 * This requires 'dst' of size LZ4_COMPRESSBOUND.
31 * dst_len : is the output size, which is returned after compress done
33 * This requires 'workmem' of size LZ4_MEM_COMPRESS.
37 * the defined size.
45 * src_len : size of the original data
47 * This requires 'dst' of size LZ4_COMPRESSBOUND.
48 * dst_len : is the output size, which is returned after compress done
50 * This requires 'workmem' of size LZ4HC_MEM_COMPRESS.
54 * the defined size.
62 * src_len : is the input size, whcih is returned after decompress done
64 * actual_dest_len: is the size of uncompressed data, supposing it's known
76 * src_len : is the input size, therefore the compressed size
78 * dest_len: is the max size of the destination buffer, which is
79 * returned with actual size of decompressed data after
H A Dslab.h166 * The largest kmalloc size supported by the SLAB allocators is
207 /* Maximum allocatable size */
209 /* Maximum size for which we actually use a slab cache */
223 * Page size is normally 2^12 bytes and, in this case, if we want to use
224 * byte sized index which can represent 2^8 entries, the size of the object
226 * If minimum size of kmalloc is less than 16, we use it as minimum object
227 * size and give up to use byte sized index.
239 * Figure out which kmalloc slab an allocation of a certain size
246 static __always_inline int kmalloc_index(size_t size) kmalloc_index() argument
248 if (!size) kmalloc_index()
251 if (size <= KMALLOC_MIN_SIZE) kmalloc_index()
254 if (KMALLOC_MIN_SIZE <= 32 && size > 64 && size <= 96) kmalloc_index()
256 if (KMALLOC_MIN_SIZE <= 64 && size > 128 && size <= 192) kmalloc_index()
258 if (size <= 8) return 3; kmalloc_index()
259 if (size <= 16) return 4; kmalloc_index()
260 if (size <= 32) return 5; kmalloc_index()
261 if (size <= 64) return 6; kmalloc_index()
262 if (size <= 128) return 7; kmalloc_index()
263 if (size <= 256) return 8; kmalloc_index()
264 if (size <= 512) return 9; kmalloc_index()
265 if (size <= 1024) return 10; kmalloc_index()
266 if (size <= 2 * 1024) return 11; kmalloc_index()
267 if (size <= 4 * 1024) return 12; kmalloc_index()
268 if (size <= 8 * 1024) return 13; kmalloc_index()
269 if (size <= 16 * 1024) return 14; kmalloc_index()
270 if (size <= 32 * 1024) return 15; kmalloc_index()
271 if (size <= 64 * 1024) return 16; kmalloc_index()
272 if (size <= 128 * 1024) return 17; kmalloc_index()
273 if (size <= 256 * 1024) return 18; kmalloc_index()
274 if (size <= 512 * 1024) return 19; kmalloc_index()
275 if (size <= 1024 * 1024) return 20; kmalloc_index()
276 if (size <= 2 * 1024 * 1024) return 21; kmalloc_index()
277 if (size <= 4 * 1024 * 1024) return 22; kmalloc_index()
278 if (size <= 8 * 1024 * 1024) return 23; kmalloc_index()
279 if (size <= 16 * 1024 * 1024) return 24; kmalloc_index()
280 if (size <= 32 * 1024 * 1024) return 25; kmalloc_index()
281 if (size <= 64 * 1024 * 1024) return 26; kmalloc_index()
289 void *__kmalloc(size_t size, gfp_t flags);
294 void *__kmalloc_node(size_t size, gfp_t flags, int node);
297 static __always_inline void *__kmalloc_node(size_t size, gfp_t flags, int node) __kmalloc_node() argument
299 return __kmalloc(size, flags); __kmalloc_node()
314 int node, size_t size);
319 int node, size_t size) kmem_cache_alloc_node_trace()
321 return kmem_cache_alloc_trace(s, gfpflags, size); kmem_cache_alloc_node_trace()
327 gfp_t flags, size_t size) kmem_cache_alloc_trace()
331 kasan_kmalloc(s, ret, size); kmem_cache_alloc_trace()
338 int node, size_t size) kmem_cache_alloc_node_trace()
342 kasan_kmalloc(s, ret, size); kmem_cache_alloc_node_trace()
347 extern void *kmalloc_order(size_t size, gfp_t flags, unsigned int order);
350 extern void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order);
353 kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order) kmalloc_order_trace() argument
355 return kmalloc_order(size, flags, order); kmalloc_order_trace()
359 static __always_inline void *kmalloc_large(size_t size, gfp_t flags) kmalloc_large() argument
361 unsigned int order = get_order(size); kmalloc_large()
362 return kmalloc_order_trace(size, flags, order); kmalloc_large()
367 * @size: how many bytes of memory are required.
371 * for objects smaller than page size in the kernel.
418 static __always_inline void *kmalloc(size_t size, gfp_t flags) kmalloc() argument
420 if (__builtin_constant_p(size)) { kmalloc()
421 if (size > KMALLOC_MAX_CACHE_SIZE) kmalloc()
422 return kmalloc_large(size, flags); kmalloc()
425 int index = kmalloc_index(size); kmalloc()
431 flags, size); kmalloc()
435 return __kmalloc(size, flags); kmalloc()
439 * Determine size used for the nth kmalloc cache.
440 * return size or 0 if a kmalloc cache for that
441 * size does not exist
458 static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) kmalloc_node() argument
461 if (__builtin_constant_p(size) && kmalloc_node()
462 size <= KMALLOC_MAX_CACHE_SIZE && !(flags & GFP_DMA)) { kmalloc_node()
463 int i = kmalloc_index(size); kmalloc_node()
469 flags, node, size); kmalloc_node()
472 return __kmalloc_node(size, flags, node); kmalloc_node()
522 * @size: element size.
525 static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) kmalloc_array() argument
527 if (size != 0 && n > SIZE_MAX / size) kmalloc_array()
529 return __kmalloc(n * size, flags); kmalloc_array()
535 * @size: element size.
538 static inline void *kcalloc(size_t n, size_t size, gfp_t flags) kcalloc() argument
540 return kmalloc_array(n, size, flags | __GFP_ZERO); kcalloc()
552 #define kmalloc_track_caller(size, flags) \
553 __kmalloc_track_caller(size, flags, _RET_IP_)
557 #define kmalloc_node_track_caller(size, flags, node) \
558 __kmalloc_node_track_caller(size, flags, node, \
563 #define kmalloc_node_track_caller(size, flags, node) \
564 kmalloc_track_caller(size, flags)
578 * @size: how many bytes of memory are required.
581 static inline void *kzalloc(size_t size, gfp_t flags) kzalloc() argument
583 return kmalloc(size, flags | __GFP_ZERO); kzalloc()
588 * @size: how many bytes of memory are required.
592 static inline void *kzalloc_node(size_t size, gfp_t flags, int node) kzalloc_node() argument
594 return kmalloc_node(size, flags | __GFP_ZERO, node); kzalloc_node()
317 kmem_cache_alloc_node_trace(struct kmem_cache *s, gfp_t gfpflags, int node, size_t size) kmem_cache_alloc_node_trace() argument
326 kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t flags, size_t size) kmem_cache_alloc_trace() argument
336 kmem_cache_alloc_node_trace(struct kmem_cache *s, gfp_t gfpflags, int node, size_t size) kmem_cache_alloc_node_trace() argument
H A Dkcore.h18 size_t size; member in struct:kcore_list
25 unsigned long long size; member in struct:vmcore
33 void kclist_add(struct kcore_list *new, void *addr, size_t size, int type) kclist_add() argument
H A Dsort.h6 void sort(void *base, size_t num, size_t size,
H A Dseq_buf.h14 * @size: size of the buffer
20 size_t size; member in struct:seq_buf
32 seq_buf_init(struct seq_buf *s, unsigned char *buf, unsigned int size) seq_buf_init() argument
35 s->size = size; seq_buf_init()
41 * the len and size are set to be equal.
46 return s->len > s->size; seq_buf_has_overflowed()
52 s->len = s->size + 1; seq_buf_set_overflow()
64 return s->size - s->len; seq_buf_buffer_left()
70 return min(s->len, s->size); seq_buf_used()
83 WARN_ON(s->len > s->size + 1); seq_buf_get_buf()
85 if (s->len < s->size) { seq_buf_get_buf()
87 return s->size - s->len; seq_buf_get_buf()
109 BUG_ON(s->len + num > s->size); seq_buf_commit()
/linux-4.1.27/arch/s390/lib/
H A Dfind.c18 unsigned long find_first_bit_inv(const unsigned long *addr, unsigned long size) find_first_bit_inv() argument
24 while (size & ~(BITS_PER_LONG - 1)) { find_first_bit_inv()
28 size -= BITS_PER_LONG; find_first_bit_inv()
30 if (!size) find_first_bit_inv()
32 tmp = (*p) & (~0UL << (BITS_PER_LONG - size)); find_first_bit_inv()
34 return result + size; /* Nope. */ find_first_bit_inv()
40 unsigned long find_next_bit_inv(const unsigned long *addr, unsigned long size, find_next_bit_inv() argument
47 if (offset >= size) find_next_bit_inv()
48 return size; find_next_bit_inv()
49 size -= result; find_next_bit_inv()
54 if (size < BITS_PER_LONG) find_next_bit_inv()
58 size -= BITS_PER_LONG; find_next_bit_inv()
61 while (size & ~(BITS_PER_LONG-1)) { find_next_bit_inv()
65 size -= BITS_PER_LONG; find_next_bit_inv()
67 if (!size) find_next_bit_inv()
71 tmp &= (~0UL << (BITS_PER_LONG - size)); find_next_bit_inv()
73 return result + size; /* Nope. */ find_next_bit_inv()
H A Duaccess.c21 unsigned long size) copy_from_user_mvcos()
43 " algr %4,%0\n" /* copy remaining size, subtract 1 */ copy_from_user_mvcos()
55 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2) copy_from_user_mvcos()
57 return size; copy_from_user_mvcos()
61 unsigned long size) copy_from_user_mvcp()
87 " algr %4,%0\n" /* copy remaining size, subtract 1 */ copy_from_user_mvcp()
100 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2) copy_from_user_mvcp()
102 return size; copy_from_user_mvcp()
114 unsigned long size) copy_to_user_mvcos()
138 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2) copy_to_user_mvcos()
140 return size; copy_to_user_mvcos()
144 unsigned long size) copy_to_user_mvcs()
173 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2) copy_to_user_mvcs()
175 return size; copy_to_user_mvcs()
187 unsigned long size) copy_in_user_mvcos()
204 : "+a" (size), "+a" (to), "+a" (from), "+a" (tmp1), "=a" (tmp2) copy_in_user_mvcos()
206 return size; copy_in_user_mvcos()
210 unsigned long size) copy_in_user_mvc()
236 : "+a" (size), "+a" (to), "+a" (from), "=a" (tmp1) copy_in_user_mvc()
238 return size; copy_in_user_mvc()
249 static inline unsigned long clear_user_mvcos(void __user *to, unsigned long size) clear_user_mvcos() argument
272 : "+a" (size), "+a" (to), "+a" (tmp1), "=a" (tmp2) clear_user_mvcos()
274 return size; clear_user_mvcos()
277 static inline unsigned long clear_user_xc(void __user *to, unsigned long size) clear_user_xc() argument
308 : "+a" (size), "+a" (to), "=a" (tmp1), "=a" (tmp2) clear_user_xc()
310 return size; clear_user_xc()
313 unsigned long __clear_user(void __user *to, unsigned long size) __clear_user() argument
316 return clear_user_mvcos(to, size); __clear_user()
317 return clear_user_xc(to, size); __clear_user()
322 unsigned long size) strnlen_user_srst()
338 : "+a" (size), "+a" (src), "=a" (tmp1), "=a" (tmp2) strnlen_user_srst()
340 return size; strnlen_user_srst()
343 unsigned long __strnlen_user(const char __user *src, unsigned long size) __strnlen_user() argument
345 if (unlikely(!size)) __strnlen_user()
348 return strnlen_user_srst(src, size); __strnlen_user()
352 long __strncpy_from_user(char *dst, const char __user *src, long size) __strncpy_from_user() argument
356 if (unlikely(size <= 0)) __strncpy_from_user()
361 len = min(size - done, PAGE_SIZE - offset); __strncpy_from_user()
368 } while ((len_str == len) && (done < size)); __strncpy_from_user()
20 copy_from_user_mvcos(void *x, const void __user *ptr, unsigned long size) copy_from_user_mvcos() argument
60 copy_from_user_mvcp(void *x, const void __user *ptr, unsigned long size) copy_from_user_mvcp() argument
113 copy_to_user_mvcos(void __user *ptr, const void *x, unsigned long size) copy_to_user_mvcos() argument
143 copy_to_user_mvcs(void __user *ptr, const void *x, unsigned long size) copy_to_user_mvcs() argument
186 copy_in_user_mvcos(void __user *to, const void __user *from, unsigned long size) copy_in_user_mvcos() argument
209 copy_in_user_mvc(void __user *to, const void __user *from, unsigned long size) copy_in_user_mvc() argument
321 strnlen_user_srst(const char __user *src, unsigned long size) strnlen_user_srst() argument
/linux-4.1.27/arch/blackfin/mm/
H A Dmaccess.c12 static int validate_memory_access_address(unsigned long addr, int size) validate_memory_access_address() argument
14 if (size < 0 || addr == 0) validate_memory_access_address()
16 return bfin_mem_access_type(addr, size); validate_memory_access_address()
19 long probe_kernel_read(void *dst, const void *src, size_t size) probe_kernel_read() argument
24 mem_type = validate_memory_access_address(lsrc, size); probe_kernel_read()
29 if (size == 2 && lsrc % 2 == 0) { probe_kernel_read()
33 } else if (size == 4 && lsrc % 4 == 0) { probe_kernel_read()
42 return __probe_kernel_read(dst, src, size); probe_kernel_read()
45 if (dma_memcpy(dst, src, size)) probe_kernel_read()
49 if (isram_memcpy(dst, src, size)) probe_kernel_read()
58 long probe_kernel_write(void *dst, const void *src, size_t size) probe_kernel_write() argument
63 mem_type = validate_memory_access_address(ldst, size); probe_kernel_write()
68 if (size == 2 && ldst % 2 == 0) { probe_kernel_write()
73 } else if (size == 4 && ldst % 4 == 0) { probe_kernel_write()
83 return __probe_kernel_write(dst, src, size); probe_kernel_write()
86 if (dma_memcpy(dst, src, size)) probe_kernel_write()
90 if (isram_memcpy(dst, src, size)) probe_kernel_write()
/linux-4.1.27/tools/lib/util/
H A Dfind_next_bit.c24 unsigned long find_next_bit(const unsigned long *addr, unsigned long size, find_next_bit() argument
31 if (offset >= size) find_next_bit()
32 return size; find_next_bit()
33 size -= result; find_next_bit()
38 if (size < BITS_PER_LONG) find_next_bit()
42 size -= BITS_PER_LONG; find_next_bit()
45 while (size & ~(BITS_PER_LONG-1)) { find_next_bit()
49 size -= BITS_PER_LONG; find_next_bit()
51 if (!size) find_next_bit()
56 tmp &= (~0UL >> (BITS_PER_LONG - size)); find_next_bit()
58 return result + size; /* Nope. */ find_next_bit()
68 unsigned long find_first_bit(const unsigned long *addr, unsigned long size) find_first_bit() argument
74 while (size & ~(BITS_PER_LONG-1)) { find_first_bit()
78 size -= BITS_PER_LONG; find_first_bit()
80 if (!size) find_first_bit()
83 tmp = (*p) & (~0UL >> (BITS_PER_LONG - size)); find_first_bit()
85 return result + size; /* Nope. */ find_first_bit()
/linux-4.1.27/arch/sparc/lib/
H A Duser_fixup.c21 static unsigned long compute_size(unsigned long start, unsigned long size, unsigned long *offset) compute_size() argument
24 unsigned long end = start + size; compute_size()
30 size = end - fault_addr; compute_size()
32 return size; compute_size()
35 unsigned long copy_from_user_fixup(void *to, const void __user *from, unsigned long size) copy_from_user_fixup() argument
39 size = compute_size((unsigned long) from, size, &offset); copy_from_user_fixup()
40 if (likely(size)) copy_from_user_fixup()
41 memset(to + offset, 0, size); copy_from_user_fixup()
43 return size; copy_from_user_fixup()
47 unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned long size) copy_to_user_fixup() argument
51 return compute_size((unsigned long) to, size, &offset); copy_to_user_fixup()
55 unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned long size) copy_in_user_fixup() argument
59 unsigned long end = start + size; copy_in_user_fixup()
65 end = start + size; copy_in_user_fixup()
69 return size; copy_in_user_fixup()
H A Dbitext.c8 * by align size, should provide fast enough search while maintaining low
46 if (align < 0 || align >= t->size) bit_map_string_get()
48 if (len <= 0 || len > t->size) bit_map_string_get()
59 off_new = find_next_zero_bit(t->map, t->size, offset); bit_map_string_get()
63 if (offset >= t->size) bit_map_string_get()
65 if (count + len > t->size) { bit_map_string_get()
68 "bitmap out: size %d used %d off %d len %d align %d count %d\n", bit_map_string_get()
69 t->size, t->used, offset, len, align, count); bit_map_string_get()
73 if (offset + len > t->size) { bit_map_string_get()
74 count += t->size - offset; bit_map_string_get()
86 (t->map, t->size, bit_map_string_get()
88 if ((t->last_off = offset + len) >= t->size) bit_map_string_get()
97 if ((offset += i + 1) >= t->size) bit_map_string_get()
120 void bit_map_init(struct bit_map *t, unsigned long *map, int size) bit_map_init() argument
122 bitmap_zero(map, size); bit_map_init()
126 t->size = size; bit_map_init()
/linux-4.1.27/arch/m32r/include/asm/
H A Dcache.h4 /* L1 cache line size */
/linux-4.1.27/include/trace/events/
H A Dswiotlb.h13 size_t size,
16 TP_ARGS(dev, dev_addr, size, swiotlb_force),
22 __field( size_t, size )
30 __entry->size = size;
35 "size=%zu %s",
39 __entry->size,
H A Dintel-sst.h105 TP_PROTO(unsigned int size),
107 TP_ARGS(size),
110 __field( unsigned int, size )
114 __entry->size = size;
117 TP_printk("Mailbox bytes 0x%8.8x", (unsigned int)__entry->size)
122 TP_PROTO(unsigned int size),
124 TP_ARGS(size)
130 TP_PROTO(unsigned int size),
132 TP_ARGS(size)
138 TP_PROTO(unsigned int size),
140 TP_ARGS(size)
146 TP_PROTO(unsigned int size),
148 TP_ARGS(size)
H A Diommu.h88 TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size),
90 TP_ARGS(iova, paddr, size),
95 __field(size_t, size)
101 __entry->size = size;
104 TP_printk("IOMMU: iova=0x%016llx paddr=0x%016llx size=%zu",
105 __entry->iova, __entry->paddr, __entry->size
111 TP_PROTO(unsigned long iova, size_t size, size_t unmapped_size),
113 TP_ARGS(iova, size, unmapped_size),
117 __field(size_t, size)
123 __entry->size = size;
127 TP_printk("IOMMU: iova=0x%016llx size=%zu unmapped_size=%zu",
128 __entry->iova, __entry->size, __entry->unmapped_size
/linux-4.1.27/tools/perf/util/
H A Dwrapper.c10 static inline void release_pack_memory(size_t size __maybe_unused, release_pack_memory()
27 void *xrealloc(void *ptr, size_t size) xrealloc() argument
29 void *ret = realloc(ptr, size); xrealloc()
30 if (!ret && !size) xrealloc()
33 release_pack_memory(size, -1); xrealloc()
34 ret = realloc(ptr, size); xrealloc()
35 if (!ret && !size) xrealloc()
H A Dtrace-event-read.c45 static int __do_read(int fd, void *buf, int size) __do_read() argument
47 int rsize = size; __do_read()
49 while (size) { __do_read()
50 int ret = read(fd, buf, size); __do_read()
64 size -= ret; __do_read()
71 static int do_read(void *data, int size) do_read() argument
75 r = __do_read(input_fd, data, size); do_read()
77 pr_debug("reading input file (size expected=%d received=%d)", do_read()
78 size, r); do_read()
88 static void skip(int size) skip() argument
93 while (size) { skip()
94 r = size > BUFSIZ ? BUFSIZ : size; skip()
96 size -= r; skip()
122 int size = 0; read_string() local
147 buf[size++] = c; read_string()
153 trace_data_size += size; read_string()
155 str = malloc(size); read_string()
157 memcpy(str, buf, size); read_string()
164 unsigned int size; read_proc_kallsyms() local
167 size = read4(pevent); read_proc_kallsyms()
168 if (!size) read_proc_kallsyms()
171 buf = malloc(size + 1); read_proc_kallsyms()
175 if (do_read(buf, size) < 0) { read_proc_kallsyms()
179 buf[size] = '\0'; read_proc_kallsyms()
181 parse_proc_kallsyms(pevent, buf, size); read_proc_kallsyms()
189 unsigned int size; read_ftrace_printk() local
192 /* it can have 0 size */ read_ftrace_printk()
193 size = read4(pevent); read_ftrace_printk()
194 if (!size) read_ftrace_printk()
197 buf = malloc(size); read_ftrace_printk()
201 if (do_read(buf, size) < 0) { read_ftrace_printk()
206 parse_ftrace_printk(pevent, buf, size); read_ftrace_printk()
214 unsigned long long size; read_header_files() local
227 size = read8(pevent); read_header_files()
229 header_page = malloc(size); read_header_files()
233 if (do_read(header_page, size) < 0) { read_header_files()
239 if (!pevent_parse_header_page(pevent, header_page, size, read_header_files()
257 size = read8(pevent); read_header_files()
258 skip(size); read_header_files()
263 static int read_ftrace_file(struct pevent *pevent, unsigned long long size) read_ftrace_file() argument
267 buf = malloc(size); read_ftrace_file()
271 if (do_read(buf, size) < 0) { read_ftrace_file()
276 parse_ftrace_file(pevent, buf, size); read_ftrace_file()
282 unsigned long long size) read_event_file()
286 buf = malloc(size); read_event_file()
290 if (do_read(buf, size) < 0) { read_event_file()
295 parse_event_file(pevent, buf, size, sys); read_event_file()
302 unsigned long long size; read_ftrace_files() local
310 size = read8(pevent); read_ftrace_files()
311 ret = read_ftrace_file(pevent, size); read_ftrace_files()
320 unsigned long long size; read_event_files() local
337 size = read8(pevent); read_event_files()
338 ret = read_event_file(pevent, sys, size); read_event_files()
354 ssize_t size = -1; trace_report() local
429 size = trace_data_size; trace_report()
443 return size; trace_report()
281 read_event_file(struct pevent *pevent, char *sys, unsigned long long size) read_event_file() argument
H A Dtop.c18 #define SNPRINTF(buf, size, fmt, args...) \
20 size_t r = snprintf(buf, size, fmt, ## args); \
21 r > size ? size : r; \
24 size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size) perf_top__header_snprintf() argument
47 ret = SNPRINTF(bf, size, perf_top__header_snprintf()
56 ret = SNPRINTF(bf, size, perf_top__header_snprintf()
75 ret += SNPRINTF(bf + ret, size - ret, "%" PRIu64 "%s ", perf_top__header_snprintf()
80 ret += SNPRINTF(bf + ret, size - ret, "%s", perf_evsel__name(top->sym_evsel)); perf_top__header_snprintf()
82 ret += SNPRINTF(bf + ret, size - ret, "], "); perf_top__header_snprintf()
85 ret += SNPRINTF(bf + ret, size - ret, " (target_pid: %s", perf_top__header_snprintf()
88 ret += SNPRINTF(bf + ret, size - ret, " (target_tid: %s", perf_top__header_snprintf()
91 ret += SNPRINTF(bf + ret, size - ret, " (uid: %s", perf_top__header_snprintf()
94 ret += SNPRINTF(bf + ret, size - ret, " (all"); perf_top__header_snprintf()
97 ret += SNPRINTF(bf + ret, size - ret, ", CPU%s: %s)", perf_top__header_snprintf()
102 ret += SNPRINTF(bf + ret, size - ret, ")"); perf_top__header_snprintf()
104 ret += SNPRINTF(bf + ret, size - ret, ", %d CPU%s)", perf_top__header_snprintf()
H A Dalias.c28 int src, dst, count = 0, size = 16; local
31 *argv = malloc(sizeof(char*) * size);
42 if (count >= size) {
43 size += 16;
44 *argv = realloc(*argv, sizeof(char*) * size);
/linux-4.1.27/arch/powerpc/boot/
H A Dpage.h19 /* PAGE_SHIFT determines the page size */
24 /* align addr on a size boundary - adjust address up/down if needed */
25 #define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1)))
26 #define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1)))
28 /* align addr on a size boundary - adjust address up if needed */
29 #define _ALIGN(addr,size) _ALIGN_UP(addr,size)
H A Dsimple_alloc.c24 unsigned long size; member in struct:alloc_info
33 * First time an entry is used, its base and size are set.
34 * An entry can be freed and re-malloc'd but its base & size don't change.
37 static void *simple_malloc(unsigned long size) simple_malloc() argument
42 if (size == 0) simple_malloc()
45 size = _ALIGN_UP(size, alloc_min); simple_malloc()
49 if (size <= space_left) { simple_malloc()
51 p->size = size; simple_malloc()
53 next_base += size; simple_malloc()
54 space_left -= size; simple_malloc()
59 /* reuse an entry keeping same base & size */ simple_malloc()
60 else if (!(p->flags & ENTRY_IN_USE) && (size <= p->size)) { simple_malloc()
92 * Change size of area pointed to by 'ptr' to 'size'.
93 * If 'ptr' is NULL, then its a malloc(). If 'size' is 0, then its a free().
97 static void *simple_realloc(void *ptr, unsigned long size) simple_realloc() argument
102 if (size == 0) { simple_realloc()
108 return simple_malloc(size); simple_realloc()
113 if (size <= p->size) /* fits in current block */ simple_realloc()
116 new = simple_malloc(size); simple_realloc()
117 memcpy(new, ptr, p->size); simple_realloc()
H A Dsimpleboot.c33 int node, size, i; platform_init() local
39 /* Find the #address-cells and #size-cells properties */ platform_init()
43 na = fdt_getprop(_dtb_start, node, "#address-cells", &size); platform_init()
44 if (!na || (size != 4)) platform_init()
46 ns = fdt_getprop(_dtb_start, node, "#size-cells", &size); platform_init()
47 if (!ns || (size != 4)) platform_init()
48 fatal("Cannot find #size-cells property"); platform_init()
55 reg = fdt_getprop(_dtb_start, node, "reg", &size); platform_init()
56 if (size < (*na+*ns) * sizeof(u32)) platform_init()
76 timebase = fdt_getprop(_dtb_start, node, "timebase-frequency", &size); platform_init()
77 if (timebase && (size == 4)) platform_init()
80 /* Now we have the memory size; initialize the heap */ platform_init()
H A Dfsl-soc.c27 int size; fsl_get_immr() local
30 size = getprop(soc, "#address-cells", prop_buf, MAX_PROP_LEN); fsl_get_immr()
31 if (size == 4) fsl_get_immr()
39 size = getprop(soc, "ranges", prop_buf, MAX_PROP_LEN); fsl_get_immr()
41 if (size < 12) fsl_get_immr()
/linux-4.1.27/include/asm-generic/
H A Dgetorder.h13 int __get_order(unsigned long size) __get_order() argument
17 size--; __get_order()
18 size >>= PAGE_SHIFT; __get_order()
20 order = fls(size); __get_order()
22 order = fls64(size); __get_order()
28 * get_order - Determine the allocation order of a memory size
29 * @size: The size for which to get the order
42 * to hold an object of the specified size.
44 * The result is undefined if the size is 0.
H A Ddma-contiguous.h7 dma_contiguous_early_fixup(phys_addr_t base, unsigned long size) { } argument
H A Ddma-coherent.h9 int dma_alloc_from_coherent(struct device *dev, ssize_t size,
14 void *cpu_addr, size_t size, int *ret);
20 dma_addr_t device_addr, size_t size, int flags);
25 dma_addr_t device_addr, size_t size);
27 #define dma_alloc_from_coherent(dev, size, handle, ret) (0)
H A Dpci-dma-compat.h16 pci_alloc_consistent(struct pci_dev *hwdev, size_t size, pci_alloc_consistent() argument
19 return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, dma_handle, GFP_ATOMIC); pci_alloc_consistent()
23 pci_zalloc_consistent(struct pci_dev *hwdev, size_t size, pci_zalloc_consistent() argument
27 size, dma_handle, GFP_ATOMIC); pci_zalloc_consistent()
31 pci_free_consistent(struct pci_dev *hwdev, size_t size, pci_free_consistent() argument
34 dma_free_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, vaddr, dma_handle); pci_free_consistent()
38 pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) pci_map_single() argument
40 return dma_map_single(hwdev == NULL ? NULL : &hwdev->dev, ptr, size, (enum dma_data_direction)direction); pci_map_single()
45 size_t size, int direction) pci_unmap_single()
47 dma_unmap_single(hwdev == NULL ? NULL : &hwdev->dev, dma_addr, size, (enum dma_data_direction)direction); pci_unmap_single()
52 unsigned long offset, size_t size, int direction) pci_map_page()
54 return dma_map_page(hwdev == NULL ? NULL : &hwdev->dev, page, offset, size, (enum dma_data_direction)direction); pci_map_page()
59 size_t size, int direction) pci_unmap_page()
61 dma_unmap_page(hwdev == NULL ? NULL : &hwdev->dev, dma_address, size, (enum dma_data_direction)direction); pci_unmap_page()
80 size_t size, int direction) pci_dma_sync_single_for_cpu()
82 dma_sync_single_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); pci_dma_sync_single_for_cpu()
87 size_t size, int direction) pci_dma_sync_single_for_device()
89 dma_sync_single_for_device(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); pci_dma_sync_single_for_device()
44 pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction) pci_unmap_single() argument
51 pci_map_page(struct pci_dev *hwdev, struct page *page, unsigned long offset, size_t size, int direction) pci_map_page() argument
58 pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, size_t size, int direction) pci_unmap_page() argument
79 pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) pci_dma_sync_single_for_cpu() argument
86 pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) pci_dma_sync_single_for_device() argument
H A Ddma-mapping-broken.h12 dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
16 dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
19 static inline void *dma_alloc_attrs(struct device *dev, size_t size, dma_alloc_attrs() argument
24 return dma_alloc_coherent(dev, size, dma_handle, flag); dma_alloc_attrs()
27 static inline void dma_free_attrs(struct device *dev, size_t size, dma_free_attrs() argument
32 dma_free_coherent(dev, size, cpu_addr, dma_handle); dma_free_attrs()
39 dma_map_single(struct device *dev, void *ptr, size_t size,
43 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
56 size_t size, enum dma_data_direction direction);
59 dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
63 dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
68 unsigned long offset, size_t size,
92 dma_cache_sync(struct device *dev, void *vaddr, size_t size,
H A Ddma-mapping-common.h11 size_t size, dma_map_single_attrs()
18 kmemcheck_mark_initialized(ptr, size); dma_map_single_attrs()
21 (unsigned long)ptr & ~PAGE_MASK, size, dma_map_single_attrs()
24 (unsigned long)ptr & ~PAGE_MASK, size, dma_map_single_attrs()
30 size_t size, dma_unmap_single_attrs()
38 ops->unmap_page(dev, addr, size, dir, attrs); dma_unmap_single_attrs()
39 debug_dma_unmap_page(dev, addr, size, dir, true); dma_unmap_single_attrs()
77 size_t offset, size_t size, dma_map_page()
83 kmemcheck_mark_initialized(page_address(page) + offset, size); dma_map_page()
85 addr = ops->map_page(dev, page, offset, size, dir, NULL); dma_map_page()
86 debug_dma_map_page(dev, page, offset, size, dir, addr, false); dma_map_page()
92 size_t size, enum dma_data_direction dir) dma_unmap_page()
98 ops->unmap_page(dev, addr, size, dir, NULL); dma_unmap_page()
99 debug_dma_unmap_page(dev, addr, size, dir, false); dma_unmap_page()
103 size_t size, dma_sync_single_for_cpu()
110 ops->sync_single_for_cpu(dev, addr, size, dir); dma_sync_single_for_cpu()
111 debug_dma_sync_single_for_cpu(dev, addr, size, dir); dma_sync_single_for_cpu()
115 dma_addr_t addr, size_t size, dma_sync_single_for_device()
122 ops->sync_single_for_device(dev, addr, size, dir); dma_sync_single_for_device()
123 debug_dma_sync_single_for_device(dev, addr, size, dir); dma_sync_single_for_device()
129 size_t size, dma_sync_single_range_for_cpu()
136 ops->sync_single_for_cpu(dev, addr + offset, size, dir); dma_sync_single_range_for_cpu()
137 debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); dma_sync_single_range_for_cpu()
143 size_t size, dma_sync_single_range_for_device()
150 ops->sync_single_for_device(dev, addr + offset, size, dir); dma_sync_single_range_for_device()
151 debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); dma_sync_single_range_for_device()
185 void *cpu_addr, dma_addr_t dma_addr, size_t size);
187 void *dma_common_contiguous_remap(struct page *page, size_t size,
191 void *dma_common_pages_remap(struct page **pages, size_t size,
194 void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags);
202 * @size: size of memory originally requested in dma_alloc_attrs
211 dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs) dma_mmap_attrs()
216 return ops->mmap(dev, vma, cpu_addr, dma_addr, size, attrs); dma_mmap_attrs()
217 return dma_common_mmap(dev, vma, cpu_addr, dma_addr, size); dma_mmap_attrs()
224 void *cpu_addr, dma_addr_t dma_addr, size_t size);
228 dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs) dma_get_sgtable_attrs()
233 return ops->get_sgtable(dev, sgt, cpu_addr, dma_addr, size, dma_get_sgtable_attrs()
235 return dma_common_get_sgtable(dev, sgt, cpu_addr, dma_addr, size); dma_get_sgtable_attrs()
10 dma_map_single_attrs(struct device *dev, void *ptr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) dma_map_single_attrs() argument
29 dma_unmap_single_attrs(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) dma_unmap_single_attrs() argument
76 dma_map_page(struct device *dev, struct page *page, size_t offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
91 dma_unmap_page(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
102 dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu() argument
114 dma_sync_single_for_device(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) dma_sync_single_for_device() argument
126 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t addr, unsigned long offset, size_t size, enum dma_data_direction dir) dma_sync_single_range_for_cpu() argument
140 dma_sync_single_range_for_device(struct device *dev, dma_addr_t addr, unsigned long offset, size_t size, enum dma_data_direction dir) dma_sync_single_range_for_device() argument
210 dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs) dma_mmap_attrs() argument
227 dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, void *cpu_addr, dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs) dma_get_sgtable_attrs() argument
/linux-4.1.27/arch/um/drivers/
H A Dslip_common.c7 int i, n, size, start; slip_proto_read() local
12 size = slip_unesc(slip->ibuf[i++], slip->ibuf, slip_proto_read()
14 if(size){ slip_proto_read()
15 memcpy(buf, slip->ibuf, size); slip_proto_read()
19 return size; slip_proto_read()
32 size = slip_unesc(slip->ibuf[start + i], slip->ibuf,&slip->pos, slip_proto_read()
34 if(size){ slip_proto_read()
35 memcpy(buf, slip->ibuf, size); slip_proto_read()
39 return size; slip_proto_read()
H A Dcow_sys.h8 static inline void *cow_malloc(int size) cow_malloc() argument
10 return uml_kmalloc(size, UM_GFP_KERNEL); cow_malloc()
35 static inline int cow_write_file(int fd, void *buf, int size) cow_write_file() argument
37 return os_write_file(fd, buf, size); cow_write_file()
/linux-4.1.27/arch/sh/include/asm/
H A Dio_trapped.h25 unsigned long size);
31 __ioremap_trapped(unsigned long offset, unsigned long size) __ioremap_trapped() argument
33 return match_trapped_io_handler(&trapped_mem, offset, size); __ioremap_trapped()
36 #define __ioremap_trapped(offset, size) NULL
43 __ioport_map_trapped(unsigned long offset, unsigned long size) __ioport_map_trapped() argument
45 return match_trapped_io_handler(&trapped_io, offset, size); __ioport_map_trapped()
48 #define __ioport_map_trapped(offset, size) NULL
54 #define __ioremap_trapped(offset, size) NULL
55 #define __ioport_map_trapped(offset, size) NULL
H A Ddma-mapping.h39 void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
58 static inline void *dma_alloc_attrs(struct device *dev, size_t size, dma_alloc_attrs() argument
65 if (dma_alloc_from_coherent(dev, size, dma_handle, &memory)) dma_alloc_attrs()
70 memory = ops->alloc(dev, size, dma_handle, gfp, attrs); dma_alloc_attrs()
71 debug_dma_alloc_coherent(dev, size, *dma_handle, memory); dma_alloc_attrs()
78 static inline void dma_free_attrs(struct device *dev, size_t size, dma_free_attrs() argument
84 if (dma_release_from_coherent(dev, get_order(size), vaddr)) dma_free_attrs()
87 debug_dma_free_coherent(dev, size, vaddr, dma_handle); dma_free_attrs()
89 ops->free(dev, size, vaddr, dma_handle, attrs); dma_free_attrs()
93 extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,
96 extern void dma_generic_free_coherent(struct device *dev, size_t size,
/linux-4.1.27/net/core/
H A Dtso.c15 int size, bool is_last) tso_build_hdr()
25 iph->tot_len = htons(size + hdr_len - mac_hdr_len); tso_build_hdr()
39 void tso_build_data(struct sk_buff *skb, struct tso_t *tso, int size) tso_build_data() argument
41 tso->tcp_seq += size; tso_build_data()
42 tso->size -= size; tso_build_data()
43 tso->data += size; tso_build_data()
45 if ((tso->size == 0) && tso_build_data()
50 tso->size = frag->size; tso_build_data()
66 tso->size = skb_headlen(skb) - hdr_len; tso_start()
68 if ((tso->size == 0) && tso_start()
73 tso->size = frag->size; tso_start()
14 tso_build_hdr(struct sk_buff *skb, char *hdr, struct tso_t *tso, int size, bool is_last) tso_build_hdr() argument
/linux-4.1.27/arch/cris/arch-v32/mm/
H A Dintmem.c23 unsigned int size; member in struct:intmem_allocation
42 alloc->size = MEM_INTMEM_SIZE - RESERVED_SIZE; crisv32_intmem_init()
49 void* crisv32_intmem_alloc(unsigned size, unsigned align) crisv32_intmem_alloc() argument
63 allocation->size >= size + alignment) { crisv32_intmem_alloc()
64 if (allocation->size > size + alignment) { crisv32_intmem_alloc()
68 alloc->size = allocation->size - size - crisv32_intmem_alloc()
70 alloc->offset = allocation->offset + size + crisv32_intmem_alloc()
78 tmp->size = alignment; crisv32_intmem_alloc()
86 allocation->size = size; crisv32_intmem_alloc()
118 prev->size += allocation->size; crisv32_intmem_free()
125 allocation->size += next->size; crisv32_intmem_free()
/linux-4.1.27/sound/pcmcia/pdaudiocf/
H A Dpdaudiocf_irq.c54 static inline void pdacf_transfer_mono16(u16 *dst, u16 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_mono16() argument
56 while (size-- > 0) { pdacf_transfer_mono16()
62 static inline void pdacf_transfer_mono32(u32 *dst, u32 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_mono32() argument
66 while (size-- > 0) { pdacf_transfer_mono32()
74 static inline void pdacf_transfer_stereo16(u16 *dst, u16 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_stereo16() argument
76 while (size-- > 0) { pdacf_transfer_stereo16()
82 static inline void pdacf_transfer_stereo32(u32 *dst, u32 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_stereo32() argument
86 while (size-- > 0) { pdacf_transfer_stereo32()
95 static inline void pdacf_transfer_mono16sw(u16 *dst, u16 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_mono16sw() argument
97 while (size-- > 0) { pdacf_transfer_mono16sw()
103 static inline void pdacf_transfer_mono32sw(u32 *dst, u32 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_mono32sw() argument
107 while (size-- > 0) { pdacf_transfer_mono32sw()
115 static inline void pdacf_transfer_stereo16sw(u16 *dst, u16 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_stereo16sw() argument
117 while (size-- > 0) { pdacf_transfer_stereo16sw()
123 static inline void pdacf_transfer_stereo32sw(u32 *dst, u32 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_stereo32sw() argument
127 while (size-- > 0) { pdacf_transfer_stereo32sw()
136 static inline void pdacf_transfer_mono24le(u8 *dst, u16 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_mono24le() argument
141 while (size-- > 0) { pdacf_transfer_mono24le()
152 static inline void pdacf_transfer_mono24be(u8 *dst, u16 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_mono24be() argument
157 while (size-- > 0) { pdacf_transfer_mono24be()
168 static inline void pdacf_transfer_stereo24le(u8 *dst, u32 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_stereo24le() argument
173 while (size-- > 0) { pdacf_transfer_stereo24le()
188 static inline void pdacf_transfer_stereo24be(u8 *dst, u32 xor, unsigned int size, unsigned long rdp_port) pdacf_transfer_stereo24be() argument
193 while (size-- > 0) { pdacf_transfer_stereo24be()
208 static void pdacf_transfer(struct snd_pdacf *chip, unsigned int size, unsigned int off) pdacf_transfer() argument
216 pdacf_transfer_mono24le((char *)chip->pcm_area + (off * 3), xor, size, rdp_port); pdacf_transfer()
218 pdacf_transfer_stereo24le((char *)chip->pcm_area + (off * 6), xor, size, rdp_port); pdacf_transfer()
222 pdacf_transfer_mono24be((char *)chip->pcm_area + (off * 3), xor, size, rdp_port); pdacf_transfer()
224 pdacf_transfer_stereo24be((char *)chip->pcm_area + (off * 6), xor, size, rdp_port); pdacf_transfer()
232 pdacf_transfer_mono16((u16 *)chip->pcm_area + off, xor, size, rdp_port); pdacf_transfer()
234 pdacf_transfer_mono32((u32 *)chip->pcm_area + off, xor, size, rdp_port); pdacf_transfer()
238 pdacf_transfer_stereo16((u16 *)chip->pcm_area + (off * 2), xor, size, rdp_port); pdacf_transfer()
240 pdacf_transfer_stereo32((u32 *)chip->pcm_area + (off * 2), xor, size, rdp_port); pdacf_transfer()
246 pdacf_transfer_mono16sw((u16 *)chip->pcm_area + off, xor, size, rdp_port); pdacf_transfer()
248 pdacf_transfer_mono32sw((u32 *)chip->pcm_area + off, xor, size, rdp_port); pdacf_transfer()
252 pdacf_transfer_stereo16sw((u16 *)chip->pcm_area + (off * 2), xor, size, rdp_port); pdacf_transfer()
254 pdacf_transfer_stereo32sw((u32 *)chip->pcm_area + (off * 2), xor, size, rdp_port); pdacf_transfer()
263 int size, off, cont, rdp, wdp; pdacf_threaded_irq() local
274 size = wdp - rdp; pdacf_threaded_irq()
275 if (size < 0) pdacf_threaded_irq()
276 size += 0x10000; pdacf_threaded_irq()
277 if (size == 0) pdacf_threaded_irq()
278 size = 0x10000; pdacf_threaded_irq()
279 size /= chip->pcm_frame; pdacf_threaded_irq()
280 if (size > 64) pdacf_threaded_irq()
281 size -= 32; pdacf_threaded_irq()
284 chip->pcm_hwptr += size; pdacf_threaded_irq()
286 chip->pcm_tdone += size; pdacf_threaded_irq()
289 while (size-- > 0) { pdacf_threaded_irq()
295 while (size-- > 0) { pdacf_threaded_irq()
304 chip->pcm_tdone += size; pdacf_threaded_irq()
305 while (size > 0) { pdacf_threaded_irq()
307 if (cont > size) pdacf_threaded_irq()
308 cont = size; pdacf_threaded_irq()
312 size -= cont; pdacf_threaded_irq()
/linux-4.1.27/drivers/mtd/tests/
H A Dmtd_nandecctest.c47 size_t size) single_bit_error_data()
49 unsigned int offset = prandom_u32() % (size * BITS_PER_BYTE); single_bit_error_data()
51 memcpy(error_data, correct_data, size); single_bit_error_data()
56 size_t size) double_bit_error_data()
60 offset[0] = prandom_u32() % (size * BITS_PER_BYTE); double_bit_error_data()
62 offset[1] = prandom_u32() % (size * BITS_PER_BYTE); double_bit_error_data()
65 memcpy(error_data, correct_data, size); double_bit_error_data()
71 static unsigned int random_ecc_bit(size_t size) random_ecc_bit() argument
75 if (size == 256) { random_ecc_bit()
88 size_t size) single_bit_error_ecc()
90 unsigned int offset = random_ecc_bit(size); single_bit_error_ecc()
97 size_t size) double_bit_error_ecc()
101 offset[0] = random_ecc_bit(size); double_bit_error_ecc()
103 offset[1] = random_ecc_bit(size); double_bit_error_ecc()
112 void *correct_data, void *correct_ecc, const size_t size) no_bit_error()
114 memcpy(error_data, correct_data, size); no_bit_error()
119 void *correct_data, const size_t size) no_bit_error_verify()
124 __nand_calculate_ecc(error_data, size, calc_ecc); no_bit_error_verify()
125 ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size); no_bit_error_verify()
126 if (ret == 0 && !memcmp(correct_data, error_data, size)) no_bit_error_verify()
133 void *correct_data, void *correct_ecc, const size_t size) single_bit_error_in_data()
135 single_bit_error_data(error_data, correct_data, size); single_bit_error_in_data()
140 void *correct_data, void *correct_ecc, const size_t size) single_bit_error_in_ecc()
142 memcpy(error_data, correct_data, size); single_bit_error_in_ecc()
143 single_bit_error_ecc(error_ecc, correct_ecc, size); single_bit_error_in_ecc()
147 void *correct_data, const size_t size) single_bit_error_correct()
152 __nand_calculate_ecc(error_data, size, calc_ecc); single_bit_error_correct()
153 ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size); single_bit_error_correct()
154 if (ret == 1 && !memcmp(correct_data, error_data, size)) single_bit_error_correct()
161 void *correct_data, void *correct_ecc, const size_t size) double_bit_error_in_data()
163 double_bit_error_data(error_data, correct_data, size); double_bit_error_in_data()
168 void *correct_data, void *correct_ecc, const size_t size) single_bit_error_in_data_and_ecc()
170 single_bit_error_data(error_data, correct_data, size); single_bit_error_in_data_and_ecc()
171 single_bit_error_ecc(error_ecc, correct_ecc, size); single_bit_error_in_data_and_ecc()
175 void *correct_data, void *correct_ecc, const size_t size) double_bit_error_in_ecc()
177 memcpy(error_data, correct_data, size); double_bit_error_in_ecc()
178 double_bit_error_ecc(error_ecc, correct_ecc, size); double_bit_error_in_ecc()
182 void *correct_data, const size_t size) double_bit_error_detect()
187 __nand_calculate_ecc(error_data, size, calc_ecc); double_bit_error_detect()
188 ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size); double_bit_error_detect()
227 void *correct_ecc, const size_t size) dump_data_ecc()
231 error_data, size, false); dump_data_ecc()
237 correct_data, size, false); dump_data_ecc()
242 static int nand_ecc_test_run(const size_t size) nand_ecc_test_run() argument
251 error_data = kmalloc(size, GFP_KERNEL); nand_ecc_test_run()
253 correct_data = kmalloc(size, GFP_KERNEL); nand_ecc_test_run()
261 prandom_bytes(correct_data, size); nand_ecc_test_run()
262 __nand_calculate_ecc(correct_data, size, correct_ecc); nand_ecc_test_run()
266 correct_data, correct_ecc, size); nand_ecc_test_run()
268 correct_data, size); nand_ecc_test_run()
272 nand_ecc_test[i].name, size); nand_ecc_test_run()
274 correct_data, correct_ecc, size); nand_ecc_test_run()
278 nand_ecc_test[i].name, size); nand_ecc_test_run()
295 static int nand_ecc_test_run(const size_t size) nand_ecc_test_run() argument
46 single_bit_error_data(void *error_data, void *correct_data, size_t size) single_bit_error_data() argument
55 double_bit_error_data(void *error_data, void *correct_data, size_t size) double_bit_error_data() argument
87 single_bit_error_ecc(void *error_ecc, void *correct_ecc, size_t size) single_bit_error_ecc() argument
96 double_bit_error_ecc(void *error_ecc, void *correct_ecc, size_t size) double_bit_error_ecc() argument
111 no_bit_error(void *error_data, void *error_ecc, void *correct_data, void *correct_ecc, const size_t size) no_bit_error() argument
118 no_bit_error_verify(void *error_data, void *error_ecc, void *correct_data, const size_t size) no_bit_error_verify() argument
132 single_bit_error_in_data(void *error_data, void *error_ecc, void *correct_data, void *correct_ecc, const size_t size) single_bit_error_in_data() argument
139 single_bit_error_in_ecc(void *error_data, void *error_ecc, void *correct_data, void *correct_ecc, const size_t size) single_bit_error_in_ecc() argument
146 single_bit_error_correct(void *error_data, void *error_ecc, void *correct_data, const size_t size) single_bit_error_correct() argument
160 double_bit_error_in_data(void *error_data, void *error_ecc, void *correct_data, void *correct_ecc, const size_t size) double_bit_error_in_data() argument
167 single_bit_error_in_data_and_ecc(void *error_data, void *error_ecc, void *correct_data, void *correct_ecc, const size_t size) single_bit_error_in_data_and_ecc() argument
174 double_bit_error_in_ecc(void *error_data, void *error_ecc, void *correct_data, void *correct_ecc, const size_t size) double_bit_error_in_ecc() argument
181 double_bit_error_detect(void *error_data, void *error_ecc, void *correct_data, const size_t size) double_bit_error_detect() argument
226 dump_data_ecc(void *error_data, void *error_ecc, void *correct_data, void *correct_ecc, const size_t size) dump_data_ecc() argument
/linux-4.1.27/fs/hfs/
H A Dtrans.c39 int srclen, dstlen, size; hfs_mac2asc() local
52 size = nls_disk->char2uni(src, srclen, &ch); hfs_mac2asc()
53 if (size <= 0) { hfs_mac2asc()
55 size = 1; hfs_mac2asc()
57 src += size; hfs_mac2asc()
58 srclen -= size; hfs_mac2asc()
65 size = nls_io->uni2char(ch, dst, dstlen); hfs_mac2asc()
66 if (size < 0) { hfs_mac2asc()
67 if (size == -ENAMETOOLONG) hfs_mac2asc()
70 size = 1; hfs_mac2asc()
72 dst += size; hfs_mac2asc()
73 dstlen -= size; hfs_mac2asc()
103 int srclen, dstlen, size; hfs_asc2mac() local
113 size = nls_io->char2uni(src, srclen, &ch); hfs_asc2mac()
114 if (size < 0) { hfs_asc2mac()
116 size = 1; hfs_asc2mac()
118 src += size; hfs_asc2mac()
119 srclen -= size; hfs_asc2mac()
123 size = nls_disk->uni2char(ch, dst, dstlen); hfs_asc2mac()
124 if (size < 0) { hfs_asc2mac()
125 if (size == -ENAMETOOLONG) hfs_asc2mac()
128 size = 1; hfs_asc2mac()
130 dst += size; hfs_asc2mac()
131 dstlen -= size; hfs_asc2mac()
H A Dattr.c17 const void *value, size_t size, int flags) hfs_setxattr()
40 if (size == 4) hfs_setxattr()
45 if (size == 4) hfs_setxattr()
60 void *value, size_t size) hfs_getxattr()
71 if (size) { hfs_getxattr()
85 if (size >= 4) { hfs_getxattr()
89 res = size ? -ERANGE : 4; hfs_getxattr()
91 if (size >= 4) { hfs_getxattr()
95 res = size ? -ERANGE : 4; hfs_getxattr()
99 if (size) hfs_getxattr()
106 ssize_t hfs_listxattr(struct dentry *dentry, char *buffer, size_t size) hfs_listxattr() argument
113 if (!buffer || !size) hfs_listxattr()
115 if (size < HFS_ATTRLIST_SIZE) hfs_listxattr()
16 hfs_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags) hfs_setxattr() argument
59 hfs_getxattr(struct dentry *dentry, const char *name, void *value, size_t size) hfs_getxattr() argument
/linux-4.1.27/include/uapi/linux/
H A Dsysinfo.h10 __kernel_ulong_t totalram; /* Total usable main memory size */
11 __kernel_ulong_t freeram; /* Available memory size */
14 __kernel_ulong_t totalswap; /* Total swap space size */
18 __kernel_ulong_t totalhigh; /* Total high memory size */
19 __kernel_ulong_t freehigh; /* Available high memory size */
20 __u32 mem_unit; /* Memory unit size in bytes */
H A Dsocket.h5 * Desired design of maximum size and alignment (see RFC2553)
7 #define _K_SS_MAXSIZE 128 /* Implementation specific max size */
17 /* space to achieve desired size, */
18 /* _SS_MAXSIZE value minus size of ss_family */
H A Dlimits.h9 #define MAX_CANON 255 /* size of the canonical input queue */
10 #define MAX_INPUT 255 /* size of the type-ahead buffer */
15 #define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
16 #define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
/linux-4.1.27/security/selinux/ss/
H A Dsymtab.c14 unsigned int size; symhash() local
19 size = strlen(keyp); symhash()
20 for (p = keyp; (p - keyp) < size; p++) symhash()
22 return val & (h->size - 1); symhash()
35 int symtab_init(struct symtab *s, unsigned int size) symtab_init() argument
37 s->table = hashtab_create(symhash, symcmp, size); symtab_init()
/linux-4.1.27/arch/avr32/mm/
H A Ddma-coherent.c16 void dma_cache_sync(struct device *dev, void *vaddr, size_t size, int direction) dma_cache_sync() argument
26 invalidate_dcache_region(vaddr, size); dma_cache_sync()
29 clean_dcache_region(vaddr, size); dma_cache_sync()
32 flush_dcache_region(vaddr, size); dma_cache_sync()
40 static struct page *__dma_alloc(struct device *dev, size_t size, __dma_alloc() argument
53 size = PAGE_ALIGN(size); __dma_alloc()
54 order = get_order(size); __dma_alloc()
70 invalidate_dcache_region(phys_to_virt(page_to_phys(page)), size); __dma_alloc()
73 free = page + (size >> PAGE_SHIFT); __dma_alloc()
87 static void __dma_free(struct device *dev, size_t size, __dma_free() argument
90 struct page *end = page + (PAGE_ALIGN(size) >> PAGE_SHIFT); __dma_free()
96 void *dma_alloc_coherent(struct device *dev, size_t size, dma_alloc_coherent() argument
102 page = __dma_alloc(dev, size, handle, gfp); dma_alloc_coherent()
110 void dma_free_coherent(struct device *dev, size_t size, dma_free_coherent() argument
116 pr_debug("dma_free_coherent addr %p (phys %08lx) size %u\n", dma_free_coherent()
117 cpu_addr, (unsigned long)handle, (unsigned)size); dma_free_coherent()
120 __dma_free(dev, size, page, handle); dma_free_coherent()
124 void *dma_alloc_writecombine(struct device *dev, size_t size, dma_alloc_writecombine() argument
130 page = __dma_alloc(dev, size, handle, gfp); dma_alloc_writecombine()
138 return __ioremap(phys, size, _PAGE_BUFFER); dma_alloc_writecombine()
142 void dma_free_writecombine(struct device *dev, size_t size, dma_free_writecombine() argument
150 __dma_free(dev, size, page, handle); dma_free_writecombine()
/linux-4.1.27/mm/
H A Dnobootmem.c35 static void * __init __alloc_memory_core_early(int nid, u64 size, u64 align, __alloc_memory_core_early() argument
44 addr = memblock_find_in_range_node(size, align, goal, limit, nid); __alloc_memory_core_early()
48 if (memblock_reserve(addr, size)) __alloc_memory_core_early()
52 memset(ptr, 0, size); __alloc_memory_core_early()
57 kmemleak_alloc(ptr, size, 0, 0); __alloc_memory_core_early()
64 * @size: size of the range in bytes
70 void __init free_bootmem_late(unsigned long addr, unsigned long size) free_bootmem_late() argument
74 kmemleak_free_part(__va(addr), size); free_bootmem_late() local
77 end = PFN_DOWN(addr + size); free_bootmem_late()
129 phys_addr_t size; free_low_memory_core_early() local
132 size = get_allocated_memblock_reserved_regions_info(&start); free_low_memory_core_early()
133 if (size) free_low_memory_core_early()
134 count += __free_memory_core(start, start + size); free_low_memory_core_early()
137 size = get_allocated_memblock_memory_regions_info(&start); free_low_memory_core_early()
138 if (size) free_low_memory_core_early()
139 count += __free_memory_core(start, start + size); free_low_memory_core_early()
195 * @size: size of the range in bytes
202 unsigned long size) free_bootmem_node()
204 memblock_free(physaddr, size); free_bootmem_node()
210 * @size: size of the range in bytes
216 void __init free_bootmem(unsigned long addr, unsigned long size) free_bootmem() argument
218 memblock_free(addr, size); free_bootmem()
221 static void * __init ___alloc_bootmem_nopanic(unsigned long size, ___alloc_bootmem_nopanic() argument
229 return kzalloc(size, GFP_NOWAIT); ___alloc_bootmem_nopanic()
233 ptr = __alloc_memory_core_early(NUMA_NO_NODE, size, align, goal, limit); ___alloc_bootmem_nopanic()
248 * @size: size of the request in bytes
259 void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align, __alloc_bootmem_nopanic() argument
264 return ___alloc_bootmem_nopanic(size, align, goal, limit); __alloc_bootmem_nopanic()
267 static void * __init ___alloc_bootmem(unsigned long size, unsigned long align, ___alloc_bootmem() argument
270 void *mem = ___alloc_bootmem_nopanic(size, align, goal, limit); ___alloc_bootmem()
277 printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size); ___alloc_bootmem()
284 * @size: size of the request in bytes
295 void * __init __alloc_bootmem(unsigned long size, unsigned long align, __alloc_bootmem() argument
300 return ___alloc_bootmem(size, align, goal, limit); __alloc_bootmem()
304 unsigned long size, ___alloc_bootmem_node_nopanic()
312 ptr = __alloc_memory_core_early(pgdat->node_id, size, align, ___alloc_bootmem_node_nopanic()
317 ptr = __alloc_memory_core_early(NUMA_NO_NODE, size, align, ___alloc_bootmem_node_nopanic()
330 void * __init __alloc_bootmem_node_nopanic(pg_data_t *pgdat, unsigned long size, __alloc_bootmem_node_nopanic() argument
334 return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); __alloc_bootmem_node_nopanic()
336 return ___alloc_bootmem_node_nopanic(pgdat, size, align, goal, 0); __alloc_bootmem_node_nopanic()
339 static void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, ___alloc_bootmem_node() argument
345 ptr = ___alloc_bootmem_node_nopanic(pgdat, size, align, goal, limit); ___alloc_bootmem_node()
349 printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size); ___alloc_bootmem_node()
357 * @size: size of the request in bytes
369 void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, __alloc_bootmem_node() argument
373 return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); __alloc_bootmem_node()
375 return ___alloc_bootmem_node(pgdat, size, align, goal, 0); __alloc_bootmem_node()
378 void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, __alloc_bootmem_node_high() argument
381 return __alloc_bootmem_node(pgdat, size, align, goal); __alloc_bootmem_node_high()
390 * @size: size of the request in bytes
401 void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, __alloc_bootmem_low() argument
404 return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT); __alloc_bootmem_low()
407 void * __init __alloc_bootmem_low_nopanic(unsigned long size, __alloc_bootmem_low_nopanic() argument
411 return ___alloc_bootmem_nopanic(size, align, goal, __alloc_bootmem_low_nopanic()
418 * @size: size of the request in bytes
430 void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, __alloc_bootmem_low_node() argument
434 return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); __alloc_bootmem_low_node()
436 return ___alloc_bootmem_node(pgdat, size, align, goal, __alloc_bootmem_low_node()
201 free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, unsigned long size) free_bootmem_node() argument
303 ___alloc_bootmem_node_nopanic(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit) ___alloc_bootmem_node_nopanic() argument
H A Dmaccess.c12 * @size: size of the data chunk
18 long __weak probe_kernel_read(void *dst, const void *src, size_t size)
21 long __probe_kernel_read(void *dst, const void *src, size_t size) __probe_kernel_read() argument
29 (__force const void __user *)src, size); __probe_kernel_read()
41 * @size: size of the data chunk
46 long __weak probe_kernel_write(void *dst, const void *src, size_t size)
49 long __probe_kernel_write(void *dst, const void *src, size_t size) __probe_kernel_write() argument
56 ret = __copy_to_user_inatomic((__force void __user *)dst, src, size); __probe_kernel_write()
H A Dearly_ioremap.c97 __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot) __early_ioremap() argument
116 __func__, (u64)phys_addr, size)) __early_ioremap()
119 /* Don't allow wraparound or zero size */ __early_ioremap()
120 last_addr = phys_addr + size - 1; __early_ioremap()
121 if (WARN_ON(!size || last_addr < phys_addr)) __early_ioremap()
124 prev_size[slot] = size; __early_ioremap()
130 size = PAGE_ALIGN(last_addr + 1) - phys_addr; __early_ioremap()
135 nrpages = size >> PAGE_SHIFT; __early_ioremap()
153 __func__, (u64)phys_addr, size, slot, offset, slot_virt[slot]); __early_ioremap()
159 void __init early_iounmap(void __iomem *addr, unsigned long size) early_iounmap() argument
176 addr, size)) early_iounmap()
179 if (WARN(prev_size[slot] != size, early_iounmap()
180 "early_iounmap(%p, %08lx) [%d] size not consistent %08lx\n", early_iounmap()
181 addr, size, slot, prev_size[slot])) early_iounmap()
185 addr, size, slot); early_iounmap()
192 nrpages = PAGE_ALIGN(offset + size) >> PAGE_SHIFT; early_iounmap()
208 early_ioremap(resource_size_t phys_addr, unsigned long size) early_ioremap() argument
210 return __early_ioremap(phys_addr, size, FIXMAP_PAGE_IO); early_ioremap()
215 early_memremap(resource_size_t phys_addr, unsigned long size) early_memremap() argument
217 return (__force void *)__early_ioremap(phys_addr, size, early_memremap()
223 early_ioremap(resource_size_t phys_addr, unsigned long size) early_ioremap() argument
230 early_memremap(resource_size_t phys_addr, unsigned long size) early_memremap() argument
235 void __init early_iounmap(void __iomem *addr, unsigned long size) early_iounmap() argument
242 void __init early_memunmap(void *addr, unsigned long size) early_memunmap() argument
244 early_iounmap((__force void __iomem *)addr, size); early_memunmap()
H A Dmemblock.c73 /* adjust *@size so that (@base + *@size) doesn't overflow, return new size */ memblock_cap_size()
74 static inline phys_addr_t memblock_cap_size(phys_addr_t base, phys_addr_t *size) memblock_cap_size() argument
76 return *size = min(*size, (phys_addr_t)ULLONG_MAX - base); memblock_cap_size()
89 phys_addr_t base, phys_addr_t size) memblock_overlaps_region()
95 phys_addr_t rgnsize = type->regions[i].size; memblock_overlaps_region()
96 if (memblock_addrs_overlap(base, size, rgnbase, rgnsize)) memblock_overlaps_region()
107 * @size: size of free area to find
118 phys_addr_t size, phys_addr_t align, int nid) __memblock_find_range_bottom_up()
128 if (cand < this_end && this_end - cand >= size) __memblock_find_range_bottom_up()
139 * @size: size of free area to find
150 phys_addr_t size, phys_addr_t align, int nid) __memblock_find_range_top_down()
159 if (this_end < size) __memblock_find_range_top_down()
162 cand = round_down(this_end - size, align); __memblock_find_range_top_down()
172 * @size: size of free area to find
178 * Find @size free area aligned to @align in the specified range and node.
191 phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size, memblock_find_in_range_node() argument
218 size, align, nid); memblock_find_in_range_node()
236 return __memblock_find_range_top_down(start, end, size, align, nid); memblock_find_in_range_node()
243 * @size: size of free area to find
246 * Find @size free area aligned to @align in the specified range.
252 phys_addr_t end, phys_addr_t size, memblock_find_in_range()
255 return memblock_find_in_range_node(size, align, start, end, memblock_find_in_range()
261 type->total_size -= type->regions[r].size; memblock_remove_region()
271 type->regions[0].size = 0; memblock_remove_region()
306 * memblock_double_array - double the size of the memblock regions array
309 * @new_area_size: size of memory range to avoid overlap with
311 * Double the size of the @type regions array. If memblock is being used to
336 /* Calculate new doubled size */ memblock_double_array()
437 if (this->base + this->size != next->base || memblock_merge_regions()
441 BUG_ON(this->base + this->size > next->base); memblock_merge_regions()
446 this->size += next->size; memblock_merge_regions()
458 * @size: size of the new region
462 * Insert new memblock region [@base,@base+@size) into @type at @idx.
467 phys_addr_t size, memblock_insert_region()
475 rgn->size = size; memblock_insert_region()
479 type->total_size += size; memblock_insert_region()
486 * @size: size of the new region
490 * Add new memblock region [@base,@base+@size) into @type. The new region
499 phys_addr_t base, phys_addr_t size, memblock_add_range()
504 phys_addr_t end = base + memblock_cap_size(base, &size); memblock_add_range()
507 if (!size) memblock_add_range()
511 if (type->regions[0].size == 0) { memblock_add_range()
514 type->regions[0].size = size; memblock_add_range()
517 type->total_size = size; memblock_add_range()
532 phys_addr_t rend = rbase + rgn->size; memblock_add_range()
567 if (memblock_double_array(type, obase, size) < 0) memblock_add_range()
577 int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size, memblock_add_node() argument
580 return memblock_add_range(&memblock.memory, base, size, nid, 0); memblock_add_node()
584 phys_addr_t size, memblock_add_region()
592 (unsigned long long)base + size - 1, memblock_add_region()
595 return memblock_add_range(_rgn, base, size, nid, flags); memblock_add_region()
598 int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size) memblock_add() argument
600 return memblock_add_region(base, size, MAX_NUMNODES, 0); memblock_add()
607 * @size: size of range to isolate
612 * [@base,@base+@size). Crossing regions are split at the boundaries,
620 phys_addr_t base, phys_addr_t size, memblock_isolate_range()
623 phys_addr_t end = base + memblock_cap_size(base, &size); memblock_isolate_range()
628 if (!size) memblock_isolate_range()
633 if (memblock_double_array(type, base, size) < 0) memblock_isolate_range()
639 phys_addr_t rend = rbase + rgn->size; memblock_isolate_range()
652 rgn->size -= base - rbase; memblock_isolate_range()
663 rgn->size -= end - rbase; memblock_isolate_range()
680 phys_addr_t base, phys_addr_t size) memblock_remove_range()
685 ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn); memblock_remove_range()
694 int __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size) memblock_remove() argument
696 return memblock_remove_range(&memblock.memory, base, size); memblock_remove()
700 int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size) memblock_free() argument
704 (unsigned long long)base + size - 1, memblock_free()
707 kmemleak_free_part(__va(base), size); memblock_free() local
708 return memblock_remove_range(&memblock.reserved, base, size); memblock_free()
712 phys_addr_t size, memblock_reserve_region()
720 (unsigned long long)base + size - 1, memblock_reserve_region()
723 return memblock_add_range(type, base, size, nid, flags); memblock_reserve_region()
726 int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size) memblock_reserve() argument
728 return memblock_reserve_region(base, size, MAX_NUMNODES, 0); memblock_reserve()
733 * This function isolates region [@base, @base + @size), and sets/clears flag
738 phys_addr_t size, int set, int flag) memblock_setclr_flag()
743 ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn); memblock_setclr_flag()
760 * @size: the size of the region
764 int __init_memblock memblock_mark_hotplug(phys_addr_t base, phys_addr_t size) memblock_mark_hotplug() argument
766 return memblock_setclr_flag(base, size, 1, MEMBLOCK_HOTPLUG); memblock_mark_hotplug()
772 * @size: the size of the region
776 int __init_memblock memblock_clear_hotplug(phys_addr_t base, phys_addr_t size) memblock_clear_hotplug() argument
778 return memblock_setclr_flag(base, size, 0, MEMBLOCK_HOTPLUG); memblock_clear_hotplug()
823 phys_addr_t m_end = m->base + m->size; __next_mem_range()
853 r_start = idx_b ? r[-1].base + r[-1].size : 0; __next_mem_range()
927 phys_addr_t m_end = m->base + m->size; __next_mem_range_rev()
957 r_start = idx_b ? r[-1].base + r[-1].size : 0; __next_mem_range_rev()
1002 if (PFN_UP(r->base) >= PFN_DOWN(r->base + r->size)) __next_mem_pfn_range()
1015 *out_end_pfn = PFN_DOWN(r->base + r->size); __next_mem_pfn_range()
1023 * @size: size of area to set node ID for
1027 * Set the nid of memblock @type regions in [@base,@base+@size) to @nid.
1033 int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size, memblock_set_node() argument
1039 ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn); memblock_set_node()
1051 static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, memblock_alloc_range_nid() argument
1060 found = memblock_find_in_range_node(size, align, start, end, nid); memblock_alloc_range_nid()
1061 if (found && !memblock_reserve(found, size)) { memblock_alloc_range_nid()
1066 kmemleak_alloc(__va(found), size, 0, 0); memblock_alloc_range_nid() local
1072 phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align, memblock_alloc_range() argument
1075 return memblock_alloc_range_nid(size, align, start, end, NUMA_NO_NODE); memblock_alloc_range()
1078 static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, memblock_alloc_base_nid() argument
1082 return memblock_alloc_range_nid(size, align, 0, max_addr, nid); memblock_alloc_base_nid()
1085 phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid) memblock_alloc_nid() argument
1087 return memblock_alloc_base_nid(size, align, MEMBLOCK_ALLOC_ACCESSIBLE, nid); memblock_alloc_nid()
1090 phys_addr_t __init __memblock_alloc_base(phys_addr_t size, phys_addr_t align, phys_addr_t max_addr) __memblock_alloc_base() argument
1092 return memblock_alloc_base_nid(size, align, max_addr, NUMA_NO_NODE); __memblock_alloc_base()
1095 phys_addr_t __init memblock_alloc_base(phys_addr_t size, phys_addr_t align, phys_addr_t max_addr) memblock_alloc_base() argument
1099 alloc = __memblock_alloc_base(size, align, max_addr); memblock_alloc_base()
1103 (unsigned long long) size, (unsigned long long) max_addr); memblock_alloc_base()
1108 phys_addr_t __init memblock_alloc(phys_addr_t size, phys_addr_t align) memblock_alloc() argument
1110 return memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE); memblock_alloc()
1113 phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid) memblock_alloc_try_nid() argument
1115 phys_addr_t res = memblock_alloc_nid(size, align, nid); memblock_alloc_try_nid()
1119 return memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE); memblock_alloc_try_nid()
1124 * @size: size of memory block to be allocated in bytes
1125 * @align: alignment of the region and block's size
1150 phys_addr_t size, phys_addr_t align, memblock_virt_alloc_internal()
1166 return kzalloc_node(size, GFP_NOWAIT, nid); memblock_virt_alloc_internal()
1175 alloc = memblock_find_in_range_node(size, align, min_addr, max_addr, memblock_virt_alloc_internal()
1181 alloc = memblock_find_in_range_node(size, align, min_addr, memblock_virt_alloc_internal()
1195 memblock_reserve(alloc, size); memblock_virt_alloc_internal()
1197 memset(ptr, 0, size); memblock_virt_alloc_internal()
1205 kmemleak_alloc(ptr, size, 0, 0); memblock_virt_alloc_internal()
1215 * @size: size of memory block to be allocated in bytes
1216 * @align: alignment of the region and block's size
1231 phys_addr_t size, phys_addr_t align, memblock_virt_alloc_try_nid_nopanic()
1236 __func__, (u64)size, (u64)align, nid, (u64)min_addr, memblock_virt_alloc_try_nid_nopanic()
1238 return memblock_virt_alloc_internal(size, align, min_addr, memblock_virt_alloc_try_nid_nopanic()
1244 * @size: size of memory block to be allocated in bytes
1245 * @align: alignment of the region and block's size
1261 phys_addr_t size, phys_addr_t align, memblock_virt_alloc_try_nid()
1268 __func__, (u64)size, (u64)align, nid, (u64)min_addr, memblock_virt_alloc_try_nid()
1270 ptr = memblock_virt_alloc_internal(size, align, memblock_virt_alloc_try_nid()
1276 __func__, (u64)size, (u64)align, nid, (u64)min_addr, memblock_virt_alloc_try_nid()
1284 * @size: size of the boot memory block in bytes
1289 void __init __memblock_free_early(phys_addr_t base, phys_addr_t size) __memblock_free_early() argument
1292 __func__, (u64)base, (u64)base + size - 1, __memblock_free_early()
1294 kmemleak_free_part(__va(base), size); __memblock_free_early() local
1295 memblock_remove_range(&memblock.reserved, base, size); __memblock_free_early()
1301 * @size: size of the boot memory block in bytes
1307 void __init __memblock_free_late(phys_addr_t base, phys_addr_t size) __memblock_free_late() argument
1312 __func__, (u64)base, (u64)base + size - 1, __memblock_free_late()
1314 kmemleak_free_part(__va(base), size); __memblock_free_late() local
1316 end = PFN_DOWN(base + size); __memblock_free_late()
1360 return (memblock.memory.regions[idx].base + memblock.memory.regions[idx].size); memblock_end_of_DRAM()
1373 if (limit <= r->size) { for_each_memblock()
1377 limit -= r->size; for_each_memblock()
1397 type->regions[mid].size)) memblock_search()
1426 *end_pfn = PFN_DOWN(type->regions[mid].base + type->regions[mid].size); memblock_search_pfn_nid()
1435 * @size: size of region to check
1437 * Check if the region [@base, @base+@size) is a subset of a memory block.
1442 int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size) memblock_is_region_memory() argument
1445 phys_addr_t end = base + memblock_cap_size(base, &size); memblock_is_region_memory()
1451 memblock.memory.regions[idx].size) >= end; memblock_is_region_memory()
1457 * @size: size of region to check
1459 * Check if the region [@base, @base+@size) intersects a reserved memory block.
1464 int __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t size) memblock_is_region_reserved() argument
1466 memblock_cap_size(base, &size); memblock_is_region_reserved()
1467 return memblock_overlaps_region(&memblock.reserved, base, size) >= 0; memblock_is_region_reserved()
1477 orig_end = r->base + r->size; for_each_memblock()
1486 r->size = end - start; for_each_memblock()
1507 unsigned long long base, size; memblock_dump() local
1518 size = rgn->size; memblock_dump()
1526 name, i, base, base + size - 1, size, nid_buf, flags); memblock_dump()
1533 pr_info(" memory size = %#llx reserved size = %#llx\n", __memblock_dump_all()
1568 (unsigned long)(reg->base + reg->size - 1)); memblock_debug_show()
1572 (unsigned long long)(reg->base + reg->size - 1)); memblock_debug_show()
88 memblock_overlaps_region(struct memblock_type *type, phys_addr_t base, phys_addr_t size) memblock_overlaps_region() argument
117 __memblock_find_range_bottom_up(phys_addr_t start, phys_addr_t end, phys_addr_t size, phys_addr_t align, int nid) __memblock_find_range_bottom_up() argument
149 __memblock_find_range_top_down(phys_addr_t start, phys_addr_t end, phys_addr_t size, phys_addr_t align, int nid) __memblock_find_range_top_down() argument
251 memblock_find_in_range(phys_addr_t start, phys_addr_t end, phys_addr_t size, phys_addr_t align) memblock_find_in_range() argument
465 memblock_insert_region(struct memblock_type *type, int idx, phys_addr_t base, phys_addr_t size, int nid, unsigned long flags) memblock_insert_region() argument
498 memblock_add_range(struct memblock_type *type, phys_addr_t base, phys_addr_t size, int nid, unsigned long flags) memblock_add_range() argument
583 memblock_add_region(phys_addr_t base, phys_addr_t size, int nid, unsigned long flags) memblock_add_region() argument
619 memblock_isolate_range(struct memblock_type *type, phys_addr_t base, phys_addr_t size, int *start_rgn, int *end_rgn) memblock_isolate_range() argument
679 memblock_remove_range(struct memblock_type *type, phys_addr_t base, phys_addr_t size) memblock_remove_range() argument
711 memblock_reserve_region(phys_addr_t base, phys_addr_t size, int nid, unsigned long flags) memblock_reserve_region() argument
737 memblock_setclr_flag(phys_addr_t base, phys_addr_t size, int set, int flag) memblock_setclr_flag() argument
1149 memblock_virt_alloc_internal( phys_addr_t size, phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid) memblock_virt_alloc_internal() argument
1230 memblock_virt_alloc_try_nid_nopanic( phys_addr_t size, phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid) memblock_virt_alloc_try_nid_nopanic() argument
1260 memblock_virt_alloc_try_nid( phys_addr_t size, phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid) memblock_virt_alloc_try_nid() argument
H A Dbootmem.c65 * bootmem_bootmap_pages - calculate bitmap size in pages
151 * @size: size of the range in bytes
157 void __init free_bootmem_late(unsigned long physaddr, unsigned long size) free_bootmem_late() argument
161 kmemleak_free_part(__va(physaddr), size); free_bootmem_late() local
164 end = PFN_DOWN(physaddr + size); free_bootmem_late()
387 * @size: size of the range in bytes
394 unsigned long size) free_bootmem_node()
398 kmemleak_free_part(__va(physaddr), size); free_bootmem_node() local
401 end = PFN_DOWN(physaddr + size); free_bootmem_node()
409 * @size: size of the range in bytes
415 void __init free_bootmem(unsigned long physaddr, unsigned long size) free_bootmem() argument
419 kmemleak_free_part(__va(physaddr), size); free_bootmem() local
422 end = PFN_DOWN(physaddr + size); free_bootmem()
431 * @size: size of the range in bytes
439 unsigned long size, int flags) reserve_bootmem_node()
444 end = PFN_UP(physaddr + size); reserve_bootmem_node()
452 * @size: size of the range in bytes
459 int __init reserve_bootmem(unsigned long addr, unsigned long size, reserve_bootmem() argument
465 end = PFN_UP(addr + size); reserve_bootmem()
494 unsigned long size, unsigned long align, alloc_bootmem_bdata()
500 bdebug("nid=%td size=%lx [%lu pages] align=%lx goal=%lx limit=%lx\n", alloc_bootmem_bdata()
501 bdata - bootmem_node_data, size, PAGE_ALIGN(size) >> PAGE_SHIFT, alloc_bootmem_bdata()
504 BUG_ON(!size); alloc_bootmem_bdata()
506 BUG_ON(limit && goal + size > limit); alloc_bootmem_bdata()
548 eidx = sidx + PFN_UP(size); alloc_bootmem_bdata()
568 end_off = start_off + size; alloc_bootmem_bdata()
582 memset(region, 0, size); alloc_bootmem_bdata()
587 kmemleak_alloc(region, size, 0, 0); alloc_bootmem_bdata()
600 static void * __init alloc_bootmem_core(unsigned long size, alloc_bootmem_core() argument
609 return kzalloc(size, GFP_NOWAIT); alloc_bootmem_core()
617 region = alloc_bootmem_bdata(bdata, size, align, goal, limit); alloc_bootmem_core()
625 static void * __init ___alloc_bootmem_nopanic(unsigned long size, ___alloc_bootmem_nopanic() argument
633 ptr = alloc_bootmem_core(size, align, goal, limit); ___alloc_bootmem_nopanic()
646 * @size: size of the request in bytes
657 void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align, __alloc_bootmem_nopanic() argument
662 return ___alloc_bootmem_nopanic(size, align, goal, limit); __alloc_bootmem_nopanic()
665 static void * __init ___alloc_bootmem(unsigned long size, unsigned long align, ___alloc_bootmem() argument
668 void *mem = ___alloc_bootmem_nopanic(size, align, goal, limit); ___alloc_bootmem()
675 printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size); ___alloc_bootmem()
682 * @size: size of the request in bytes
693 void * __init __alloc_bootmem(unsigned long size, unsigned long align, __alloc_bootmem() argument
698 return ___alloc_bootmem(size, align, goal, limit); __alloc_bootmem()
702 unsigned long size, unsigned long align, ___alloc_bootmem_node_nopanic()
708 return kzalloc(size, GFP_NOWAIT); ___alloc_bootmem_node_nopanic()
712 if (limit && goal + size > limit) ___alloc_bootmem_node_nopanic()
715 ptr = alloc_bootmem_bdata(pgdat->bdata, size, align, goal, limit); ___alloc_bootmem_node_nopanic()
719 ptr = alloc_bootmem_core(size, align, goal, limit); ___alloc_bootmem_node_nopanic()
731 void * __init __alloc_bootmem_node_nopanic(pg_data_t *pgdat, unsigned long size, __alloc_bootmem_node_nopanic() argument
735 return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); __alloc_bootmem_node_nopanic()
737 return ___alloc_bootmem_node_nopanic(pgdat, size, align, goal, 0); __alloc_bootmem_node_nopanic()
740 void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, ___alloc_bootmem_node() argument
746 ptr = ___alloc_bootmem_node_nopanic(pgdat, size, align, goal, 0); ___alloc_bootmem_node()
750 printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size); ___alloc_bootmem_node()
758 * @size: size of the request in bytes
770 void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, __alloc_bootmem_node() argument
774 return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); __alloc_bootmem_node()
776 return ___alloc_bootmem_node(pgdat, size, align, goal, 0); __alloc_bootmem_node()
779 void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, __alloc_bootmem_node_high() argument
786 return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); __alloc_bootmem_node_high()
797 ptr = alloc_bootmem_bdata(pgdat->bdata, size, align, __alloc_bootmem_node_high()
804 return __alloc_bootmem_node(pgdat, size, align, goal); __alloc_bootmem_node_high()
814 * @size: size of the request in bytes
825 void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, __alloc_bootmem_low() argument
828 return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT); __alloc_bootmem_low()
831 void * __init __alloc_bootmem_low_nopanic(unsigned long size, __alloc_bootmem_low_nopanic() argument
835 return ___alloc_bootmem_nopanic(size, align, goal, __alloc_bootmem_low_nopanic()
842 * @size: size of the request in bytes
854 void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, __alloc_bootmem_low_node() argument
858 return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); __alloc_bootmem_low_node()
860 return ___alloc_bootmem_node(pgdat, size, align, __alloc_bootmem_low_node()
393 free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, unsigned long size) free_bootmem_node() argument
438 reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, unsigned long size, int flags) reserve_bootmem_node() argument
493 alloc_bootmem_bdata(struct bootmem_data *bdata, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit) alloc_bootmem_bdata() argument
701 ___alloc_bootmem_node_nopanic(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit) ___alloc_bootmem_node_nopanic() argument
/linux-4.1.27/arch/x86/include/asm/xen/
H A Dpage-coherent.h8 static inline void *xen_alloc_coherent_pages(struct device *hwdev, size_t size, xen_alloc_coherent_pages() argument
12 void *vstart = (void*)__get_free_pages(flags, get_order(size)); xen_alloc_coherent_pages()
17 static inline void xen_free_coherent_pages(struct device *hwdev, size_t size, xen_free_coherent_pages() argument
21 free_pages((unsigned long) cpu_addr, get_order(size)); xen_free_coherent_pages()
25 dma_addr_t dev_addr, unsigned long offset, size_t size, xen_dma_map_page()
29 size_t size, enum dma_data_direction dir, xen_dma_unmap_page()
33 dma_addr_t handle, size_t size, enum dma_data_direction dir) { }
36 dma_addr_t handle, size_t size, enum dma_data_direction dir) { }
24 xen_dma_map_page(struct device *hwdev, struct page *page, dma_addr_t dev_addr, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_dma_map_page() argument
28 xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_dma_unmap_page() argument
32 xen_dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_cpu() argument
35 xen_dma_sync_single_for_device(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_device() argument
/linux-4.1.27/arch/xtensa/include/asm/
H A Dflat.h6 #define flat_reloc_valid(reloc, size) ((reloc) <= (size))
H A Dshmparam.h13 * Xtensa can have variable size caches, and if
14 * the size of single way is larger than the page size,
H A Ddma-mapping.h32 void *dma_alloc_coherent(struct device *dev, size_t size,
35 void dma_free_coherent(struct device *dev, size_t size,
39 dma_map_single(struct device *dev, void *ptr, size_t size, dma_map_single() argument
43 consistent_sync(ptr, size, direction); dma_map_single()
48 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, dma_unmap_single() argument
74 size_t size, enum dma_data_direction direction) dma_map_page()
81 dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, dma_unmap_page() argument
96 dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, dma_sync_single_for_cpu() argument
99 consistent_sync((void *)bus_to_virt(dma_handle), size, direction); dma_sync_single_for_cpu()
104 size_t size, enum dma_data_direction direction) dma_sync_single_for_device()
106 consistent_sync((void *)bus_to_virt(dma_handle), size, direction); dma_sync_single_for_device()
111 unsigned long offset, size_t size, dma_sync_single_range_for_cpu()
115 consistent_sync((void *)bus_to_virt(dma_handle)+offset,size,direction); dma_sync_single_range_for_cpu()
120 unsigned long offset, size_t size, dma_sync_single_range_for_device()
124 consistent_sync((void *)bus_to_virt(dma_handle)+offset,size,direction); dma_sync_single_range_for_device()
167 dma_cache_sync(struct device *dev, void *vaddr, size_t size, dma_cache_sync() argument
170 consistent_sync(vaddr, size, direction); dma_cache_sync()
176 dma_addr_t dma_addr, size_t size) dma_mmap_coherent()
183 size_t size) dma_get_sgtable()
188 static inline void *dma_alloc_attrs(struct device *dev, size_t size, dma_alloc_attrs() argument
195 static inline void dma_free_attrs(struct device *dev, size_t size, dma_free_attrs() argument
73 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) dma_map_page() argument
103 dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) dma_sync_single_for_device() argument
110 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_cpu() argument
119 dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_device() argument
174 dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size) dma_mmap_coherent() argument
181 dma_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr, dma_addr_t dma_addr, size_t size) dma_get_sgtable() argument
/linux-4.1.27/arch/c6x/include/asm/
H A Dclkdev.h17 static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size) __clkdev_alloc() argument
19 return kzalloc(size, GFP_KERNEL); __clkdev_alloc()
H A Dflat.h6 #define flat_reloc_valid(reloc, size) ((reloc) <= (size))
H A Ddma-mapping.h23 size_t size, dma_sync_single_range_for_device()
48 size_t size, enum dma_data_direction dir);
51 size_t size, enum dma_data_direction dir);
60 unsigned long offset, size_t size, dma_map_page()
65 handle = dma_map_single(dev, page_address(page) + offset, size, dir); dma_map_page()
67 debug_dma_map_page(dev, page, offset, size, dir, handle, false); dma_map_page()
73 size_t size, enum dma_data_direction dir) dma_unmap_page()
75 dma_unmap_single(dev, handle, size, dir); dma_unmap_page()
77 debug_dma_unmap_page(dev, handle, size, dir, false); dma_unmap_page()
81 size_t size, enum dma_data_direction dir);
84 size_t size,
93 extern void coherent_mem_init(u32 start, u32 size);
103 dma_addr_t dma_addr, size_t size) dma_mmap_coherent()
110 size_t size) dma_get_sgtable()
20 dma_sync_single_range_for_device(struct device *dev, dma_addr_t addr, unsigned long offset, size_t size, enum dma_data_direction dir) dma_sync_single_range_for_device() argument
59 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
72 dma_unmap_page(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
101 dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size) dma_mmap_coherent() argument
108 dma_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr, dma_addr_t dma_addr, size_t size) dma_get_sgtable() argument
/linux-4.1.27/arch/um/kernel/
H A Dmaccess.c13 long probe_kernel_read(void *dst, const void *src, size_t size) probe_kernel_read() argument
17 if ((unsigned long)src < PAGE_SIZE || size <= 0) probe_kernel_read()
20 if (os_mincore(psrc, size + src - psrc) <= 0) probe_kernel_read()
23 return __probe_kernel_read(dst, src, size); probe_kernel_read()
H A Dinitrd.c15 static int load_initrd(char *filename, void *buf, int size);
20 long long size; read_initrd() local
26 err = os_file_size(initrd, &size); read_initrd()
34 if (size == 0) { read_initrd()
35 printk(KERN_ERR "\"%s\" is a zero-size initrd\n", initrd); read_initrd()
39 area = alloc_bootmem(size); read_initrd()
43 if (load_initrd(initrd, area, size) == -1) read_initrd()
47 initrd_end = initrd_start + size; read_initrd()
65 static int load_initrd(char *filename, void *buf, int size) load_initrd() argument
75 n = os_read_file(fd, buf, size); load_initrd()
76 if (n != size) { load_initrd()
78 "err = %d\n", size, load_initrd()
/linux-4.1.27/fs/ncpfs/
H A Dncpsign_kernel.h12 void __sign_packet(struct ncp_server *server, const char *data, size_t size, __u32 totalsize, void *sign_buff);
13 int sign_verify_reply(struct ncp_server *server, const char *data, size_t size, __u32 totalsize, const void *sign_buff);
16 static inline size_t sign_packet(struct ncp_server *server, const char *data, size_t size, __u32 totalsize, void *sign_buff) { sign_packet() argument
19 __sign_packet(server, data, size, totalsize, sign_buff); sign_packet()
/linux-4.1.27/arch/arm/include/asm/
H A Dmemblock.h7 phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align);
H A Dshmparam.h5 * This should be the size of the virtually indexed cache/ways,
6 * or page size, whichever is greater since the cache aliases
7 * every size/ways bytes.
H A Ddma-contiguous.h9 void dma_contiguous_early_fixup(phys_addr_t base, unsigned long size);
H A Dflat.h10 #define flat_reloc_valid(reloc, size) ((reloc) <= (size))
/linux-4.1.27/tools/perf/util/include/asm/
H A Duaccess.h12 #define access_ok(type, addr, size) 1
/linux-4.1.27/arch/metag/mm/
H A Dmaccess.c18 long probe_kernel_write(void *dst, const void *src, size_t size) probe_kernel_write() argument
27 if (!size) probe_kernel_write()
40 (ldst & (size - 1)) || /* destination unaligned */ probe_kernel_write()
41 size > 8 || /* more than max write size */ probe_kernel_write()
42 (size & (size - 1))) /* non power of 2 size */ probe_kernel_write()
43 return __probe_kernel_write(dst, src, size); probe_kernel_write()
46 if (lsrc & (size - 1)) { probe_kernel_write()
47 for (i = 0; i < size; ++i) probe_kernel_write()
52 switch (size) { probe_kernel_write()
/linux-4.1.27/include/net/
H A Dtso.h9 size_t size; member in struct:tso_t
16 int size, bool is_last);
17 void tso_build_data(struct sk_buff *skb, struct tso_t *tso, int size);
/linux-4.1.27/tools/lib/lockdep/uinclude/linux/
H A Dstacktrace.h24 size_t size; dump_stack() local
26 size = backtrace(array, 64); dump_stack()
27 backtrace_symbols_fd(array, size, 1); dump_stack()
/linux-4.1.27/arch/s390/kernel/
H A Dos_info.c28 int size = sizeof(*os_info) - offsetof(struct os_info, version_major); os_info_csum() local
29 return csum_partial(&os_info->version_major, size, 0); os_info_csum()
35 void os_info_crashkernel_add(unsigned long base, unsigned long size) os_info_crashkernel_add() argument
38 os_info.crashkernel_size = (u64)(unsigned long)size; os_info_crashkernel_add()
45 void os_info_entry_add(int nr, void *ptr, u64 size) os_info_entry_add() argument
48 os_info.entry[nr].size = size; os_info_entry_add()
49 os_info.entry[nr].csum = csum_partial(ptr, size, 0); os_info_entry_add()
76 unsigned long addr, size = 0; os_info_old_alloc() local
85 size = os_info_old->entry[nr].size; os_info_old_alloc()
86 buf = kmalloc(size + align - 1, GFP_KERNEL); os_info_old_alloc()
92 if (copy_from_oldmem(buf_align, (void *) addr, size)) { os_info_old_alloc()
96 csum = csum_partial(buf_align, size, 0); os_info_old_alloc()
109 pr_info("entry %i: %s (addr=0x%lx size=%lu)\n", os_info_old_alloc()
110 nr, msg, addr, size); os_info_old_alloc()
142 pr_info("crashkernel: addr=0x%lx size=%lu\n", os_info_old_init()
155 * Return pointer to os infor entry and its size
157 void *os_info_old_entry(int nr, unsigned long *size) os_info_old_entry() argument
165 *size = (unsigned long) os_info_old->entry[nr].size; os_info_old_entry()
/linux-4.1.27/arch/m68k/kernel/
H A Ddma.c21 void *dma_alloc_coherent(struct device *dev, size_t size, dma_alloc_coherent() argument
29 pr_debug("dma_alloc_coherent: %d,%x\n", size, flag); dma_alloc_coherent()
31 size = PAGE_ALIGN(size); dma_alloc_coherent()
32 order = get_order(size); dma_alloc_coherent()
47 size >>= PAGE_SHIFT; dma_alloc_coherent()
49 for (i = 1; i < size; i++) dma_alloc_coherent()
58 addr = vmap(map, size, VM_MAP, pgprot); dma_alloc_coherent()
64 void dma_free_coherent(struct device *dev, size_t size, dma_free_coherent() argument
75 void *dma_alloc_coherent(struct device *dev, size_t size, dma_alloc_coherent() argument
84 ret = (void *)__get_free_pages(gfp, get_order(size)); dma_alloc_coherent()
87 memset(ret, 0, size); dma_alloc_coherent()
93 void dma_free_coherent(struct device *dev, size_t size, dma_free_coherent() argument
96 free_pages((unsigned long)vaddr, get_order(size)); dma_free_coherent()
105 size_t size, enum dma_data_direction dir) dma_sync_single_for_device()
110 cache_push(handle, size); dma_sync_single_for_device()
113 cache_clear(handle, size); dma_sync_single_for_device()
133 dma_addr_t dma_map_single(struct device *dev, void *addr, size_t size, dma_map_single() argument
138 dma_sync_single_for_device(dev, handle, size, dir); dma_map_single()
144 unsigned long offset, size_t size, dma_map_page()
149 dma_sync_single_for_device(dev, handle, size, dir); dma_map_page()
104 dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_device() argument
143 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
H A Dbootinfo_proc.c36 size_t size = sizeof(bi->tag); save_bootinfo() local
39 uint16_t n = be16_to_cpu(bi->size); save_bootinfo()
40 size += n; save_bootinfo()
44 if (size > sizeof(bootinfo_tmp)) { save_bootinfo()
45 pr_err("Cannot save %zu bytes of bootinfo\n", size); save_bootinfo()
49 pr_info("Saving %zu bytes of bootinfo\n", size); save_bootinfo()
50 memcpy(bootinfo_tmp, start, size); save_bootinfo()
51 bootinfo_size = size; save_bootinfo()
/linux-4.1.27/sound/pci/asihpi/
H A Dhpimsginit.c27 /* The actual message size for each object type */
29 /* The actual response size for each object type */
40 u16 size; hpi_init_message() local
43 size = msg_size[object]; hpi_init_message()
45 size = sizeof(*phm); hpi_init_message()
47 memset(phm, 0, size); hpi_init_message()
48 phm->size = size; hpi_init_message()
67 u16 size; hpi_init_response() local
70 size = res_size[object]; hpi_init_response()
72 size = sizeof(*phr); hpi_init_response()
75 phr->size = size; hpi_init_response()
94 static void hpi_init_messageV1(struct hpi_message_header *phm, u16 size, hpi_init_messageV1() argument
97 memset(phm, 0, size); hpi_init_messageV1()
99 phm->size = size; hpi_init_messageV1()
108 void hpi_init_responseV1(struct hpi_response_header *phr, u16 size, hpi_init_responseV1() argument
113 memset(phr, 0, size); hpi_init_responseV1()
114 phr->size = size; hpi_init_responseV1()
H A Dhpios.c44 If allocation fails, return 1, and *pMemArea.size = 0
46 u16 hpios_locked_mem_alloc(struct consistent_dma_area *p_mem_area, u32 size, hpios_locked_mem_alloc() argument
51 dma_alloc_coherent(&pdev->dev, size, &p_mem_area->dma_handle, hpios_locked_mem_alloc()
56 size, (unsigned int)p_mem_area->dma_handle, hpios_locked_mem_alloc()
59 p_mem_area->size = size; hpios_locked_mem_alloc()
63 "failed to allocate %d bytes locked memory\n", size); hpios_locked_mem_alloc()
64 p_mem_area->size = 0; hpios_locked_mem_alloc()
71 if (p_mem_area->size) { hpios_locked_mem_free()
72 dma_free_coherent(p_mem_area->pdev, p_mem_area->size, hpios_locked_mem_free()
75 (unsigned long)p_mem_area->size, hpios_locked_mem_free()
78 p_mem_area->size = 0; hpios_locked_mem_free()
/linux-4.1.27/drivers/infiniband/hw/cxgb3/
H A Dcxio_dbg.c45 int size = 32; cxio_dump_tpt() local
47 m = kmalloc(sizeof(*m) + size, GFP_ATOMIC); cxio_dump_tpt()
54 m->len = size; cxio_dump_tpt()
64 while (size > 0) { cxio_dump_tpt()
66 size -= 8; cxio_dump_tpt()
78 int size, npages; cxio_dump_pbl() local
82 size = npages * sizeof(u64); cxio_dump_pbl()
84 m = kmalloc(sizeof(*m) + size, GFP_ATOMIC); cxio_dump_pbl()
91 m->len = size; cxio_dump_pbl()
102 while (size > 0) { cxio_dump_pbl()
104 size -= 8; cxio_dump_pbl()
114 uint size = (uint)(be64_to_cpu(*data) & 0xff); cxio_dump_wqe() local
116 if (size == 0) cxio_dump_wqe()
117 size = 8; cxio_dump_wqe()
118 while (size > 0) { cxio_dump_wqe()
121 size--; cxio_dump_wqe()
129 int size = sizeof(*wce); cxio_dump_wce() local
131 while (size > 0) { cxio_dump_wce()
134 size -= 8; cxio_dump_wce()
142 int size = nents * 64; cxio_dump_rqt() local
146 m = kmalloc(sizeof(*m) + size, GFP_ATOMIC); cxio_dump_rqt()
153 m->len = size; cxio_dump_rqt()
163 while (size > 0) { cxio_dump_rqt()
165 size -= 8; cxio_dump_rqt()
175 int size = TCB_SIZE; cxio_dump_tcb() local
179 m = kmalloc(sizeof(*m) + size, GFP_ATOMIC); cxio_dump_tcb()
185 m->addr = hwtid * size; cxio_dump_tcb()
186 m->len = size; cxio_dump_tcb()
196 while (size > 0) { cxio_dump_tcb()
201 size -= 32; cxio_dump_tcb()
/linux-4.1.27/mm/kasan/
H A Dkasan.c39 * Poisons the shadow memory for 'size' bytes starting from 'addr'.
42 static void kasan_poison_shadow(const void *address, size_t size, u8 value) kasan_poison_shadow() argument
47 shadow_end = kasan_mem_to_shadow(address + size); kasan_poison_shadow()
52 void kasan_unpoison_shadow(const void *address, size_t size) kasan_unpoison_shadow() argument
54 kasan_poison_shadow(address, size, 0); kasan_unpoison_shadow()
56 if (size & KASAN_SHADOW_MASK) { kasan_unpoison_shadow()
57 u8 *shadow = (u8 *)kasan_mem_to_shadow(address + size); kasan_unpoison_shadow()
58 *shadow = size & KASAN_SHADOW_MASK; kasan_unpoison_shadow()
66 * depending on memory access size X.
153 size_t size) bytes_is_zero()
155 while (size) { bytes_is_zero()
159 size--; bytes_is_zero()
195 size_t size) memory_is_poisoned_n()
200 kasan_mem_to_shadow((void *)addr + size - 1) + 1); memory_is_poisoned_n()
203 unsigned long last_byte = addr + size - 1; memory_is_poisoned_n()
213 static __always_inline bool memory_is_poisoned(unsigned long addr, size_t size) memory_is_poisoned() argument
215 if (__builtin_constant_p(size)) { memory_is_poisoned()
216 switch (size) { memory_is_poisoned()
232 return memory_is_poisoned_n(addr, size); memory_is_poisoned()
237 size_t size, bool write) check_memory_region()
241 if (unlikely(size == 0)) check_memory_region()
247 info.access_size = size; check_memory_region()
254 if (likely(!memory_is_poisoned(addr, size))) check_memory_region()
257 kasan_report(addr, size, write, _RET_IP_); check_memory_region()
260 void __asan_loadN(unsigned long addr, size_t size);
261 void __asan_storeN(unsigned long addr, size_t size);
329 unsigned long size = cache->object_size; kasan_slab_free() local
330 unsigned long rounded_up_size = round_up(size, KASAN_SHADOW_SCALE_SIZE); kasan_slab_free()
339 void kasan_kmalloc(struct kmem_cache *cache, const void *object, size_t size) kasan_kmalloc() argument
347 redzone_start = round_up((unsigned long)(object + size), kasan_kmalloc()
352 kasan_unpoison_shadow(object, size); kasan_kmalloc()
358 void kasan_kmalloc_large(const void *ptr, size_t size) kasan_kmalloc_large() argument
368 redzone_start = round_up((unsigned long)(ptr + size), kasan_kmalloc_large()
372 kasan_unpoison_shadow(ptr, size); kasan_kmalloc_large()
377 void kasan_krealloc(const void *object, size_t size) kasan_krealloc() argument
387 kasan_kmalloc_large(object, size); kasan_krealloc()
389 kasan_kmalloc(page->slab_cache, object, size); kasan_krealloc()
413 int kasan_module_alloc(void *addr, size_t size) kasan_module_alloc() argument
420 shadow_size = round_up(size >> KASAN_SHADOW_SCALE_SHIFT, kasan_module_alloc()
448 size_t aligned_size = round_up(global->size, KASAN_SHADOW_SCALE_SIZE); register_global()
450 kasan_unpoison_shadow(global->beg, global->size); register_global()
457 void __asan_register_globals(struct kasan_global *globals, size_t size) __asan_register_globals() argument
461 for (i = 0; i < size; i++) __asan_register_globals()
466 void __asan_unregister_globals(struct kasan_global *globals, size_t size) __asan_unregister_globals() argument
471 #define DEFINE_ASAN_LOAD_STORE(size) \
472 void __asan_load##size(unsigned long addr) \
474 check_memory_region(addr, size, false); \
476 EXPORT_SYMBOL(__asan_load##size); \
477 __alias(__asan_load##size) \
478 void __asan_load##size##_noabort(unsigned long); \
479 EXPORT_SYMBOL(__asan_load##size##_noabort); \
480 void __asan_store##size(unsigned long addr) \
482 check_memory_region(addr, size, true); \
484 EXPORT_SYMBOL(__asan_store##size); \
485 __alias(__asan_store##size) \
486 void __asan_store##size##_noabort(unsigned long); \
487 EXPORT_SYMBOL(__asan_store##size##_noabort)
495 void __asan_loadN(unsigned long addr, size_t size) __asan_loadN() argument
497 check_memory_region(addr, size, false); __asan_loadN()
505 void __asan_storeN(unsigned long addr, size_t size) __asan_storeN() argument
507 check_memory_region(addr, size, true); __asan_storeN()
152 bytes_is_zero(const u8 *start, size_t size) bytes_is_zero() argument
194 memory_is_poisoned_n(unsigned long addr, size_t size) memory_is_poisoned_n() argument
236 check_memory_region(unsigned long addr, size_t size, bool write) check_memory_region() argument
/linux-4.1.27/arch/x86/kernel/cpu/mtrr/
H A Damd.c10 unsigned long *size, mtrr_type *type) amd_get_mtrr()
26 *size = 0; amd_get_mtrr()
30 * This needs a little explaining. The size is stored as an amd_get_mtrr()
34 * So to get a size we do invert the mask and add 1 to the lowest amd_get_mtrr()
35 * mask bit (4 as its 2 bits in). This gives us a size we then shift amd_get_mtrr()
45 *size = (low + 4) << (15 - PAGE_SHIFT); amd_get_mtrr()
53 * @size The size of the region. If this is 0 the region is disabled.
59 amd_set_mtrr(unsigned int reg, unsigned long base, unsigned long size, mtrr_type type) amd_set_mtrr() argument
70 if (size == 0) { amd_set_mtrr()
75 * inverted bitmask of the size The size is the only odd amd_set_mtrr()
82 regs[reg] = (-size >> (15 - PAGE_SHIFT) & 0x0001FFFC) amd_set_mtrr()
95 amd_validate_add_page(unsigned long base, unsigned long size, unsigned int type) amd_validate_add_page() argument
98 * Apply the K6 block alignment and size rules amd_validate_add_page()
105 if (type > MTRR_TYPE_WRCOMB || size < (1 << (17 - PAGE_SHIFT)) amd_validate_add_page()
106 || (size & ~(size - 1)) - size || (base & (size - 1))) amd_validate_add_page()
9 amd_get_mtrr(unsigned int reg, unsigned long *base, unsigned long *size, mtrr_type *type) amd_get_mtrr() argument
H A Dif.c38 mtrr_file_add(unsigned long base, unsigned long size, mtrr_file_add() argument
52 if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) mtrr_file_add()
55 size >>= PAGE_SHIFT; mtrr_file_add()
57 reg = mtrr_add_page(base, size, type, true); mtrr_file_add()
64 mtrr_file_del(unsigned long base, unsigned long size, mtrr_file_del() argument
71 if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) mtrr_file_del()
74 size >>= PAGE_SHIFT; mtrr_file_del()
76 reg = mtrr_del_page(-1, base, size); mtrr_file_del()
91 * "base=%Lx size=%Lx type=%s" or "disable=%d"
98 unsigned long long base, size; mtrr_write() local
140 if (strncmp(ptr, "size=", 5)) mtrr_write()
143 size = simple_strtoull(ptr + 5, &ptr, 0); mtrr_write()
144 if ((base & 0xfff) || (size & 0xfff)) mtrr_write()
156 size >>= PAGE_SHIFT; mtrr_write()
157 err = mtrr_add_page((unsigned long)base, (unsigned long)size, i, true); mtrr_write()
171 unsigned long size; mtrr_ioctl() local
206 err |= get_user(sentry.size, &s32->size); mtrr_ioctl()
219 err |= get_user(gentry.size, &g32->size); mtrr_ioctl()
238 mtrr_file_add(sentry.base, sentry.size, sentry.type, true, mtrr_ioctl()
247 err = mtrr_add(sentry.base, sentry.size, sentry.type, false); mtrr_ioctl()
255 err = mtrr_file_del(sentry.base, sentry.size, file, 0); mtrr_ioctl()
263 err = mtrr_del(-1, sentry.base, sentry.size); mtrr_ioctl()
271 mtrr_if->get(gentry.regnum, &base, &size, &type); mtrr_ioctl()
274 if (base + size - 1 >= (1UL << (8 * sizeof(gentry.size) - PAGE_SHIFT)) mtrr_ioctl()
275 || size >= (1UL << (8 * sizeof(gentry.size) - PAGE_SHIFT))) mtrr_ioctl()
276 gentry.base = gentry.size = gentry.type = 0; mtrr_ioctl()
279 gentry.size = size << PAGE_SHIFT; mtrr_ioctl()
291 mtrr_file_add(sentry.base, sentry.size, sentry.type, true, mtrr_ioctl()
301 mtrr_add_page(sentry.base, sentry.size, sentry.type, false); mtrr_ioctl()
309 err = mtrr_file_del(sentry.base, sentry.size, file, 1); mtrr_ioctl()
317 err = mtrr_del_page(-1, sentry.base, sentry.size); mtrr_ioctl()
325 mtrr_if->get(gentry.regnum, &base, &size, &type); mtrr_ioctl()
327 if (size != (__typeof__(gentry.size))size) mtrr_ioctl()
328 gentry.base = gentry.size = gentry.type = 0; mtrr_ioctl()
331 gentry.size = size; mtrr_ioctl()
353 err |= put_user(gentry.size, &g32->size); mtrr_ioctl()
409 unsigned long base, size; mtrr_seq_show() local
413 mtrr_if->get(i, &base, &size, &type); mtrr_seq_show()
414 if (size == 0) { mtrr_seq_show()
418 if (size < (0x100000 >> PAGE_SHIFT)) { mtrr_seq_show()
421 size <<= PAGE_SHIFT - 10; mtrr_seq_show()
424 size >>= 20 - PAGE_SHIFT; mtrr_seq_show()
427 seq_printf(seq, "reg%02i: base=0x%06lx000 (%5luMB), size=%5lu%cB, count=%d: %s\n", mtrr_seq_show()
429 size, factor, mtrr_seq_show()
H A Dcentaur.c21 * @size: The size (in bytes) of the region.
26 centaur_get_free_region(unsigned long base, unsigned long size, int replace_reg) centaur_get_free_region() argument
58 unsigned long *size, mtrr_type * type) centaur_get_mcr()
61 *size = -(centaur_mcr[reg].low & 0xfffff000) >> PAGE_SHIFT; centaur_get_mcr()
74 unsigned long size, mtrr_type type) centaur_set_mcr()
78 if (size == 0) { centaur_set_mcr()
85 low = -size << PAGE_SHIFT | 0x1f; centaur_set_mcr()
88 low = -size << PAGE_SHIFT | 0x02; /* NC */ centaur_set_mcr()
90 low = -size << PAGE_SHIFT | 0x09; /* WWO, WC */ centaur_set_mcr()
99 centaur_validate_add_page(unsigned long base, unsigned long size, unsigned int type) centaur_validate_add_page() argument
57 centaur_get_mcr(unsigned int reg, unsigned long *base, unsigned long *size, mtrr_type * type) centaur_get_mcr() argument
73 centaur_set_mcr(unsigned int reg, unsigned long base, unsigned long size, mtrr_type type) centaur_set_mcr() argument
/linux-4.1.27/arch/arm/include/asm/xen/
H A Dpage-coherent.h9 dma_addr_t dev_addr, unsigned long offset, size_t size,
12 size_t size, enum dma_data_direction dir,
15 dma_addr_t handle, size_t size, enum dma_data_direction dir);
18 dma_addr_t handle, size_t size, enum dma_data_direction dir);
20 static inline void *xen_alloc_coherent_pages(struct device *hwdev, size_t size, xen_alloc_coherent_pages() argument
24 return __generic_dma_ops(hwdev)->alloc(hwdev, size, dma_handle, flags, attrs); xen_alloc_coherent_pages()
27 static inline void xen_free_coherent_pages(struct device *hwdev, size_t size, xen_free_coherent_pages() argument
31 __generic_dma_ops(hwdev)->free(hwdev, size, cpu_addr, dma_handle, attrs); xen_free_coherent_pages()
35 dma_addr_t dev_addr, unsigned long offset, size_t size, xen_dma_map_page()
44 __generic_dma_ops(hwdev)->map_page(hwdev, page, offset, size, dir, attrs); xen_dma_map_page()
46 __xen_dma_map_page(hwdev, page, dev_addr, offset, size, dir, attrs); xen_dma_map_page()
50 size_t size, enum dma_data_direction dir, xen_dma_unmap_page()
60 __generic_dma_ops(hwdev)->unmap_page(hwdev, handle, size, dir, attrs); xen_dma_unmap_page()
62 __xen_dma_unmap_page(hwdev, handle, size, dir, attrs); xen_dma_unmap_page()
66 dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_cpu()
71 __generic_dma_ops(hwdev)->sync_single_for_cpu(hwdev, handle, size, dir); xen_dma_sync_single_for_cpu()
73 __xen_dma_sync_single_for_cpu(hwdev, handle, size, dir); xen_dma_sync_single_for_cpu()
77 dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_device()
82 __generic_dma_ops(hwdev)->sync_single_for_device(hwdev, handle, size, dir); xen_dma_sync_single_for_device()
84 __xen_dma_sync_single_for_device(hwdev, handle, size, dir); xen_dma_sync_single_for_device()
34 xen_dma_map_page(struct device *hwdev, struct page *page, dma_addr_t dev_addr, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_dma_map_page() argument
49 xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_dma_unmap_page() argument
65 xen_dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_cpu() argument
76 xen_dma_sync_single_for_device(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_device() argument
/linux-4.1.27/drivers/acpi/
H A Dnvs.c22 __u64 size; member in struct:nvs_region
29 static int suspend_nvs_register(unsigned long start, unsigned long size);
37 int acpi_nvs_register(__u64 start, __u64 size) acpi_nvs_register() argument
45 region->size = size; acpi_nvs_register()
48 return suspend_nvs_register(start, size); acpi_nvs_register()
51 int acpi_nvs_for_each_region(int (*func)(__u64 start, __u64 size, void *data), acpi_nvs_for_each_region() argument
58 rc = func(region->phys_start, region->size, data); acpi_nvs_for_each_region()
76 unsigned int size; member in struct:nvs_page
88 * @size - size of the region
94 static int suspend_nvs_register(unsigned long start, unsigned long size) suspend_nvs_register() argument
99 start, start + size - 1, size); suspend_nvs_register()
101 while (size > 0) { suspend_nvs_register()
111 entry->size = (size < nr_bytes) ? size : nr_bytes; suspend_nvs_register()
113 start += entry->size; suspend_nvs_register()
114 size -= entry->size; suspend_nvs_register()
143 entry->size); suspend_nvs_free()
179 unsigned int size = entry->size; suspend_nvs_save() local
181 entry->kaddr = acpi_os_get_iomem(phys, size); suspend_nvs_save()
183 entry->kaddr = acpi_os_ioremap(phys, size); suspend_nvs_save()
190 memcpy(entry->data, entry->kaddr, entry->size); suspend_nvs_save()
210 memcpy(entry->kaddr, entry->data, entry->size); suspend_nvs_restore()
/linux-4.1.27/arch/mips/sgi-ip32/
H A Dip32-memory.c24 u64 base, size; prom_meminit() local
34 size = (bankctl & CRIME_MEM_BANK_CONTROL_SDRAM_SIZE) ? 128 : 32; prom_meminit()
35 size <<= 20; prom_meminit()
36 if (base + size > (256 << 20)) prom_meminit()
39 printk("CRIME MC: bank %u base 0x%016Lx size %LuMiB\n", prom_meminit()
40 bank, base, size >> 20); prom_meminit()
41 add_memory_region(base, size, BOOT_MEM_RAM); prom_meminit()
/linux-4.1.27/fs/efs/
H A Dsymlink.c19 efs_block_t size = inode->i_size; efs_symlink_readpage() local
23 if (size > 2 * EFS_BLOCKSIZE) efs_symlink_readpage()
31 memcpy(link, bh->b_data, (size > EFS_BLOCKSIZE) ? EFS_BLOCKSIZE : size); efs_symlink_readpage()
33 if (size > EFS_BLOCKSIZE) { efs_symlink_readpage()
37 memcpy(link + EFS_BLOCKSIZE, bh->b_data, size - EFS_BLOCKSIZE); efs_symlink_readpage()
40 link[size] = '\0'; efs_symlink_readpage()
/linux-4.1.27/tools/include/asm-generic/bitops/
H A Dfind.h9 * @size: The bitmap size in bits
12 * If no bits are set, returns @size.
15 size, unsigned long offset);
23 * @size: The maximum number of bits to search
26 * If no bits are set, returns @size.
29 unsigned long size);
/linux-4.1.27/lib/mpi/
H A Dmpih-mul.c34 #define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \
36 if ((size) < KARATSUBA_THRESHOLD) \
37 mul_n_basecase(prodp, up, vp, size); \
39 mul_n(prodp, up, vp, size, tspace); \
42 #define MPN_SQR_N_RECURSE(prodp, up, size, tspace) \
44 if ((size) < KARATSUBA_THRESHOLD) \
45 mpih_sqr_n_basecase(prodp, up, size); \
47 mpih_sqr_n(prodp, up, size, tspace); \
68 mul_n_basecase(mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size) mul_n_basecase() argument
79 MPN_COPY(prodp, up, size); mul_n_basecase()
81 MPN_ZERO(prodp, size); mul_n_basecase()
84 cy = mpihelp_mul_1(prodp, up, size, v_limb); mul_n_basecase()
86 prodp[size] = cy; mul_n_basecase()
91 for (i = 1; i < size; i++) { mul_n_basecase()
96 cy = mpihelp_add_n(prodp, prodp, up, size); mul_n_basecase()
98 cy = mpihelp_addmul_1(prodp, up, size, v_limb); mul_n_basecase()
100 prodp[size] = cy; mul_n_basecase()
109 mpi_size_t size, mpi_ptr_t tspace) mul_n()
111 if (size & 1) { mul_n()
112 /* The size is odd, and the code below doesn't handle that. mul_n()
113 * Multiply the least significant (size - 1) limbs with a recursive mul_n()
117 * code below behave as if the size were even, and let it check for mul_n()
118 * odd size in the end. I.e., in essence move this code to the end. mul_n()
122 mpi_size_t esize = size - 1; /* even size */ mul_n()
128 cy_limb = mpihelp_addmul_1(prodp + esize, vp, size, up[esize]); mul_n()
129 prodp[esize + size] = cy_limb; mul_n()
146 mpi_size_t hsize = size >> 1; mul_n()
155 MPN_MUL_N_RECURSE(prodp + size, up + hsize, vp + hsize, hsize, mul_n()
180 tspace + size); mul_n()
183 MPN_COPY(prodp + hsize, prodp + size, hsize); mul_n()
184 cy = mpihelp_add_n(prodp + size, prodp + size, mul_n()
185 prodp + size + hsize, hsize); mul_n()
191 size); mul_n()
195 size); mul_n()
203 MPN_MUL_N_RECURSE(tspace, up, vp, hsize, tspace + size); mul_n()
207 cy += mpihelp_add_n(prodp + hsize, prodp + hsize, tspace, size); mul_n()
209 mpihelp_add_1(prodp + hsize + size, mul_n()
210 prodp + hsize + size, hsize, cy); mul_n()
216 mpihelp_add_1(prodp + size, prodp + size, size, 1); mul_n()
220 void mpih_sqr_n_basecase(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size) mpih_sqr_n_basecase() argument
231 MPN_COPY(prodp, up, size); mpih_sqr_n_basecase()
233 MPN_ZERO(prodp, size); mpih_sqr_n_basecase()
236 cy_limb = mpihelp_mul_1(prodp, up, size, v_limb); mpih_sqr_n_basecase()
238 prodp[size] = cy_limb; mpih_sqr_n_basecase()
243 for (i = 1; i < size; i++) { mpih_sqr_n_basecase()
248 cy_limb = mpihelp_add_n(prodp, prodp, up, size); mpih_sqr_n_basecase()
250 cy_limb = mpihelp_addmul_1(prodp, up, size, v_limb); mpih_sqr_n_basecase()
252 prodp[size] = cy_limb; mpih_sqr_n_basecase()
258 mpih_sqr_n(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size, mpi_ptr_t tspace) mpih_sqr_n() argument
260 if (size & 1) { mpih_sqr_n()
261 /* The size is odd, and the code below doesn't handle that. mpih_sqr_n()
262 * Multiply the least significant (size - 1) limbs with a recursive mpih_sqr_n()
266 * code below behave as if the size were even, and let it check for mpih_sqr_n()
267 * odd size in the end. I.e., in essence move this code to the end. mpih_sqr_n()
271 mpi_size_t esize = size - 1; /* even size */ mpih_sqr_n()
277 cy_limb = mpihelp_addmul_1(prodp + esize, up, size, up[esize]); mpih_sqr_n()
279 prodp[esize + size] = cy_limb; mpih_sqr_n()
281 mpi_size_t hsize = size >> 1; mpih_sqr_n()
289 MPN_SQR_N_RECURSE(prodp + size, up + hsize, hsize, tspace); mpih_sqr_n()
302 MPN_SQR_N_RECURSE(tspace, prodp, hsize, tspace + size); mpih_sqr_n()
305 MPN_COPY(prodp + hsize, prodp + size, hsize); mpih_sqr_n()
306 cy = mpihelp_add_n(prodp + size, prodp + size, mpih_sqr_n()
307 prodp + size + hsize, hsize); mpih_sqr_n()
310 cy -= mpihelp_sub_n(prodp + hsize, prodp + hsize, tspace, size); mpih_sqr_n()
317 MPN_SQR_N_RECURSE(tspace, up, hsize, tspace + size); mpih_sqr_n()
320 cy += mpihelp_add_n(prodp + hsize, prodp + hsize, tspace, size); mpih_sqr_n()
322 mpihelp_add_1(prodp + hsize + size, mpih_sqr_n()
323 prodp + hsize + size, hsize, cy); mpih_sqr_n()
329 mpihelp_add_1(prodp + size, prodp + size, size, 1); mpih_sqr_n()
108 mul_n(mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size, mpi_ptr_t tspace) mul_n() argument
/linux-4.1.27/drivers/oprofile/
H A Dcpu_buffer.h73 * entry->event != NULL, otherwise entry->size or entry->event will be
78 *op_cpu_buffer_write_reserve(struct op_entry *entry, unsigned long size);
83 /* returns the remaining free size of data in the entry */
87 if (!entry->size) op_cpu_buffer_add_data()
90 entry->size--; op_cpu_buffer_add_data()
92 return entry->size; op_cpu_buffer_add_data()
95 /* returns the size of data in the entry */
99 return entry->size; op_cpu_buffer_get_size()
102 /* returns 0 if empty or the size of data including the current value */
106 int size = entry->size; op_cpu_buffer_get_data() local
107 if (!size) op_cpu_buffer_get_data()
110 entry->size--; op_cpu_buffer_get_data()
112 return size; op_cpu_buffer_get_data()
/linux-4.1.27/fs/hfsplus/
H A Dposix_acl.c18 ssize_t size; hfsplus_get_posix_acl() local
33 size = __hfsplus_getxattr(inode, xattr_name, NULL, 0); hfsplus_get_posix_acl()
35 if (size > 0) { hfsplus_get_posix_acl()
39 size = __hfsplus_getxattr(inode, xattr_name, value, size); hfsplus_get_posix_acl()
42 if (size > 0) hfsplus_get_posix_acl()
43 acl = posix_acl_from_xattr(&init_user_ns, value, size); hfsplus_get_posix_acl()
44 else if (size == -ENODATA) hfsplus_get_posix_acl()
47 acl = ERR_PTR(size); hfsplus_get_posix_acl()
62 size_t size = 0; hfsplus_set_posix_acl() local
89 size = posix_acl_xattr_size(acl->a_count); hfsplus_set_posix_acl()
90 if (unlikely(size > HFSPLUS_MAX_INLINE_DATA_SIZE)) hfsplus_set_posix_acl()
95 err = posix_acl_to_xattr(&init_user_ns, acl, value, size); hfsplus_set_posix_acl()
100 err = __hfsplus_setxattr(inode, xattr_name, value, size, 0); hfsplus_set_posix_acl()
H A Dxattr.h22 const void *value, size_t size, int flags);
25 const void *value, size_t size, int flags,
29 void *value, size_t size);
32 void *value, size_t size,
35 ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size);
/linux-4.1.27/sound/core/
H A Dmemalloc.c37 * snd_malloc_pages - allocate pages with the given size
38 * @size: the size to allocate in bytes
41 * Allocates the physically contiguous pages with the given size.
45 void *snd_malloc_pages(size_t size, gfp_t gfp_flags) snd_malloc_pages() argument
49 if (WARN_ON(!size)) snd_malloc_pages()
54 pg = get_order(size); snd_malloc_pages()
61 * @size: the allocated buffer size
65 void snd_free_pages(void *ptr, size_t size) snd_free_pages() argument
71 pg = get_order(size); snd_free_pages()
83 static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma) snd_malloc_dev_pages() argument
90 pg = get_order(size); snd_malloc_dev_pages()
99 static void snd_free_dev_pages(struct device *dev, size_t size, void *ptr, snd_free_dev_pages() argument
106 pg = get_order(size); snd_free_dev_pages()
114 * @size: number of bytes to allocate from the iram
118 static void snd_malloc_dev_iram(struct snd_dma_buffer *dmab, size_t size) snd_malloc_dev_iram() argument
135 dmab->area = gen_pool_dma_alloc(pool, size, &dmab->addr); snd_malloc_dev_iram()
163 * @size: the buffer size to allocate
169 * Return: Zero if the buffer with the given size is allocated successfully,
172 int snd_dma_alloc_pages(int type, struct device *device, size_t size, snd_dma_alloc_pages() argument
175 if (WARN_ON(!size)) snd_dma_alloc_pages()
185 dmab->area = snd_malloc_pages(size, snd_dma_alloc_pages()
192 snd_malloc_dev_iram(dmab, size); snd_dma_alloc_pages()
195 /* Internal memory might have limited size and no enough space, snd_dma_alloc_pages()
201 dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr); snd_dma_alloc_pages()
206 snd_malloc_sgbuf_pages(device, size, dmab, NULL); snd_dma_alloc_pages()
217 dmab->bytes = size; snd_dma_alloc_pages()
225 * @size: the buffer size to allocate
229 * buffer type. When no space is left, this function reduces the size and
230 * tries to allocate again. The size actually allocated is stored in
233 * Return: Zero if the buffer with the given size is allocated successfully,
236 int snd_dma_alloc_pages_fallback(int type, struct device *device, size_t size, snd_dma_alloc_pages_fallback() argument
241 while ((err = snd_dma_alloc_pages(type, device, size, dmab)) < 0) { snd_dma_alloc_pages_fallback()
245 if (size <= PAGE_SIZE) snd_dma_alloc_pages_fallback()
247 aligned_size = PAGE_SIZE << get_order(size); snd_dma_alloc_pages_fallback()
248 if (size != aligned_size) snd_dma_alloc_pages_fallback()
249 size = aligned_size; snd_dma_alloc_pages_fallback()
251 size >>= 1; snd_dma_alloc_pages_fallback()
/linux-4.1.27/drivers/mtd/maps/
H A Dscx200_docflash.c27 static unsigned size = 0x1000000; /* 16 MiB the whole ISA address space */ variable
33 module_param(size, int, 0);
34 MODULE_PARM_DESC(size, "Size of the flash mapping");
51 .size = 0xc0000
56 .size = 0x40000
61 .size = ~0 /* calculate from flash size */
65 .offset = ~0, /* calculate from flash size */
66 .size = 0x80000
109 size = ((ctrl&0x1fff)<<13) + (1<<13); init_scx200_docflash()
111 for (u = size; u > 1; u >>= 1) init_scx200_docflash()
122 docmem.end = base + size; init_scx200_docflash()
130 for (u = size; u > 1; u >>= 1) init_scx200_docflash()
133 printk(KERN_ERR NAME ": invalid size for flash mapping\n"); init_scx200_docflash()
143 size, init_scx200_docflash()
145 size, NULL, NULL)) { init_scx200_docflash()
150 ctrl = 0x07000000 | ((size-1) >> 13); init_scx200_docflash()
169 scx200_docflash_map.size = size; init_scx200_docflash()
178 scx200_docflash_map.virt = ioremap(docmem.start, scx200_docflash_map.size); init_scx200_docflash()
193 if (size < mymtd->size) init_scx200_docflash()
194 printk(KERN_WARNING NAME ": warning, flash mapping is smaller than flash size\n"); init_scx200_docflash()
198 partition_info[3].offset = mymtd->size-partition_info[3].size; init_scx200_docflash()
199 partition_info[2].size = partition_info[3].offset-partition_info[2].offset; init_scx200_docflash()
/linux-4.1.27/arch/mn10300/mm/
H A Ddma-alloc.c23 void *dma_alloc_coherent(struct device *dev, size_t size, dma_alloc_coherent() argument
30 dev ? dev_name(dev) : "?", size, gfp); dma_alloc_coherent()
32 if (0xbe000000 - pci_sram_allocated >= size) { dma_alloc_coherent()
33 size = (size + 255) & ~255; dma_alloc_coherent()
35 pci_sram_allocated += size; dma_alloc_coherent()
46 addr = __get_free_pages(gfp, get_order(size)); dma_alloc_coherent()
54 memset((void *) addr, 0xfb, size); dma_alloc_coherent()
66 void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_free_coherent() argument
74 free_pages(addr, get_order(size)); dma_free_coherent()
/linux-4.1.27/sound/pci/ctxfi/
H A Dctvmem.c29 * Find or create vm block based on requested @size.
30 * @size must be page aligned.
33 get_vm_block(struct ct_vm *vm, unsigned int size, struct ct_atc *atc) get_vm_block() argument
38 size = CT_PAGE_ALIGN(size); get_vm_block()
39 if (size > vm->size) { get_vm_block()
48 if (entry->size >= size) get_vm_block()
54 if (entry->size == size) { get_vm_block()
57 vm->size -= size; get_vm_block()
67 block->size = size; get_vm_block()
69 entry->addr += size; get_vm_block()
70 entry->size -= size; get_vm_block()
71 vm->size -= size; get_vm_block()
83 block->size = CT_PAGE_ALIGN(block->size); put_vm_block()
87 vm->size += block->size; put_vm_block()
91 if (entry->addr >= (block->addr + block->size)) put_vm_block()
98 if ((block->addr + block->size) == entry->addr) { put_vm_block()
100 entry->size += block->size; put_vm_block()
113 if ((pre_ent->addr + pre_ent->size) > entry->addr) put_vm_block()
116 pre_ent->size += entry->size; put_vm_block()
127 ct_vm_map(struct ct_vm *vm, struct snd_pcm_substream *substream, int size) ct_vm_map() argument
135 block = get_vm_block(vm, size, atc); ct_vm_map()
144 pages = block->size >> CT_PAGE_SHIFT; ct_vm_map()
151 block->size = size; ct_vm_map()
203 vm->size = CT_ADDRS_PER_PAGE * i; ct_vm_create()
212 block->size = vm->size; ct_vm_create()
246 vm->size = 0; ct_vm_destroy()
/linux-4.1.27/tools/testing/selftests/powerpc/stringloops/
H A Dmemcmp.c14 unsigned long offset, size; test_one() local
17 for (size = 0; size < (SIZE-offset); size++) { test_one()
21 y = memcmp(s1+offset, s2+offset, size); test_one()
22 x = test_memcmp(s1+offset, s2+offset, size); test_one()
26 printf("memcmp returned %d, should have returned %d (offset %ld size %ld)\n", x, y, offset, size); test_one()
28 for (i = offset; i < offset+size; i++) test_one()
32 for (i = offset; i < offset+size; i++) test_one()
/linux-4.1.27/drivers/uwb/
H A Dest.c25 * Infrastructure, code and data tables for guessing the size of
29 * You define a table of events and for each, its size and how to get
30 * the extra size.
36 * uwb_est_[u]register(): To un/register event size tables
39 * uwb_est_find_size(): Get the size of an event
68 .size = sizeof(struct uwb_rc_evt_ie_rcv),
72 .size = sizeof(struct uwb_rc_evt_beacon),
76 .size = sizeof(struct uwb_rc_evt_beacon_size),
79 .size = sizeof(struct uwb_rc_evt_bpoie_change),
84 .size = sizeof(struct uwb_rc_evt_bp_slot_change),
87 .size = sizeof(struct uwb_rc_evt_bp_switch_ie_rcv),
91 .size = sizeof(struct uwb_rc_evt_dev_addr_conflict),
94 .size = sizeof(struct uwb_rc_evt_drp_avail)
97 .size = sizeof(struct uwb_rc_evt_drp),
101 .size = sizeof(struct uwb_rc_evt_bp_switch_status),
104 .size = sizeof(struct uwb_rc_evt_cmd_frame_rcv),
108 .size = sizeof(struct uwb_rc_evt_channel_change_ie_rcv),
112 .size = sizeof(struct uwb_rc_evt_confirm),
115 .size = sizeof(struct uwb_rc_evt_dev_addr_mgmt) },
117 .size = sizeof(struct uwb_rc_evt_get_ie),
121 .size = sizeof(struct uwb_rc_evt_confirm),
124 .size = sizeof(struct uwb_rc_evt_confirm),
127 .size = sizeof(struct uwb_rc_evt_confirm),
130 .size = sizeof(struct uwb_rc_evt_set_drp_ie),
133 .size = sizeof(struct uwb_rc_evt_set_ie),
136 .size = sizeof(struct uwb_rc_evt_confirm),
139 .size = sizeof(struct uwb_rc_evt_confirm),
142 .size = sizeof(struct uwb_rc_evt_confirm),
145 .size = sizeof(struct uwb_rc_evt_confirm),
148 .size = sizeof(struct uwb_rc_evt_confirm),
151 .size = sizeof(struct uwb_rc_evt_confirm),
154 .size = sizeof(struct uwb_rc_evt_confirm),
157 .size = sizeof(struct uwb_rc_evt_confirm),
164 .size = sizeof(struct uwb_rc_evt_daa_energy_detected),
167 .size = sizeof(struct uwb_rc_evt_set_daa_energy_mask),
170 .size = sizeof(struct uwb_rc_evt_set_notification_filter_ex),
233 * Register an event size table
293 * Unregister an event size table
297 * reallocation is done to reduce the size of the table.
335 * Get the size of an event from a table
338 * @rceb_size: size of the area pointed to by @rceb in bytes.
341 * ahead into the event's guts and guess the size.
345 * size. For variable sized events, it will look further ahead into
348 * Note this size is *not* final--the neh (Notification/Event Handle)
349 * might specificy an extra size to add.
357 ssize_t size; uwb_est_get_size() local
361 size = -ENOENT; uwb_est_get_size()
368 size = -ENOENT; uwb_est_get_size()
370 if (entry->size == 0 && entry->offset == 0) { /* unknown? */ uwb_est_get_size()
378 size = entry->size; uwb_est_get_size()
380 /* Ops, got an extra size field at 'offset'--read it */ uwb_est_get_size()
384 size = -ENOSPC; /* enough data for more? */ uwb_est_get_size()
392 "not enough data to read extra size\n", uwb_est_get_size()
397 size = entry->size; uwb_est_get_size()
400 case UWB_EST_16: size += le16_to_cpu(*(__le16 *)ptr); break; uwb_est_get_size()
401 case UWB_EST_8: size += *(u8 *)ptr; break; uwb_est_get_size()
406 return size; uwb_est_get_size()
411 * Guesses the size of a WA event
414 * @rceb_size: size of the area pointed to by @rceb in bytes.
417 * ahead into the event's guts and guess the size.
421 * size by checking all the tables registered with
425 * Note this size is *not* final--the neh (Notification/Event Handle)
426 * might specificy an extra size to add or replace.
432 ssize_t size; uwb_est_find_size() local
439 size = -ENOSPC; uwb_est_find_size()
447 size = uwb_est_get_size(rc, &uwb_est[itr], uwb_est_find_size()
450 if (size != -ENOENT) uwb_est_find_size()
459 size = -ENOENT; uwb_est_find_size()
462 return size; uwb_est_find_size()
/linux-4.1.27/arch/cris/mm/
H A Dioremap.c30 void __iomem * __ioremap_prot(unsigned long phys_addr, unsigned long size, pgprot_t prot) __ioremap_prot() argument
36 /* Don't allow wraparound or zero size */ __ioremap_prot()
37 last_addr = phys_addr + size - 1; __ioremap_prot()
38 if (!size || last_addr < phys_addr) __ioremap_prot()
46 size = PAGE_ALIGN(last_addr+1) - phys_addr; __ioremap_prot()
51 area = get_vm_area(size, VM_IOREMAP); __ioremap_prot()
55 if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, __ioremap_prot()
63 void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) __ioremap() argument
65 return __ioremap_prot(phys_addr, size, __ioremap()
74 * @size: size of the resource to map
79 void __iomem *ioremap_nocache(unsigned long phys_addr, unsigned long size) ioremap_nocache() argument
81 return __ioremap(phys_addr | MEM_NON_CACHEABLE, size, 0); ioremap_nocache()
/linux-4.1.27/arch/metag/include/asm/
H A Ddma-mapping.h14 void *dma_alloc_coherent(struct device *dev, size_t size,
17 void dma_free_coherent(struct device *dev, size_t size,
20 void dma_sync_for_device(void *vaddr, size_t size, int dma_direction);
21 void dma_sync_for_cpu(void *vaddr, size_t size, int dma_direction);
24 void *cpu_addr, dma_addr_t dma_addr, size_t size);
27 void *cpu_addr, dma_addr_t dma_addr, size_t size);
30 dma_map_single(struct device *dev, void *ptr, size_t size, dma_map_single() argument
34 WARN_ON(size == 0); dma_map_single()
35 dma_sync_for_device(ptr, size, direction); dma_map_single()
40 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, dma_unmap_single() argument
44 dma_sync_for_cpu(phys_to_virt(dma_addr), size, direction); dma_unmap_single() local
69 size_t size, enum dma_data_direction direction) dma_map_page()
72 dma_sync_for_device((void *)(page_to_phys(page) + offset), size, dma_map_page()
78 dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, dma_unmap_page() argument
82 dma_sync_for_cpu(phys_to_virt(dma_address), size, direction); dma_unmap_page() local
105 dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, dma_sync_single_for_cpu() argument
108 dma_sync_for_cpu(phys_to_virt(dma_handle), size, direction); dma_sync_single_for_cpu() local
113 size_t size, enum dma_data_direction direction) dma_sync_single_for_device()
115 dma_sync_for_device(phys_to_virt(dma_handle), size, direction); dma_sync_single_for_device() local
120 unsigned long offset, size_t size, dma_sync_single_range_for_cpu()
123 dma_sync_for_cpu(phys_to_virt(dma_handle)+offset, size, dma_sync_single_range_for_cpu()
129 unsigned long offset, size_t size, dma_sync_single_range_for_device()
132 dma_sync_for_device(phys_to_virt(dma_handle)+offset, size, dma_sync_single_range_for_device()
178 dma_cache_sync(struct device *dev, void *vaddr, size_t size, dma_cache_sync() argument
186 size_t size);
68 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) dma_map_page() argument
112 dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) dma_sync_single_for_device() argument
119 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_cpu() argument
128 dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_device() argument
H A Dcachepart.h11 * get_dcache_size() - Get size of data cache.
16 * get_icache_size() - Get size of code cache.
23 * Returns the size of the current thread's global dcache partition.
30 * Returns the size of the current thread's global icache partition.
/linux-4.1.27/arch/arc/include/asm/
H A Ddma-mapping.h34 void *dma_alloc_noncoherent(struct device *dev, size_t size,
37 void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr,
40 void *dma_alloc_coherent(struct device *dev, size_t size,
43 void dma_free_coherent(struct device *dev, size_t size, void *kvaddr,
48 void *cpu_addr, dma_addr_t dma_addr, size_t size);
51 size_t size);
62 static inline void __inline_dma_cache_sync(unsigned long paddr, size_t size, __inline_dma_cache_sync() argument
67 dma_cache_inv(paddr, size); __inline_dma_cache_sync()
70 dma_cache_wback(paddr, size); __inline_dma_cache_sync()
73 dma_cache_wback_inv(paddr, size); __inline_dma_cache_sync()
80 void __arc_dma_cache_sync(unsigned long paddr, size_t size,
93 dma_map_single(struct device *dev, void *cpu_addr, size_t size, dma_map_single() argument
96 _dma_cache_sync((unsigned long)cpu_addr, size, dir); dma_map_single()
102 size_t size, enum dma_data_direction dir) dma_unmap_single()
108 unsigned long offset, size_t size, dma_map_page()
112 return dma_map_single(dev, (void *)paddr, size, dir); dma_map_page()
117 size_t size, enum dma_data_direction dir) dma_unmap_page()
148 size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu()
150 _dma_cache_sync(plat_dma_addr_to_kernel(dev, dma_handle), size, dma_sync_single_for_cpu() local
156 size_t size, enum dma_data_direction dir) dma_sync_single_for_device()
158 _dma_cache_sync(plat_dma_addr_to_kernel(dev, dma_handle), size, dma_sync_single_for_device() local
164 unsigned long offset, size_t size, dma_sync_single_range_for_cpu()
168 size, DMA_FROM_DEVICE); dma_sync_single_range_for_cpu()
173 unsigned long offset, size_t size, dma_sync_single_range_for_device()
177 size, DMA_TO_DEVICE); dma_sync_single_range_for_device()
101 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir) dma_unmap_single() argument
107 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
116 dma_unmap_page(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
147 dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu() argument
155 dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_device() argument
163 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_cpu() argument
172 dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_device() argument
/linux-4.1.27/drivers/base/
H A Ddma-mapping.c21 size_t size; member in struct:dma_devres
30 dma_free_coherent(dev, this->size, this->vaddr, this->dma_handle); dmam_coherent_release()
37 dma_free_noncoherent(dev, this->size, this->vaddr, this->dma_handle); dmam_noncoherent_release()
45 WARN_ON(this->size != match->size || dmam_match()
55 * @size: Size of allocation
65 void *dmam_alloc_coherent(struct device *dev, size_t size, dmam_alloc_coherent() argument
75 vaddr = dma_alloc_coherent(dev, size, dma_handle, gfp); dmam_alloc_coherent()
83 dr->size = size; dmam_alloc_coherent()
94 * @size: Size of allocation
100 void dmam_free_coherent(struct device *dev, size_t size, void *vaddr, dmam_free_coherent() argument
103 struct dma_devres match_data = { size, vaddr, dma_handle }; dmam_free_coherent()
105 dma_free_coherent(dev, size, vaddr, dma_handle); dmam_free_coherent()
114 * @size: Size of allocation
124 void *dmam_alloc_noncoherent(struct device *dev, size_t size, dmam_alloc_noncoherent() argument
134 vaddr = dma_alloc_noncoherent(dev, size, dma_handle, gfp); dmam_alloc_noncoherent()
142 dr->size = size; dmam_alloc_noncoherent()
153 * @size: Size of allocation
159 void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr, dmam_free_noncoherent() argument
162 struct dma_devres match_data = { size, vaddr, dma_handle }; dmam_free_noncoherent()
164 dma_free_noncoherent(dev, size, vaddr, dma_handle); dmam_free_noncoherent()
182 * @size: Size of coherent memory to be declared
191 dma_addr_t device_addr, size_t size, int flags) dmam_declare_coherent_memory()
200 rc = dma_declare_coherent_memory(dev, phys_addr, device_addr, size, dmam_declare_coherent_memory()
229 void *cpu_addr, dma_addr_t handle, size_t size) dma_common_get_sgtable()
238 sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0); dma_common_get_sgtable()
247 void *cpu_addr, dma_addr_t dma_addr, size_t size) dma_common_mmap()
252 unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT; dma_common_mmap()
258 if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret)) dma_common_mmap()
278 void *dma_common_pages_remap(struct page **pages, size_t size, dma_common_pages_remap() argument
284 area = get_vm_area_caller(size, vm_flags, caller); dma_common_pages_remap()
303 void *dma_common_contiguous_remap(struct page *page, size_t size, dma_common_contiguous_remap() argument
312 pages = kmalloc(sizeof(struct page *) << get_order(size), GFP_KERNEL); dma_common_contiguous_remap()
316 for (i = 0, pfn = page_to_pfn(page); i < (size >> PAGE_SHIFT); i++) dma_common_contiguous_remap()
319 ptr = dma_common_pages_remap(pages, size, vm_flags, prot, caller); dma_common_contiguous_remap()
329 void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags) dma_common_free_remap() argument
338 unmap_kernel_range((unsigned long)cpu_addr, size); dma_common_free_remap()
190 dmam_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, dma_addr_t device_addr, size_t size, int flags) dmam_declare_coherent_memory() argument
228 dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr, dma_addr_t handle, size_t size) dma_common_get_sgtable() argument
246 dma_common_mmap(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size) dma_common_mmap() argument
H A Ddma-coherent.c14 int size; member in struct:dma_coherent_mem
21 size_t size, int flags, dma_init_coherent_memory()
26 int pages = size >> PAGE_SHIFT; dma_init_coherent_memory()
31 if (!size) dma_init_coherent_memory()
34 mem_base = ioremap(phys_addr, size); dma_init_coherent_memory()
48 dma_mem->size = pages; dma_init_coherent_memory()
88 dma_addr_t device_addr, size_t size, int flags) dma_declare_coherent_memory()
93 ret = dma_init_coherent_memory(phys_addr, device_addr, size, flags, dma_declare_coherent_memory()
118 dma_addr_t device_addr, size_t size) dma_mark_declared_memory_occupied()
124 size += device_addr & ~PAGE_MASK; dma_mark_declared_memory_occupied()
131 err = bitmap_allocate_region(mem->bitmap, pos, get_order(size)); dma_mark_declared_memory_occupied()
144 * @size: size of requested memory area
155 int dma_alloc_from_coherent(struct device *dev, ssize_t size, dma_alloc_from_coherent() argument
159 int order = get_order(size); dma_alloc_from_coherent()
172 if (unlikely(size > (mem->size << PAGE_SHIFT))) dma_alloc_from_coherent()
175 pageno = bitmap_find_free_region(mem->bitmap, mem->size, order); dma_alloc_from_coherent()
184 memset(*ret, 0, size); dma_alloc_from_coherent()
218 (mem->virt_base + (mem->size << PAGE_SHIFT))) { dma_release_from_coherent()
237 * @size: size of the memory buffer allocated by dma_alloc_from_coherent
247 void *vaddr, size_t size, int *ret) dma_mmap_from_coherent()
251 if (mem && vaddr >= mem->virt_base && vaddr + size <= dma_mmap_from_coherent()
252 (mem->virt_base + (mem->size << PAGE_SHIFT))) { dma_mmap_from_coherent()
256 int count = size >> PAGE_SHIFT; dma_mmap_from_coherent()
284 dma_init_coherent_memory(rmem->base, rmem->base, rmem->size, rmem_dma_device_init()
287 pr_err("Reserved memory: failed to init DMA memory pool at %pa, size %ld MiB\n", rmem_dma_device_init()
288 &rmem->base, (unsigned long)rmem->size / SZ_1M); rmem_dma_device_init()
322 pr_info("Reserved memory: created DMA memory pool at %pa, size %ld MiB\n", rmem_dma_setup()
323 &rmem->base, (unsigned long)rmem->size / SZ_1M); rmem_dma_setup()
20 dma_init_coherent_memory(phys_addr_t phys_addr, dma_addr_t device_addr, size_t size, int flags, struct dma_coherent_mem **mem) dma_init_coherent_memory() argument
87 dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, dma_addr_t device_addr, size_t size, int flags) dma_declare_coherent_memory() argument
117 dma_mark_declared_memory_occupied(struct device *dev, dma_addr_t device_addr, size_t size) dma_mark_declared_memory_occupied() argument
246 dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma, void *vaddr, size_t size, int *ret) dma_mmap_from_coherent() argument
/linux-4.1.27/arch/blackfin/kernel/
H A Dprocess.c231 int in_mem(unsigned long addr, unsigned long size, in_mem() argument
234 return addr >= start && addr + size <= end; in_mem()
237 int in_mem_const_off(unsigned long addr, unsigned long size, unsigned long off, in_mem_const_off() argument
241 in_mem(addr, size, const_addr + off, const_addr + const_size); in_mem_const_off()
244 int in_mem_const(unsigned long addr, unsigned long size, in_mem_const() argument
247 return in_mem_const_off(addr, size, 0, const_addr, const_size); in_mem_const()
268 int in_async(unsigned long addr, unsigned long size) in_async() argument
273 if (addr + size <= ASYNC_BANK0_BASE + ASYNC_BANK0_SIZE) in_async()
275 size -= ASYNC_BANK0_BASE + ASYNC_BANK0_SIZE - addr; in_async()
281 if (addr + size <= ASYNC_BANK1_BASE + ASYNC_BANK1_SIZE) in_async()
283 size -= ASYNC_BANK1_BASE + ASYNC_BANK1_SIZE - addr; in_async()
289 if (addr + size <= ASYNC_BANK2_BASE + ASYNC_BANK2_SIZE) in_async()
291 size -= ASYNC_BANK2_BASE + ASYNC_BANK2_SIZE - addr; in_async()
297 if (addr + size <= ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE) in_async()
306 int bfin_mem_access_type(unsigned long addr, unsigned long size) bfin_mem_access_type() argument
311 if (addr > ULONG_MAX - size) bfin_mem_access_type()
314 if (in_mem(addr, size, FIXED_CODE_START, physical_mem_end)) bfin_mem_access_type()
317 if (in_mem_const(addr, size, L1_CODE_START, L1_CODE_LENGTH)) bfin_mem_access_type()
319 if (in_mem_const(addr, size, L1_SCRATCH_START, L1_SCRATCH_LENGTH)) bfin_mem_access_type()
321 if (in_mem_const(addr, size, L1_DATA_A_START, L1_DATA_A_LENGTH)) bfin_mem_access_type()
323 if (in_mem_const(addr, size, L1_DATA_B_START, L1_DATA_B_LENGTH)) bfin_mem_access_type()
326 if (in_mem_const(addr, size, COREB_L1_CODE_START, COREB_L1_CODE_LENGTH)) bfin_mem_access_type()
328 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH)) bfin_mem_access_type()
330 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, COREB_L1_DATA_A_LENGTH)) bfin_mem_access_type()
332 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, COREB_L1_DATA_B_LENGTH)) bfin_mem_access_type()
335 if (in_mem_const(addr, size, L2_START, L2_LENGTH)) bfin_mem_access_type()
341 switch (in_async(addr, size)) { bfin_mem_access_type()
347 if (in_mem_const(addr, size, BOOT_ROM_START, BOOT_ROM_LENGTH)) bfin_mem_access_type()
349 if (in_mem_const(addr, size, L1_ROM_START, L1_ROM_LENGTH)) bfin_mem_access_type()
360 int _access_ok(unsigned long addr, unsigned long size) _access_ok() argument
364 if (size == 0) _access_ok()
367 if (addr > ULONG_MAX - size) _access_ok()
377 if (in_mem(addr, size, memory_start, memory_end)) _access_ok()
379 if (in_mem(addr, size, memory_mtd_end, physical_mem_end)) _access_ok()
385 if (in_mem(addr, size, memory_mtd_start, memory_mtd_end)) _access_ok()
388 if (in_mem(addr, size, memory_start, physical_mem_end)) _access_ok()
392 if (in_mem(addr, size, (unsigned long)__init_begin, (unsigned long)__init_end)) _access_ok()
395 if (in_mem_const(addr, size, L1_CODE_START, L1_CODE_LENGTH)) _access_ok()
397 if (in_mem_const_off(addr, size, _etext_l1 - _stext_l1, L1_CODE_START, L1_CODE_LENGTH)) _access_ok()
399 if (in_mem_const_off(addr, size, _ebss_l1 - _sdata_l1, L1_DATA_A_START, L1_DATA_A_LENGTH)) _access_ok()
401 if (in_mem_const_off(addr, size, _ebss_b_l1 - _sdata_b_l1, L1_DATA_B_START, L1_DATA_B_LENGTH)) _access_ok()
404 if (in_mem_const(addr, size, COREB_L1_CODE_START, COREB_L1_CODE_LENGTH)) _access_ok()
406 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH)) _access_ok()
408 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, COREB_L1_DATA_A_LENGTH)) _access_ok()
410 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, COREB_L1_DATA_B_LENGTH)) _access_ok()
415 if (in_mem_const(addr, size, (unsigned long)l1_stack_base, l1_stack_len)) _access_ok()
419 aret = in_async(addr, size); _access_ok()
423 if (in_mem_const_off(addr, size, _ebss_l2 - _stext_l2, L2_START, L2_LENGTH)) _access_ok()
426 if (in_mem_const(addr, size, BOOT_ROM_START, BOOT_ROM_LENGTH)) _access_ok()
428 if (in_mem_const(addr, size, L1_ROM_START, L1_ROM_LENGTH)) _access_ok()
/linux-4.1.27/fs/xfs/
H A Dxfs_bit.c32 xfs_bitmap_empty(uint *map, uint size) xfs_bitmap_empty() argument
37 for (i = 0; i < size; i++) { xfs_bitmap_empty()
46 * start_bit. Size is the size of the bitmap in words.
49 xfs_contig_bits(uint *map, uint size, uint start_bit) xfs_contig_bits() argument
55 size <<= BIT_TO_WORD_SHIFT; xfs_contig_bits()
57 ASSERT(start_bit < size); xfs_contig_bits()
58 size -= start_bit & ~(NBWORD - 1); xfs_contig_bits()
67 size -= NBWORD; xfs_contig_bits()
69 while (size) { xfs_contig_bits()
73 size -= NBWORD; xfs_contig_bits()
88 int xfs_next_bit(uint *map, uint size, uint start_bit) xfs_next_bit() argument
94 size <<= BIT_TO_WORD_SHIFT; xfs_next_bit()
96 if (start_bit >= size) xfs_next_bit()
98 size -= result; xfs_next_bit()
107 size -= NBWORD; xfs_next_bit()
109 while (size) { xfs_next_bit()
113 size -= NBWORD; xfs_next_bit()
/linux-4.1.27/include/uapi/asm-generic/
H A Dioctl.h5 * size of the parameter structure in the lower 14 bits of the
7 * Encoding the size of the parameter structure in the ioctl request
11 * NOTE: This limits the max parameter size to 16kB -1 !
65 #define _IOC(dir,type,nr,size) \
69 ((size) << _IOC_SIZESHIFT))
77 #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
78 #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
79 #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
80 #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
81 #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
82 #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
/linux-4.1.27/arch/parisc/include/asm/
H A Ddma-mapping.h11 void *(*alloc_consistent)(struct device *dev, size_t size, dma_addr_t *iova, gfp_t flag);
12 void *(*alloc_noncoherent)(struct device *dev, size_t size, dma_addr_t *iova, gfp_t flag);
13 void (*free_consistent)(struct device *dev, size_t size, void *vaddr, dma_addr_t iova);
14 dma_addr_t (*map_single)(struct device *dev, void *addr, size_t size, enum dma_data_direction direction);
15 void (*unmap_single)(struct device *dev, dma_addr_t iova, size_t size, enum dma_data_direction direction);
18 void (*dma_sync_single_for_cpu)(struct device *dev, dma_addr_t iova, unsigned long offset, size_t size, enum dma_data_direction direction);
19 void (*dma_sync_single_for_device)(struct device *dev, dma_addr_t iova, unsigned long offset, size_t size, enum dma_data_direction direction);
53 dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, dma_alloc_coherent() argument
56 return hppa_dma_ops->alloc_consistent(dev, size, dma_handle, flag); dma_alloc_coherent()
60 dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle, dma_alloc_noncoherent() argument
63 return hppa_dma_ops->alloc_noncoherent(dev, size, dma_handle, flag); dma_alloc_noncoherent()
67 dma_free_coherent(struct device *dev, size_t size, dma_free_coherent() argument
70 hppa_dma_ops->free_consistent(dev, size, vaddr, dma_handle); dma_free_coherent()
74 dma_free_noncoherent(struct device *dev, size_t size, dma_free_noncoherent() argument
77 hppa_dma_ops->free_consistent(dev, size, vaddr, dma_handle); dma_free_noncoherent()
81 dma_map_single(struct device *dev, void *ptr, size_t size, dma_map_single() argument
84 return hppa_dma_ops->map_single(dev, ptr, size, direction); dma_map_single()
88 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, dma_unmap_single() argument
91 hppa_dma_ops->unmap_single(dev, dma_addr, size, direction); dma_unmap_single()
110 size_t size, enum dma_data_direction direction) dma_map_page()
112 return dma_map_single(dev, (page_address(page) + (offset)), size, direction); dma_map_page()
116 dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, dma_unmap_page() argument
119 dma_unmap_single(dev, dma_address, size, direction); dma_unmap_page()
124 dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, dma_sync_single_for_cpu() argument
128 hppa_dma_ops->dma_sync_single_for_cpu(dev, dma_handle, 0, size, direction); dma_sync_single_for_cpu()
132 dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, dma_sync_single_for_device() argument
136 hppa_dma_ops->dma_sync_single_for_device(dev, dma_handle, 0, size, direction); dma_sync_single_for_device()
141 unsigned long offset, size_t size, dma_sync_single_range_for_cpu()
145 hppa_dma_ops->dma_sync_single_for_cpu(dev, dma_handle, offset, size, direction); dma_sync_single_range_for_cpu()
150 unsigned long offset, size_t size, dma_sync_single_range_for_device()
154 hppa_dma_ops->dma_sync_single_for_device(dev, dma_handle, offset, size, direction); dma_sync_single_range_for_device()
191 dma_cache_sync(struct device *dev, void *vaddr, size_t size, dma_cache_sync() argument
195 flush_kernel_dcache_range((unsigned long)vaddr, size); dma_cache_sync()
226 struct resource *res, unsigned long size,
231 #define ccio_allocate_resource(dev, res, size, min, max, align) \
232 allocate_resource(&iomem_resource, res, size, min, max, \
247 dma_addr_t dma_addr, size_t size) dma_mmap_coherent()
254 size_t size) dma_get_sgtable()
109 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) dma_map_page() argument
140 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_cpu() argument
149 dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_device() argument
245 dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size) dma_mmap_coherent() argument
252 dma_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr, dma_addr_t dma_addr, size_t size) dma_get_sgtable() argument
/linux-4.1.27/drivers/mtd/
H A Dmtdconcat.c50 * how to calculate the size required for the above structure,
77 size_t size, retsize; concat_read() local
79 if (from >= subdev->size) { concat_read()
81 size = 0; concat_read()
82 from -= subdev->size; concat_read()
85 if (from + len > subdev->size) concat_read()
87 size = subdev->size - from; concat_read()
90 size = len; concat_read()
92 err = mtd_read(subdev, from, size, &retsize, buf); concat_read()
109 len -= size; concat_read()
113 buf += size; concat_read()
129 size_t size, retsize; concat_write() local
131 if (to >= subdev->size) { concat_write()
132 size = 0; concat_write()
133 to -= subdev->size; concat_write()
136 if (to + len > subdev->size) concat_write()
137 size = subdev->size - to; concat_write()
139 size = len; concat_write()
141 err = mtd_write(subdev, to, size, &retsize, buf); concat_write()
146 len -= size; concat_write()
151 buf += size; concat_write()
187 size_t size, wsize, retsize, old_iov_len; concat_writev() local
189 if (to >= subdev->size) { concat_writev()
190 to -= subdev->size; concat_writev()
194 size = min_t(uint64_t, total_len, subdev->size - to); concat_writev()
195 wsize = size; /* store for future use */ concat_writev()
199 if (size <= vecs_copy[entry_high].iov_len) concat_writev()
201 size -= vecs_copy[entry_high++].iov_len; concat_writev()
205 vecs_copy[entry_high].iov_len = size; concat_writev()
210 vecs_copy[entry_high].iov_len = old_iov_len - size; concat_writev()
211 vecs_copy[entry_high].iov_base += size; concat_writev()
244 if (from >= subdev->size) { concat_read_oob()
245 from -= subdev->size; concat_read_oob()
250 if (from + devops.len > subdev->size) concat_read_oob()
251 devops.len = subdev->size - from; concat_read_oob()
304 if (to >= subdev->size) { concat_write_oob()
305 to -= subdev->size; concat_write_oob()
310 if (to + devops.len > subdev->size) concat_write_oob()
311 devops.len = subdev->size - to; concat_write_oob()
390 /* the easy case: device has uniform erase block size */ concat_erase()
396 /* device has variable erase size */ concat_erase()
410 * offset is aligned to this region's erase size: concat_erase()
423 * check if the ending offset is aligned to this region's erase size concat_erase()
445 if (subdev->size <= erase->addr) { concat_erase()
446 erase->addr -= subdev->size; concat_erase()
447 offset += subdev->size; concat_erase()
453 /* must never happen since size limit has been verified above */ concat_erase()
462 /* limit length to subdevice's size: */ concat_erase()
463 if (erase->addr + length > subdev->size) concat_erase()
464 erase->len = subdev->size - erase->addr; concat_erase()
486 offset += subdev->size; concat_erase()
505 uint64_t size; concat_lock() local
507 if (ofs >= subdev->size) { concat_lock()
508 size = 0; concat_lock()
509 ofs -= subdev->size; concat_lock()
512 if (ofs + len > subdev->size) concat_lock()
513 size = subdev->size - ofs; concat_lock()
515 size = len; concat_lock()
517 err = mtd_lock(subdev, ofs, size); concat_lock()
521 len -= size; concat_lock()
539 uint64_t size; concat_unlock() local
541 if (ofs >= subdev->size) { concat_unlock()
542 size = 0; concat_unlock()
543 ofs -= subdev->size; concat_unlock()
546 if (ofs + len > subdev->size) concat_unlock()
547 size = subdev->size - ofs; concat_unlock()
549 size = len; concat_unlock()
551 err = mtd_unlock(subdev, ofs, size); concat_unlock()
555 len -= size; concat_unlock()
612 if (ofs >= subdev->size) { concat_block_isbad()
613 ofs -= subdev->size; concat_block_isbad()
632 if (ofs >= subdev->size) { concat_block_markbad()
633 ofs -= subdev->size; concat_block_markbad()
661 if (offset >= subdev->size) { concat_get_unmapped_area()
662 offset -= subdev->size; concat_get_unmapped_area()
683 size_t size; mtd_concat_create() local
695 size = SIZEOF_STRUCT_MTD_CONCAT(num_devs); mtd_concat_create()
696 concat = kzalloc(size, GFP_KERNEL); mtd_concat_create()
711 concat->mtd.size = subdev[0]->size; mtd_concat_create()
763 concat->mtd.size += subdev[i]->size; mtd_concat_create()
796 * Combine the erase block size info of the subdevices: mtd_concat_create()
799 * many changes in erase size we have mtd_concat_create()
805 /* current subdevice has uniform erase size */ mtd_concat_create()
807 /* if it differs from the last subdevice's erase size, count it */ mtd_concat_create()
814 /* current subdevice has variable erase size */ mtd_concat_create()
834 * All subdevices have the same uniform erase size. mtd_concat_create()
843 * erase block size varies across the subdevices: allocate mtd_concat_create()
870 /* current subdevice has uniform erase size */ mtd_concat_create()
887 position += subdev[i]->size; mtd_concat_create()
889 /* current subdevice has variable erase size */ mtd_concat_create()
/linux-4.1.27/drivers/net/wireless/ti/wlcore/
H A Dio.c84 (addr < part->mem.start + part->mem.size)) wlcore_translate_addr()
87 (addr < part->reg.start + part->reg.size)) wlcore_translate_addr()
88 return addr - part->reg.start + part->mem.size; wlcore_translate_addr()
90 (addr < part->mem2.start + part->mem2.size)) wlcore_translate_addr()
91 return addr - part->mem2.start + part->mem.size + wlcore_translate_addr()
92 part->reg.size; wlcore_translate_addr()
94 (addr < part->mem3.start + part->mem3.size)) wlcore_translate_addr()
95 return addr - part->mem3.start + part->mem.size + wlcore_translate_addr()
96 part->reg.size + part->mem2.size; wlcore_translate_addr()
121 * 00000000 <--+----+... ...+----+--> mem.start + mem.size
125 * mem.size <--+----+... | | {unused area)
128 * mem.size | | ... | |
130 * reg.size | | ... | |
133 * ...+----+--> reg.start + reg.size
146 p->mem.start, p->mem.size); wlcore_set_partition()
148 p->reg.start, p->reg.size); wlcore_set_partition()
150 p->mem2.start, p->mem2.size); wlcore_set_partition()
152 p->mem3.start, p->mem3.size); wlcore_set_partition()
158 ret = wlcore_raw_write32(wl, HW_PART0_SIZE_ADDR, p->mem.size); wlcore_set_partition()
166 ret = wlcore_raw_write32(wl, HW_PART1_SIZE_ADDR, p->reg.size); wlcore_set_partition()
174 ret = wlcore_raw_write32(wl, HW_PART2_SIZE_ADDR, p->mem2.size); wlcore_set_partition()
179 * We don't need the size of the last partition, as it is wlcore_set_partition()
180 * automatically calculated based on the total memory size and wlcore_set_partition()
/linux-4.1.27/arch/cris/arch-v32/drivers/pci/
H A Ddma.c19 void *dma_alloc_coherent(struct device *dev, size_t size, dma_alloc_coherent() argument
23 int order = get_order(size); dma_alloc_coherent()
27 if (dma_alloc_from_coherent(dev, size, dma_handle, &ret)) dma_alloc_coherent()
36 memset(ret, 0, size); dma_alloc_coherent()
42 void dma_free_coherent(struct device *dev, size_t size, dma_free_coherent() argument
45 int order = get_order(size); dma_free_coherent()
/linux-4.1.27/drivers/gpu/drm/nouveau/include/nvkm/subdev/
H A Dbios.h7 u32 size; member in struct:nvkm_bios
28 u8 nvbios_checksum(const u8 *data, int size);
29 u16 nvbios_findstr(const u8 *data, int size, const char *str, int len);
/linux-4.1.27/arch/mips/include/asm/
H A Ddma-mapping.h23 static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) dma_capable() argument
28 return addr + size <= *dev->dma_mask; dma_capable()
31 static inline void dma_mark_clean(void *addr, size_t size) {} dma_mark_clean() argument
65 extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
70 static inline void *dma_alloc_attrs(struct device *dev, size_t size, dma_alloc_attrs() argument
77 ret = ops->alloc(dev, size, dma_handle, gfp, attrs); dma_alloc_attrs()
79 debug_dma_alloc_coherent(dev, size, *dma_handle, ret); dma_alloc_attrs()
86 static inline void dma_free_attrs(struct device *dev, size_t size, dma_free_attrs() argument
92 ops->free(dev, size, vaddr, dma_handle, attrs); dma_free_attrs()
94 debug_dma_free_coherent(dev, size, vaddr, dma_handle); dma_free_attrs()
98 void *dma_alloc_noncoherent(struct device *dev, size_t size,
101 void dma_free_noncoherent(struct device *dev, size_t size,
H A Dbcache.h19 void (*bc_wback_inv)(unsigned long page, unsigned long size);
20 void (*bc_inv)(unsigned long page, unsigned long size);
39 static inline void bc_wback_inv(unsigned long page, unsigned long size) bc_wback_inv() argument
41 bcops->bc_wback_inv(page, size); bc_wback_inv()
44 static inline void bc_inv(unsigned long page, unsigned long size) bc_inv() argument
46 bcops->bc_inv(page, size); bc_inv()
55 #define bc_wback_inv(page, size) do { } while (0)
56 #define bc_inv(page, size) do { } while (0)
/linux-4.1.27/arch/mn10300/proc-mn103e010/
H A Dproc-init.c81 * determine the memory size and base from the memory controller regs
85 unsigned long base, size; get_mem_info() local
92 size = (base & SDBASE_CBAM) << SDBASE_CBAM_SHIFT; get_mem_info()
93 size = ~size + 1; get_mem_info()
96 printk(KERN_INFO "SDRAM[0]: %luMb @%08lx\n", size >> 20, base); get_mem_info()
97 *mem_size += size; get_mem_info()
103 size = (base & SDBASE_CBAM) << SDBASE_CBAM_SHIFT; get_mem_info()
104 size = ~size + 1; get_mem_info()
107 printk(KERN_INFO "SDRAM[1]: %luMb @%08lx\n", size >> 20, base); get_mem_info()
108 *mem_size += size; get_mem_info()
/linux-4.1.27/arch/m68k/amiga/
H A Dchipram.c44 void *amiga_chip_alloc(unsigned long size, const char *name) amiga_chip_alloc() argument
54 p = amiga_chip_alloc_res(size, res); amiga_chip_alloc()
72 void *amiga_chip_alloc_res(unsigned long size, struct resource *res) amiga_chip_alloc_res() argument
77 size = PAGE_ALIGN(size); amiga_chip_alloc_res()
79 pr_debug("amiga_chip_alloc_res: allocate %lu bytes\n", size); amiga_chip_alloc_res()
80 error = allocate_resource(&chipram_res, res, size, 0, UINT_MAX, amiga_chip_alloc_res()
88 atomic_sub(size, &chipavail); amiga_chip_alloc_res()
97 unsigned long size; amiga_chip_free() local
106 size = resource_size(res); amiga_chip_free()
107 pr_debug("amiga_chip_free: free %lu bytes at %p\n", size, ptr); amiga_chip_free()
108 atomic_add(size, &chipavail); amiga_chip_free()
/linux-4.1.27/arch/arc/mm/
H A Ddma.c29 void *dma_alloc_noncoherent(struct device *dev, size_t size, dma_alloc_noncoherent() argument
35 paddr = alloc_pages_exact(size, gfp); dma_alloc_noncoherent()
46 void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, dma_free_noncoherent() argument
50 size); dma_free_noncoherent()
54 void *dma_alloc_coherent(struct device *dev, size_t size, dma_alloc_coherent() argument
60 paddr = alloc_pages_exact(size, gfp); dma_alloc_coherent()
65 kvaddr = ioremap_nocache((unsigned long)paddr, size); dma_alloc_coherent()
67 memset(kvaddr, 0, size); dma_alloc_coherent()
76 void dma_free_coherent(struct device *dev, size_t size, void *kvaddr, dma_free_coherent() argument
82 size); dma_free_coherent()
89 void __arc_dma_cache_sync(unsigned long paddr, size_t size, __arc_dma_cache_sync() argument
92 __inline_dma_cache_sync(paddr, size, dir); __arc_dma_cache_sync()
H A Dioremap.c17 void __iomem *ioremap(unsigned long paddr, unsigned long size) ioremap() argument
21 /* Don't allow wraparound or zero size */ ioremap()
22 end = paddr + size - 1; ioremap()
23 if (!size || (end < paddr)) ioremap()
30 return ioremap_prot(paddr, size, PAGE_KERNEL_NO_CACHE); ioremap()
41 void __iomem *ioremap_prot(phys_addr_t paddr, unsigned long size, ioremap_prot() argument
49 /* Don't allow wraparound, zero size */ ioremap_prot()
50 end = paddr + size - 1; ioremap_prot()
51 if ((!size) || (end < paddr)) ioremap_prot()
64 size = PAGE_ALIGN(end + 1) - paddr; ioremap_prot()
69 area = get_vm_area(size, VM_IOREMAP); ioremap_prot()
75 (unsigned long)vaddr + size, paddr, prot)) { ioremap_prot()
/linux-4.1.27/include/drm/
H A Ddrm_mem_util.h32 static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) drm_calloc_large() argument
34 if (size != 0 && nmemb > SIZE_MAX / size) drm_calloc_large()
37 if (size * nmemb <= PAGE_SIZE) drm_calloc_large()
38 return kcalloc(nmemb, size, GFP_KERNEL); drm_calloc_large()
40 return __vmalloc(size * nmemb, drm_calloc_large()
45 static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size) drm_malloc_ab() argument
47 if (size != 0 && nmemb > SIZE_MAX / size) drm_malloc_ab()
50 if (size * nmemb <= PAGE_SIZE) drm_malloc_ab()
51 return kmalloc(nmemb * size, GFP_KERNEL); drm_malloc_ab()
53 return __vmalloc(size * nmemb, drm_malloc_ab()
/linux-4.1.27/drivers/scsi/bnx2i/
H A Dbnx2i_sysfs.c31 * bnx2i_show_sq_info - return(s currently configured send queue (SQ) size
33 * @buf: buffer to return current SQ size parameter
35 * Returns current SQ size parameter, this paramater determines the number
48 * bnx2i_set_sq_info - update send queue (SQ) size parameter
50 * @buf: buffer to return current SQ size parameter
51 * @count: parameter buffer size
53 * Interface for user to change shared queue size allocated for each conn
82 printk(KERN_ERR "bnx2i: device busy, cannot change SQ size\n"); bnx2i_set_sq_info()
88 * bnx2i_show_ccell_info - returns command cell (HQ) size
90 * @buf: buffer to return current SQ size parameter
92 * returns per-connection TCP history queue size parameter
104 * bnx2i_get_link_state - set command cell (HQ) size
106 * @buf: buffer to return current SQ size parameter
107 * @count: parameter buffer size
109 * updates per-connection TCP history queue size parameter
131 printk(KERN_ERR "bnx2i: device busy, cannot change CCELL size\n"); bnx2i_set_ccell_info()
/linux-4.1.27/arch/sparc/include/uapi/asm/
H A Dioctl.h7 * 14 bits of size as on i386. Here's the layout:
38 #define _IOC(dir,type,nr,size) \
42 ((size) << _IOC_SIZESHIFT))
45 #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
46 #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
47 #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
/linux-4.1.27/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/
H A Dimage.h5 u32 size; member in struct:nvbios_image
/linux-4.1.27/drivers/gpu/drm/nouveau/nvif/
H A Dobject.c31 nvif_object_ioctl(struct nvif_object *object, void *data, u32 size, void **hack) nvif_object_ioctl() argument
38 if (size >= sizeof(*args) && args->v0.version == 0) { nvif_object_ioctl()
50 return client->driver->ioctl(client->base.priv, client->super, data, size, hack); nvif_object_ioctl()
60 u32 size = count * sizeof(args->sclass.oclass[0]); nvif_object_sclass() local
63 if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) nvif_object_sclass()
70 memcpy(args->sclass.oclass, oclass, size); nvif_object_sclass()
71 ret = nvif_object_ioctl(object, args, sizeof(*args) + size, NULL); nvif_object_sclass()
73 memcpy(oclass, args->sclass.oclass, size); nvif_object_sclass()
79 nvif_object_rd(struct nvif_object *object, int size, u64 addr) nvif_object_rd() argument
86 .rd.size = size, nvif_object_rd()
98 nvif_object_wr(struct nvif_object *object, int size, u64 addr, u32 data) nvif_object_wr() argument
105 .wr.size = size, nvif_object_wr()
116 nvif_object_mthd(struct nvif_object *object, u32 mthd, void *data, u32 size) nvif_object_mthd() argument
125 if (sizeof(*args) + size > sizeof(stack)) { nvif_object_mthd()
126 if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) nvif_object_mthd()
136 memcpy(args->mthd.data, data, size); nvif_object_mthd()
137 ret = nvif_object_ioctl(object, args, sizeof(*args) + size, NULL); nvif_object_mthd()
138 memcpy(data, args->mthd.data, size); nvif_object_mthd()
147 if (object->map.size) { nvif_object_unmap()
158 object->map.size); nvif_object_unmap()
163 object->map.size = 0; nvif_object_unmap()
179 object->map.size = args.map.length; nvif_object_map()
181 object->map.size); nvif_object_map()
209 object->size = 0; nvif_object_fini()
219 u32 handle, u32 oclass, void *data, u32 size, nvif_object_init()
232 object->size = 0; nvif_object_init()
235 object->map.size = 0; nvif_object_init()
238 if (!(ctor = kmalloc(sizeof(*ctor) + size, GFP_KERNEL))) { nvif_object_init()
243 object->size = size; nvif_object_init()
244 memcpy(object->data, data, size); nvif_object_init()
255 object->size, &object->priv); nvif_object_init()
272 void *data, u32 size, struct nvif_object **pobject) nvif_object_new()
277 oclass, data, size, object); nvif_object_new()
218 nvif_object_init(struct nvif_object *parent, void (*dtor)(struct nvif_object *), u32 handle, u32 oclass, void *data, u32 size, struct nvif_object *object) nvif_object_init() argument
271 nvif_object_new(struct nvif_object *parent, u32 handle, u32 oclass, void *data, u32 size, struct nvif_object **pobject) nvif_object_new() argument
/linux-4.1.27/drivers/gpu/drm/nouveau/nvkm/engine/gr/
H A Dnv50.h7 int nv50_grctx_init(struct nvkm_device *, u32 *size);
/linux-4.1.27/arch/microblaze/include/asm/
H A Dcmpxchg.h6 void __bad_xchg(volatile void *ptr, int size);
9 int size) __xchg()
14 switch (size) { __xchg()
29 __bad_xchg(ptr, size), ret = 0; __xchg()
8 __xchg(unsigned long x, volatile void *ptr, int size) __xchg() argument
H A Dio.h41 extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
42 #define ioremap_writethrough(addr, size) ioremap((addr), (size))
43 #define ioremap_nocache(addr, size) ioremap((addr), (size))
44 #define ioremap_fullcache(addr, size) ioremap((addr), (size))
45 #define ioremap_wc(addr, size) ioremap((addr), (size))
/linux-4.1.27/include/linux/mtd/
H A Dmtdram.h6 unsigned long size, const char *name);
/linux-4.1.27/arch/s390/include/asm/
H A Ddma-mapping.h23 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, dma_cache_sync() argument
42 static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) dma_capable() argument
46 return addr + size - 1 <= *dev->dma_mask; dma_capable()
61 static inline void *dma_alloc_attrs(struct device *dev, size_t size, dma_alloc_attrs() argument
70 cpu_addr = ops->alloc(dev, size, dma_handle, flags, attrs); dma_alloc_attrs()
71 debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr); dma_alloc_attrs()
78 static inline void dma_free_attrs(struct device *dev, size_t size, dma_free_attrs() argument
86 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); dma_free_attrs()
87 ops->free(dev, size, cpu_addr, dma_handle, attrs); dma_free_attrs()
H A Dpci_io.h124 int count = len > max ? max : len, size = 1; zpci_get_max_write_size() local
126 while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) { zpci_get_max_write_size()
129 size = size << 1; zpci_get_max_write_size()
131 return size; zpci_get_max_write_size()
140 int size, rc = 0; zpci_memcpy_fromio() local
143 size = zpci_get_max_write_size((u64 __force) src, zpci_memcpy_fromio()
145 req = ZPCI_CREATE_REQ(entry->fh, entry->bar, size); zpci_memcpy_fromio()
146 rc = zpci_read_single(req, dst, offset, size); zpci_memcpy_fromio()
149 offset += size; zpci_memcpy_fromio()
150 dst += size; zpci_memcpy_fromio()
151 n -= size; zpci_memcpy_fromio()
161 int size, rc = 0; zpci_memcpy_toio() local
167 size = zpci_get_max_write_size((u64 __force) dst, zpci_memcpy_toio()
169 req = ZPCI_CREATE_REQ(entry->fh, entry->bar, size); zpci_memcpy_toio()
171 if (size > 8) /* main path */ zpci_memcpy_toio()
174 rc = zpci_write_single(req, src, offset, size); zpci_memcpy_toio()
177 offset += size; zpci_memcpy_toio()
178 src += size; zpci_memcpy_toio()
179 n -= size; zpci_memcpy_toio()
/linux-4.1.27/arch/c6x/kernel/
H A Ddma.c17 static void c6x_dma_sync(dma_addr_t handle, size_t size, c6x_dma_sync() argument
26 L2_cache_block_invalidate(paddr, paddr + size); c6x_dma_sync()
29 L2_cache_block_writeback(paddr, paddr + size); c6x_dma_sync()
32 L2_cache_block_writeback_invalidate(paddr, paddr + size); c6x_dma_sync()
39 dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, dma_map_single() argument
44 c6x_dma_sync(addr, size, dir); dma_map_single()
47 (unsigned long)ptr & ~PAGE_MASK, size, dma_map_single()
55 size_t size, enum dma_data_direction dir) dma_unmap_single()
57 c6x_dma_sync(handle, size, dir); dma_unmap_single()
59 debug_dma_unmap_page(dev, handle, size, dir, true); dma_unmap_single()
95 size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu()
97 c6x_dma_sync(handle, size, dir); dma_sync_single_for_cpu()
99 debug_dma_sync_single_for_cpu(dev, handle, size, dir); dma_sync_single_for_cpu()
105 size_t size, enum dma_data_direction dir) dma_sync_single_for_device()
107 c6x_dma_sync(handle, size, dir); dma_sync_single_for_device()
109 debug_dma_sync_single_for_device(dev, handle, size, dir); dma_sync_single_for_device()
54 dma_unmap_single(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_unmap_single() argument
94 dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu() argument
104 dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_device() argument
H A Ddevicetree.c15 void __init early_init_dt_add_memory_arch(u64 base, u64 size) early_init_dt_add_memory_arch() argument
17 c6x_add_memory(base, size); early_init_dt_add_memory_arch()
/linux-4.1.27/arch/cris/include/arch-v32/arch/
H A Dintmem.h4 void* crisv32_intmem_alloc(unsigned size, unsigned align);
/linux-4.1.27/arch/frv/include/asm/
H A Dfpu.h6 * MAX floating point unit state size (FSAVE/FRESTORE)
/linux-4.1.27/arch/arm/kernel/
H A Datags_proc.c8 size_t size; member in struct:buffer
16 return simple_read_from_buffer(buf, count, ppos, b->data, b->size); atags_read()
41 size_t size; init_atags_procfs() local
48 for (; tag->hdr.size; tag = tag_next(tag)) init_atags_procfs()
52 size = (char *)tag - atags_copy + sizeof(struct tag_header); init_atags_procfs()
56 b = kmalloc(sizeof(*b) + size, GFP_KERNEL); init_atags_procfs()
60 b->size = size; init_atags_procfs()
61 memcpy(b->data, atags_copy, size); init_atags_procfs()
/linux-4.1.27/fs/btrfs/
H A Dacl.c33 int size; btrfs_get_acl() local
49 size = __btrfs_getxattr(inode, name, "", 0); btrfs_get_acl()
50 if (size > 0) { btrfs_get_acl()
51 value = kzalloc(size, GFP_NOFS); btrfs_get_acl()
54 size = __btrfs_getxattr(inode, name, value, size); btrfs_get_acl()
56 if (size > 0) { btrfs_get_acl()
57 acl = posix_acl_from_xattr(&init_user_ns, value, size); btrfs_get_acl()
58 } else if (size == -ENOENT || size == -ENODATA || size == 0) { btrfs_get_acl()
78 int ret, size = 0; __btrfs_set_acl() local
104 size = posix_acl_xattr_size(acl->a_count); __btrfs_set_acl()
105 value = kmalloc(size, GFP_NOFS); __btrfs_set_acl()
111 ret = posix_acl_to_xattr(&init_user_ns, acl, value, size); __btrfs_set_acl()
116 ret = __btrfs_setxattr(trans, inode, name, value, size, 0); __btrfs_set_acl()
/linux-4.1.27/arch/arm64/mm/
H A Ddma-mapping.c54 static void *__alloc_from_pool(size_t size, struct page **ret_page, gfp_t flags) __alloc_from_pool() argument
64 val = gen_pool_alloc(atomic_pool, size); __alloc_from_pool()
70 memset(ptr, 0, size); __alloc_from_pool()
76 static bool __in_atomic_pool(void *start, size_t size) __in_atomic_pool() argument
78 return addr_in_gen_pool(atomic_pool, (unsigned long)start, size); __in_atomic_pool()
81 static int __free_from_pool(void *start, size_t size) __free_from_pool() argument
83 if (!__in_atomic_pool(start, size)) __free_from_pool()
86 gen_pool_free(atomic_pool, (unsigned long)start, size); __free_from_pool()
91 static void *__dma_alloc_coherent(struct device *dev, size_t size, __dma_alloc_coherent() argument
107 page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT, __dma_alloc_coherent()
108 get_order(size)); __dma_alloc_coherent()
114 memset(addr, 0, size); __dma_alloc_coherent()
117 return swiotlb_alloc_coherent(dev, size, dma_handle, flags); __dma_alloc_coherent()
121 static void __dma_free_coherent(struct device *dev, size_t size, __dma_free_coherent() argument
135 size >> PAGE_SHIFT); __dma_free_coherent()
137 swiotlb_free_coherent(dev, size, vaddr, dma_handle); __dma_free_coherent()
140 static void *__dma_alloc(struct device *dev, size_t size, __dma_alloc() argument
148 size = PAGE_ALIGN(size); __dma_alloc()
152 void *addr = __alloc_from_pool(size, &page, flags); __dma_alloc()
160 ptr = __dma_alloc_coherent(dev, size, dma_handle, flags, attrs); __dma_alloc()
169 __dma_flush_range(ptr, ptr + size); __dma_alloc()
173 coherent_ptr = dma_common_contiguous_remap(page, size, VM_USERMAP, __dma_alloc()
183 __dma_free_coherent(dev, size, ptr, *dma_handle, attrs); __dma_alloc()
189 static void __dma_free(struct device *dev, size_t size, __dma_free() argument
195 size = PAGE_ALIGN(size); __dma_free()
198 if (__free_from_pool(vaddr, size)) __dma_free()
202 __dma_free_coherent(dev, size, swiotlb_addr, dma_handle, attrs); __dma_free()
206 unsigned long offset, size_t size, __swiotlb_map_page()
212 dev_addr = swiotlb_map_page(dev, page, offset, size, dir, attrs); __swiotlb_map_page()
214 __dma_map_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_map_page()
221 size_t size, enum dma_data_direction dir, __swiotlb_unmap_page()
225 __dma_unmap_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_unmap_page()
226 swiotlb_unmap_page(dev, dev_addr, size, dir, attrs); __swiotlb_unmap_page()
261 dma_addr_t dev_addr, size_t size, __swiotlb_sync_single_for_cpu()
265 __dma_unmap_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_sync_single_for_cpu()
266 swiotlb_sync_single_for_cpu(dev, dev_addr, size, dir); __swiotlb_sync_single_for_cpu()
270 dma_addr_t dev_addr, size_t size, __swiotlb_sync_single_for_device()
273 swiotlb_sync_single_for_device(dev, dev_addr, size, dir); __swiotlb_sync_single_for_device()
275 __dma_map_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_sync_single_for_device()
308 void *cpu_addr, dma_addr_t dma_addr, size_t size) __dma_common_mmap()
313 unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; __dma_common_mmap()
317 if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret)) __dma_common_mmap()
332 void *cpu_addr, dma_addr_t dma_addr, size_t size, __swiotlb_mmap()
337 return __dma_common_mmap(dev, vma, cpu_addr, dma_addr, size); __swiotlb_mmap()
205 __swiotlb_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) __swiotlb_map_page() argument
220 __swiotlb_unmap_page(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) __swiotlb_unmap_page() argument
260 __swiotlb_sync_single_for_cpu(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) __swiotlb_sync_single_for_cpu() argument
269 __swiotlb_sync_single_for_device(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) __swiotlb_sync_single_for_device() argument
307 __dma_common_mmap(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size) __dma_common_mmap() argument
330 __swiotlb_mmap(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs) __swiotlb_mmap() argument
/linux-4.1.27/arch/hexagon/kernel/
H A Ddma.c63 static void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, hexagon_dma_alloc_coherent() argument
86 ret = (void *) gen_pool_alloc(coherent_pool, size); hexagon_dma_alloc_coherent()
89 memset(ret, 0, size); hexagon_dma_alloc_coherent()
97 static void hexagon_free_coherent(struct device *dev, size_t size, void *vaddr, hexagon_free_coherent() argument
100 gen_pool_free(coherent_pool, (unsigned long) vaddr, size); hexagon_free_coherent()
104 dma_addr_t bus, size_t size) check_addr()
106 if (hwdev && hwdev->dma_mask && !dma_capable(hwdev, bus, size)) { check_addr()
110 name, (long long)bus, size, check_addr()
143 static inline void dma_sync(void *addr, size_t size, dma_sync() argument
149 (unsigned long) addr + size); dma_sync()
153 (unsigned long) addr + size); dma_sync()
157 (unsigned long) addr + size); dma_sync()
169 * @size: size of memory to map
184 unsigned long offset, size_t size, hexagon_map_page()
189 WARN_ON(size == 0); hexagon_map_page()
191 if (!check_addr("map_single", dev, bus, size)) hexagon_map_page()
194 dma_sync(dma_addr_to_virt(bus), size, dir); hexagon_map_page()
200 dma_addr_t dma_handle, size_t size, hexagon_sync_single_for_cpu()
203 dma_sync(dma_addr_to_virt(dma_handle), size, dir); hexagon_sync_single_for_cpu() local
207 dma_addr_t dma_handle, size_t size, hexagon_sync_single_for_device()
210 dma_sync(dma_addr_to_virt(dma_handle), size, dir); hexagon_sync_single_for_device() local
103 check_addr(const char *name, struct device *hwdev, dma_addr_t bus, size_t size) check_addr() argument
183 hexagon_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) hexagon_map_page() argument
199 hexagon_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) hexagon_sync_single_for_cpu() argument
206 hexagon_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) hexagon_sync_single_for_device() argument
/linux-4.1.27/arch/parisc/kernel/
H A Dpci-dma.c84 unsigned long size, unsigned long *paddr_ptr) map_pte_uncached()
90 end = vaddr + size; map_pte_uncached()
111 unsigned long size, unsigned long *paddr_ptr) map_pmd_uncached()
117 end = vaddr + size; map_pmd_uncached()
133 static inline int map_uncached_pages(unsigned long vaddr, unsigned long size, map_uncached_pages() argument
137 unsigned long end = vaddr + size; map_uncached_pages()
155 unsigned long size) unmap_uncached_pte()
170 end = vaddr + size; unmap_uncached_pte()
191 unsigned long size) unmap_uncached_pmd()
206 end = vaddr + size; unmap_uncached_pmd()
217 static void unmap_uncached_pages(unsigned long vaddr, unsigned long size) unmap_uncached_pages() argument
220 unsigned long end = vaddr + size; unmap_uncached_pages()
230 #define PCXL_SEARCH_LOOP(idx, mask, size) \
236 pcxl_res_hint = idx + (size >> 3); \
241 #define PCXL_FIND_FREE_MAPPING(idx, mask, size) { \
242 u##size *res_ptr = (u##size *)&(pcxl_res_map[pcxl_res_hint & ~((size >> 3) - 1)]); \
243 u##size *res_end = (u##size *)&pcxl_res_map[pcxl_res_size]; \
244 PCXL_SEARCH_LOOP(idx, mask, size); \
245 res_ptr = (u##size *)&pcxl_res_map[0]; \
246 PCXL_SEARCH_LOOP(idx, mask, size); \
250 pcxl_alloc_range(size_t size) pcxl_alloc_range() argument
254 unsigned int pages_needed = size >> PAGE_SHIFT; pcxl_alloc_range()
259 DBG_RES("pcxl_alloc_range() size: %d pages_needed %d pages_mask 0x%08lx\n", pcxl_alloc_range()
260 size, pages_needed, mask); pcxl_alloc_range()
297 #define PCXL_FREE_MAPPINGS(idx, m, size) \
298 u##size *res_ptr = (u##size *)&(pcxl_res_map[(idx) + (((size >> 3) - 1) & (~((size >> 3) - 1)))]); \
306 pcxl_free_range(unsigned long vaddr, size_t size) pcxl_free_range() argument
310 unsigned int pages_mapped = size >> PAGE_SHIFT; pcxl_free_range()
315 DBG_RES("pcxl_free_range() res_idx: %d size: %d pages_mapped %d mask 0x%08lx\n", pcxl_free_range()
316 res_idx, size, pages_mapped, mask); pcxl_free_range()
347 seq_printf(m, "\nDMA Mapping Area size : %d bytes (%ld pages)\n", proc_pcxl_dma_show()
416 static void * pa11_dma_alloc_consistent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag) pa11_dma_alloc_consistent() argument
422 order = get_order(size); pa11_dma_alloc_consistent()
423 size = 1 << (order + PAGE_SHIFT); pa11_dma_alloc_consistent()
424 vaddr = pcxl_alloc_range(size); pa11_dma_alloc_consistent()
426 flush_kernel_dcache_range(paddr, size); pa11_dma_alloc_consistent()
428 map_uncached_pages(vaddr, size, paddr); pa11_dma_alloc_consistent()
442 static void pa11_dma_free_consistent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle) pa11_dma_free_consistent() argument
446 order = get_order(size); pa11_dma_free_consistent()
447 size = 1 << (order + PAGE_SHIFT); pa11_dma_free_consistent()
448 unmap_uncached_pages((unsigned long)vaddr, size); pa11_dma_free_consistent()
449 pcxl_free_range((unsigned long)vaddr, size); pa11_dma_free_consistent()
453 static dma_addr_t pa11_dma_map_single(struct device *dev, void *addr, size_t size, enum dma_data_direction direction) pa11_dma_map_single() argument
457 flush_kernel_dcache_range((unsigned long) addr, size); pa11_dma_map_single()
461 static void pa11_dma_unmap_single(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) pa11_dma_unmap_single() argument
474 flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle), size); pa11_dma_unmap_single()
509 static void pa11_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) pa11_dma_sync_single_for_cpu() argument
513 flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size); pa11_dma_sync_single_for_cpu()
516 static void pa11_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) pa11_dma_sync_single_for_device() argument
520 flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size); pa11_dma_sync_single_for_device()
558 static void *fail_alloc_consistent(struct device *dev, size_t size, fail_alloc_consistent() argument
564 static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size, pa11_dma_alloc_noncoherent() argument
569 addr = (void *)__get_free_pages(flag, get_order(size)); pa11_dma_alloc_noncoherent()
576 static void pa11_dma_free_noncoherent(struct device *dev, size_t size, pa11_dma_free_noncoherent() argument
579 free_pages((unsigned long)vaddr, get_order(size)); pa11_dma_free_noncoherent()
82 map_pte_uncached(pte_t * pte, unsigned long vaddr, unsigned long size, unsigned long *paddr_ptr) map_pte_uncached() argument
110 map_pmd_uncached(pmd_t * pmd, unsigned long vaddr, unsigned long size, unsigned long *paddr_ptr) map_pmd_uncached() argument
154 unmap_uncached_pte(pmd_t * pmd, unsigned long vaddr, unsigned long size) unmap_uncached_pte() argument
190 unmap_uncached_pmd(pgd_t * dir, unsigned long vaddr, unsigned long size) unmap_uncached_pmd() argument
/linux-4.1.27/drivers/video/fbdev/core/
H A Dfbcmap.c94 int size = len * sizeof(u16); fb_alloc_cmap_gfp() local
102 cmap->red = kmalloc(size, flags); fb_alloc_cmap_gfp()
105 cmap->green = kmalloc(size, flags); fb_alloc_cmap_gfp()
108 cmap->blue = kmalloc(size, flags); fb_alloc_cmap_gfp()
112 cmap->transp = kmalloc(size, flags); fb_alloc_cmap_gfp()
167 int size; fb_copy_cmap() local
173 size = to->len - tooff; fb_copy_cmap()
174 if (size > (int) (from->len - fromoff)) fb_copy_cmap()
175 size = from->len - fromoff; fb_copy_cmap()
176 if (size <= 0) fb_copy_cmap()
178 size *= sizeof(u16); fb_copy_cmap()
180 memcpy(to->red+tooff, from->red+fromoff, size); fb_copy_cmap()
181 memcpy(to->green+tooff, from->green+fromoff, size); fb_copy_cmap()
182 memcpy(to->blue+tooff, from->blue+fromoff, size); fb_copy_cmap()
184 memcpy(to->transp+tooff, from->transp+fromoff, size); fb_copy_cmap()
191 int size; fb_cmap_to_user() local
197 size = to->len - tooff; fb_cmap_to_user()
198 if (size > (int) (from->len - fromoff)) fb_cmap_to_user()
199 size = from->len - fromoff; fb_cmap_to_user()
200 if (size <= 0) fb_cmap_to_user()
202 size *= sizeof(u16); fb_cmap_to_user()
204 if (copy_to_user(to->red+tooff, from->red+fromoff, size)) fb_cmap_to_user()
206 if (copy_to_user(to->green+tooff, from->green+fromoff, size)) fb_cmap_to_user()
208 if (copy_to_user(to->blue+tooff, from->blue+fromoff, size)) fb_cmap_to_user()
211 if (copy_to_user(to->transp+tooff, from->transp+fromoff, size)) fb_cmap_to_user()
265 int rc, size = cmap->len * sizeof(u16); fb_set_user_cmap() local
268 if (size < 0 || size < cmap->len) fb_set_user_cmap()
276 if (copy_from_user(umap.red, cmap->red, size) || fb_set_user_cmap()
277 copy_from_user(umap.green, cmap->green, size) || fb_set_user_cmap()
278 copy_from_user(umap.blue, cmap->blue, size) || fb_set_user_cmap()
279 (cmap->transp && copy_from_user(umap.transp, cmap->transp, size))) { fb_set_user_cmap()
298 * @len: size of palette for a depth
301 * is the size of the palette for a particular screen depth.
/linux-4.1.27/drivers/misc/vmw_vmci/
H A Dvmci_handle_array.c37 array->size = 0; vmci_handle_arr_create()
52 if (unlikely(array->size >= array->capacity)) { vmci_handle_arr_append_entry()
66 array->entries[array->size] = handle; vmci_handle_arr_append_entry()
67 array->size++; vmci_handle_arr_append_entry()
79 for (i = 0; i < array->size; i++) { vmci_handle_arr_remove_entry()
82 array->size--; vmci_handle_arr_remove_entry()
83 array->entries[i] = array->entries[array->size]; vmci_handle_arr_remove_entry()
84 array->entries[array->size] = VMCI_INVALID_HANDLE; vmci_handle_arr_remove_entry()
99 if (array->size) { vmci_handle_arr_remove_tail()
100 array->size--; vmci_handle_arr_remove_tail()
101 handle = array->entries[array->size]; vmci_handle_arr_remove_tail()
102 array->entries[array->size] = VMCI_INVALID_HANDLE; vmci_handle_arr_remove_tail()
114 if (unlikely(index >= array->size)) vmci_handle_arr_get_entry()
125 for (i = 0; i < array->size; i++) vmci_handle_arr_has_entry()
138 if (array->size) vmci_handle_arr_get_handles()
/linux-4.1.27/fs/ntfs/
H A Dmalloc.h31 * @size: number of bytes to allocate
36 * Allocates @size bytes of memory, rounded up to multiples of PAGE_SIZE and
42 static inline void *__ntfs_malloc(unsigned long size, gfp_t gfp_mask) __ntfs_malloc() argument
44 if (likely(size <= PAGE_SIZE)) { __ntfs_malloc()
45 BUG_ON(!size); __ntfs_malloc()
50 if (likely((size >> PAGE_SHIFT) < totalram_pages)) __ntfs_malloc()
51 return __vmalloc(size, gfp_mask, PAGE_KERNEL); __ntfs_malloc()
57 * @size: number of bytes to allocate
59 * Allocates @size bytes of memory, rounded up to multiples of PAGE_SIZE and
64 static inline void *ntfs_malloc_nofs(unsigned long size) ntfs_malloc_nofs() argument
66 return __ntfs_malloc(size, GFP_NOFS | __GFP_HIGHMEM); ntfs_malloc_nofs()
71 * @size: number of bytes to allocate
73 * Allocates @size bytes of memory, rounded up to multiples of PAGE_SIZE and
81 static inline void *ntfs_malloc_nofs_nofail(unsigned long size) ntfs_malloc_nofs_nofail() argument
83 return __ntfs_malloc(size, GFP_NOFS | __GFP_HIGHMEM | __GFP_NOFAIL); ntfs_malloc_nofs_nofail()
/linux-4.1.27/fs/jfs/
H A Dacl.c34 int size; jfs_get_acl() local
52 size = __jfs_getxattr(inode, ea_name, NULL, 0); jfs_get_acl()
54 if (size > 0) { jfs_get_acl()
55 value = kmalloc(size, GFP_KERNEL); jfs_get_acl()
58 size = __jfs_getxattr(inode, ea_name, value, size); jfs_get_acl()
61 if (size < 0) { jfs_get_acl()
62 if (size == -ENODATA) jfs_get_acl()
65 acl = ERR_PTR(size); jfs_get_acl()
67 acl = posix_acl_from_xattr(&init_user_ns, value, size); jfs_get_acl()
80 int size = 0; __jfs_set_acl() local
104 size = posix_acl_xattr_size(acl->a_count); __jfs_set_acl()
105 value = kmalloc(size, GFP_KERNEL); __jfs_set_acl()
108 rc = posix_acl_to_xattr(&init_user_ns, acl, value, size); __jfs_set_acl()
112 rc = __jfs_setxattr(tid, inode, ea_name, value, size, 0); __jfs_set_acl()
/linux-4.1.27/arch/cris/include/asm/
H A Ddma-mapping.h19 void *dma_alloc_coherent(struct device *dev, size_t size,
22 void dma_free_coherent(struct device *dev, size_t size,
26 dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, dma_alloc_coherent() argument
34 dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_free_coherent() argument
41 dma_map_single(struct device *dev, void *ptr, size_t size, dma_map_single() argument
49 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, dma_unmap_single() argument
65 size_t size, enum dma_data_direction direction) dma_map_page()
72 dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, dma_unmap_page() argument
87 dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, dma_sync_single_for_cpu() argument
93 dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, dma_sync_single_for_device() argument
100 unsigned long offset, size_t size, dma_sync_single_range_for_cpu()
107 unsigned long offset, size_t size, dma_sync_single_range_for_device()
156 dma_cache_sync(struct device *dev, void *vaddr, size_t size, dma_cache_sync() argument
163 void *cpu_addr, dma_addr_t dma_addr, size_t size);
166 size_t size);
64 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) dma_map_page() argument
99 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_cpu() argument
106 dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) dma_sync_single_range_for_device() argument
/linux-4.1.27/net/sctp/
H A Dssnmap.c40 /* Storage size needed for map includes 2 headers and then the
56 int size; sctp_ssnmap_new() local
58 size = sctp_ssnmap_size(in, out); sctp_ssnmap_new()
59 if (size <= KMALLOC_MAX_SIZE) sctp_ssnmap_new()
60 retval = kmalloc(size, gfp); sctp_ssnmap_new()
63 __get_free_pages(gfp, get_order(size)); sctp_ssnmap_new()
75 if (size <= KMALLOC_MAX_SIZE) sctp_ssnmap_new()
78 free_pages((unsigned long)retval, get_order(size)); sctp_ssnmap_new()
104 size_t size; sctp_ssnmap_clear() local
106 size = (map->in.len + map->out.len) * sizeof(__u16); sctp_ssnmap_clear()
107 memset(map->in.ssn, 0x00, size); sctp_ssnmap_clear()
113 int size; sctp_ssnmap_free() local
118 size = sctp_ssnmap_size(map->in.len, map->out.len); sctp_ssnmap_free()
119 if (size <= KMALLOC_MAX_SIZE) sctp_ssnmap_free()
122 free_pages((unsigned long)map, get_order(size)); sctp_ssnmap_free()
/linux-4.1.27/drivers/net/wireless/ath/wil6210/
H A Dfw_inc.c44 * Return file size or negative error
46 static int wil_fw_verify(struct wil6210_priv *wil, const u8 *data, size_t size) wil_fw_verify() argument
54 if (size % 4) { wil_fw_verify()
55 wil_err_fw(wil, "image size not aligned: %zu\n", size); wil_fw_verify()
59 if (size < sizeof(*hdr) + sizeof(fh)) { wil_fw_verify()
60 wil_err_fw(wil, "file too short: %zu bytes\n", size); wil_fw_verify()
77 if (size < dlen) { wil_fw_verify()
79 size, (ulong)dlen); wil_fw_verify()
101 /* checksum. ~crc32(~0, data, size) when fh.crc set to 0*/ wil_fw_verify()
122 size_t size) fw_handle_comment()
124 wil_hex_dump_fw("", DUMP_PREFIX_OFFSET, 16, 1, data, size, true); fw_handle_comment()
130 size_t size) fw_handle_data()
134 size_t s = size - sizeof(*d); fw_handle_data()
136 if (size < sizeof(*d) + sizeof(u32)) { fw_handle_data()
137 wil_err_fw(wil, "data record too short: %zu\n", size); fw_handle_data()
151 size_t size) fw_handle_fill()
156 size_t s = (size_t)le32_to_cpu(d->size); fw_handle_fill()
158 if (size != sizeof(*d)) { fw_handle_fill()
159 wil_err_fw(wil, "bad size for fill record: %zu\n", size); fw_handle_fill()
164 wil_err_fw(wil, "fill size too short: %zu\n", s); fw_handle_fill()
169 wil_err_fw(wil, "fill size not aligned: %zu\n", s); fw_handle_fill()
185 size_t size) fw_handle_file_header()
189 if (size != sizeof(*d)) { fw_handle_file_header()
190 wil_err_fw(wil, "file header length incorrect: %zu\n", size); fw_handle_file_header()
203 size_t size) fw_handle_direct_write()
209 if (size % sizeof(*block)) { fw_handle_direct_write()
210 wil_err_fw(wil, "record size not aligned on %zu: %zu\n", fw_handle_direct_write()
211 sizeof(*block), size); fw_handle_direct_write()
214 n = size / sizeof(*block); fw_handle_direct_write()
259 size_t size) fw_handle_gateway_data()
270 if (size < sizeof(*d) + sizeof(*block)) { fw_handle_gateway_data()
271 wil_err_fw(wil, "gateway record too short: %zu\n", size); fw_handle_gateway_data()
275 if ((size - sizeof(*d)) % sizeof(*block)) { fw_handle_gateway_data()
276 wil_err_fw(wil, "gateway record data size" fw_handle_gateway_data()
278 sizeof(*block), size - sizeof(*d)); fw_handle_gateway_data()
281 n = (size - sizeof(*d)) / sizeof(*block); fw_handle_gateway_data()
318 size_t size) fw_handle_gateway_data4()
329 if (size < sizeof(*d) + sizeof(*block)) { fw_handle_gateway_data4()
330 wil_err_fw(wil, "gateway4 record too short: %zu\n", size); fw_handle_gateway_data4()
334 if ((size - sizeof(*d)) % sizeof(*block)) { fw_handle_gateway_data4()
335 wil_err_fw(wil, "gateway4 record data size" fw_handle_gateway_data4()
337 sizeof(*block), size - sizeof(*d)); fw_handle_gateway_data4()
340 n = (size - sizeof(*d)) / sizeof(*block); fw_handle_gateway_data4()
386 int (*handler)(struct wil6210_priv *wil, const void *data, size_t size);
400 const void *data, size_t size) wil_fw_handle_record()
406 return wil_fw_handlers[i].handler(wil, data, size); wil_fw_handle_record()
421 static int wil_fw_load(struct wil6210_priv *wil, const void *data, size_t size) wil_fw_load() argument
427 for (hdr = data;; hdr = (const void *)hdr + s, size -= s) { wil_fw_load()
428 if (size < sizeof(*hdr)) wil_fw_load()
430 hdr_sz = le32_to_cpu(hdr->size); wil_fw_load()
432 if (s > size) wil_fw_load()
435 wil_err_fw(wil, "unaligned record size: %zu\n", wil_fw_load()
444 if (size) { wil_fw_load()
445 wil_err_fw(wil, "unprocessed bytes: %zu\n", size); wil_fw_load()
446 if (size >= sizeof(*hdr)) { wil_fw_load()
477 wil_dbg_fw(wil, "Loading <%s>, %zu bytes\n", name, fw->size); wil_request_firmware()
479 for (sz = fw->size, d = fw->data; sz; sz -= rc1, d += rc1) { wil_request_firmware()
121 fw_handle_comment(struct wil6210_priv *wil, const void *data, size_t size) fw_handle_comment() argument
129 fw_handle_data(struct wil6210_priv *wil, const void *data, size_t size) fw_handle_data() argument
150 fw_handle_fill(struct wil6210_priv *wil, const void *data, size_t size) fw_handle_fill() argument
184 fw_handle_file_header(struct wil6210_priv *wil, const void *data, size_t size) fw_handle_file_header() argument
202 fw_handle_direct_write(struct wil6210_priv *wil, const void *data, size_t size) fw_handle_direct_write() argument
258 fw_handle_gateway_data(struct wil6210_priv *wil, const void *data, size_t size) fw_handle_gateway_data() argument
317 fw_handle_gateway_data4(struct wil6210_priv *wil, const void *data, size_t size) fw_handle_gateway_data4() argument
399 wil_fw_handle_record(struct wil6210_priv *wil, int type, const void *data, size_t size) wil_fw_handle_record() argument
/linux-4.1.27/drivers/gpu/drm/armada/
H A Darmada_gem.c44 static size_t roundup_gem_size(size_t size) roundup_gem_size() argument
46 return roundup(size, PAGE_SIZE); roundup_gem_size()
60 unsigned int order = get_order(dobj->obj.size); armada_gem_free_object()
86 size_t size = obj->obj.size; armada_gem_linear_back() local
94 * Framebuffers will never be this small (our minimum size for armada_gem_linear_back()
99 if (size <= 8192) { armada_gem_linear_back()
100 unsigned int order = get_order(size); armada_gem_linear_back()
108 memset(obj->addr, 0, PAGE_ALIGN(size)); armada_gem_linear_back()
138 unsigned align = min_t(unsigned, size, SZ_2M); armada_gem_linear_back()
147 ret = drm_mm_insert_node(&priv->linear, node, size, align, armada_gem_linear_back()
158 ptr = ioremap_wc(obj->linear->start, size); armada_gem_linear_back()
168 memset_io(ptr, 0, size); armada_gem_linear_back()
187 dobj->addr = ioremap_wc(dobj->phys_addr, dobj->obj.size); armada_gem_map_object()
192 armada_gem_alloc_private_object(struct drm_device *dev, size_t size) armada_gem_alloc_private_object() argument
196 size = roundup_gem_size(size); armada_gem_alloc_private_object()
202 drm_gem_private_object_init(dev, &obj->obj, size); armada_gem_alloc_private_object()
205 DRM_DEBUG_DRIVER("alloc private obj %p size %zu\n", obj, size); armada_gem_alloc_private_object()
211 size_t size) armada_gem_alloc_object()
216 size = roundup_gem_size(size); armada_gem_alloc_object()
222 if (drm_gem_object_init(dev, &obj->obj, size)) { armada_gem_alloc_object()
232 DRM_DEBUG_DRIVER("alloc obj %p size %zu\n", obj, size); armada_gem_alloc_object()
243 size_t size; armada_gem_dumb_create() local
247 args->size = size = args->pitch * args->height; armada_gem_dumb_create()
249 dobj = armada_gem_alloc_private_object(dev, size); armada_gem_dumb_create()
264 DRM_DEBUG_DRIVER("obj %p size %zu handle %#x\n", dobj, size, handle); armada_gem_dumb_create()
315 size_t size; armada_gem_create_ioctl() local
319 if (args->size == 0) armada_gem_create_ioctl()
322 size = args->size; armada_gem_create_ioctl()
324 dobj = armada_gem_alloc_object(dev, size); armada_gem_create_ioctl()
335 DRM_DEBUG_DRIVER("obj %p size %zu handle %#x\n", dobj, size, handle); armada_gem_create_ioctl()
358 addr = vm_mmap(dobj->obj.filp, 0, args->size, PROT_READ | PROT_WRITE, armada_gem_mmap_ioctl()
377 DRM_DEBUG_DRIVER("handle %u off %u size %u ptr 0x%llx\n", armada_gem_pwrite_ioctl()
378 args->handle, args->offset, args->size, args->ptr); armada_gem_pwrite_ioctl()
380 if (args->size == 0) armada_gem_pwrite_ioctl()
385 if (!access_ok(VERIFY_READ, ptr, args->size)) armada_gem_pwrite_ioctl()
388 ret = fault_in_multipages_readable(ptr, args->size); armada_gem_pwrite_ioctl()
400 if (args->offset > dobj->obj.size || armada_gem_pwrite_ioctl()
401 args->size > dobj->obj.size - args->offset) { armada_gem_pwrite_ioctl()
402 DRM_ERROR("invalid size: object size %u\n", dobj->obj.size); armada_gem_pwrite_ioctl()
407 if (copy_from_user(dobj->addr + args->offset, ptr, args->size)) { armada_gem_pwrite_ioctl()
438 count = dobj->obj.size / PAGE_SIZE; armada_gem_prime_map_dma_buf()
465 sg_set_page(sgt->sgl, dobj->page, dobj->obj.size, 0); armada_gem_prime_map_dma_buf()
474 sg_dma_len(sgt->sgl) = dobj->obj.size; armada_gem_prime_map_dma_buf()
544 exp_info.size = obj->size; armada_gem_prime_export()
573 dobj = armada_gem_alloc_private_object(dev, buf->size); armada_gem_prime_import()
610 if (sg_dma_len(dobj->sgt->sgl) < dobj->obj.size) { armada_gem_map_import()
210 armada_gem_alloc_object(struct drm_device *dev, size_t size) armada_gem_alloc_object() argument
/linux-4.1.27/arch/powerpc/include/asm/
H A Duaccess.h50 #define __access_ok(addr, size, segment) \
51 (((addr) <= (segment).seg) && ((size) <= (segment).seg))
55 #define __access_ok(addr, size, segment) \
57 (((size) == 0) || (((size) - 1) <= ((segment).seg - (addr)))))
61 #define access_ok(type, addr, size) \
63 __access_ok((__force unsigned long)(addr), (size), get_fs()))
85 * use the right size if we just have the right pointer type.
164 #define __put_user_size(x, ptr, size, retval) \
167 switch (size) { \
176 #define __put_user_nocheck(x, ptr, size) \
183 __put_user_size((x), __pu_addr, (size), __pu_err); \
187 #define __put_user_check(x, ptr, size) \
192 if (access_ok(VERIFY_WRITE, __pu_addr, size)) \
193 __put_user_size((x), __pu_addr, (size), __pu_err); \
197 #define __put_user_nosleep(x, ptr, size) \
202 __put_user_size((x), __pu_addr, (size), __pu_err); \
249 #define __get_user_size(x, ptr, size, retval) \
253 if (size > sizeof(x)) \
255 switch (size) { \
264 #define __get_user_nocheck(x, ptr, size) \
272 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
278 #define __get_user64_nocheck(x, ptr, size) \
286 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
292 #define __get_user_check(x, ptr, size) \
298 if (access_ok(VERIFY_READ, __gu_addr, (size))) \
299 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
304 #define __get_user_nosleep(x, ptr, size) \
310 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
319 const void __user *from, unsigned long size);
355 #define __copy_in_user(to, from, size) \
356 __copy_tofrom_user((to), (from), (size))
420 const void __user *from, unsigned long size) __copy_from_user()
423 return __copy_from_user_inatomic(to, from, size); __copy_from_user()
427 const void *from, unsigned long size) __copy_to_user()
430 return __copy_to_user_inatomic(to, from, size); __copy_to_user()
433 extern unsigned long __clear_user(void __user *addr, unsigned long size);
435 static inline unsigned long clear_user(void __user *addr, unsigned long size) clear_user() argument
438 if (likely(access_ok(VERIFY_WRITE, addr, size))) clear_user()
439 return __clear_user(addr, size); clear_user()
441 unsigned long over = (unsigned long)addr + size - TASK_SIZE; clear_user()
442 return __clear_user(addr, size - over) + over; clear_user()
444 return size; clear_user()
419 __copy_from_user(void *to, const void __user *from, unsigned long size) __copy_from_user() argument
426 __copy_to_user(void __user *to, const void *from, unsigned long size) __copy_to_user() argument
/linux-4.1.27/drivers/gpu/drm/radeon/
H A Dradeon_acpi.h57 * ARG1: (ACPI_BUFFER) size of the buffer to fill (up to 4K).
74 * WORD - structure size in bytes (includes size field)
104 * WORD - structure size in bytes (includes size field)
110 * WORD - structure size in bytes (includes size field)
128 * WORD - structure size in bytes (includes size field)
164 * WORD - structure size in bytes (includes size field)
168 * WORD - structure size in bytes (includes size field)
187 * WORD - structure size in bytes (includes size field)
197 * WORD - structure size in bytes (includes size field)
212 * WORD - structure size in bytes (includes size field)
221 * WORD - structure size in bytes (includes size field)
227 * WORD - structure size in bytes (includes size field)
234 * WORD - structure size in bytes (includes size field)
244 * WORD - device structure size in bytes (excludes device size field)
260 * WORD - structure size in bytes (includes size field)
277 * WORD - structure size in bytes (includes size field)
297 * WORD - structure size in bytes (includes size field)
304 * WORD - structure size in bytes (includes size field)
313 * WORD - structure size in bytes (includes size field)
320 * WORD - structure size in bytes (includes size field)
327 * WORD - structure size in bytes (includes size field)
336 * WORD - connector structure size in bytes (excludes connector size field)
351 * WORD - port structure size in bytes (excludes port size field)
382 * WORD - structure size in bytes (includes size field)
395 * WORD - structure size in bytes (includes size field)
404 * WORD - structure size in bytes (includes size field)
411 * WORD - structure size in bytes (includes size field)
437 * WORD - structure size in bytes (includes size field)
441 * WORD - structure size in bytes (includes size field)
H A Duvd_v4_2.c41 uint32_t size; uvd_v4_2_resume() local
45 size = RADEON_GPU_PAGE_ALIGN(rdev->uvd_fw->size + 4) >> 3; uvd_v4_2_resume()
47 WREG32(UVD_VCPU_CACHE_SIZE0, size); uvd_v4_2_resume()
49 addr += size; uvd_v4_2_resume()
50 size = RADEON_UVD_STACK_SIZE >> 3; uvd_v4_2_resume()
52 WREG32(UVD_VCPU_CACHE_SIZE1, size); uvd_v4_2_resume()
54 addr += size; uvd_v4_2_resume()
55 size = RADEON_UVD_HEAP_SIZE >> 3; uvd_v4_2_resume()
57 WREG32(UVD_VCPU_CACHE_SIZE2, size); uvd_v4_2_resume()
/linux-4.1.27/arch/arm/mm/
H A Ddma-mapping.c66 * @size: size of buffer to map
76 unsigned long offset, size_t size, enum dma_data_direction dir, arm_dma_map_page()
80 __dma_page_cpu_to_dev(page, offset, size, dir); arm_dma_map_page()
85 unsigned long offset, size_t size, enum dma_data_direction dir, arm_coherent_dma_map_page()
95 * @size: size of buffer (same as passed to dma_map_page)
98 * Unmap a page streaming mode DMA translation. The handle and size
106 size_t size, enum dma_data_direction dir, arm_dma_unmap_page()
111 handle & ~PAGE_MASK, size, dir); arm_dma_unmap_page() local
115 dma_addr_t handle, size_t size, enum dma_data_direction dir) arm_dma_sync_single_for_cpu()
119 __dma_page_dev_to_cpu(page, offset, size, dir); arm_dma_sync_single_for_cpu()
123 dma_addr_t handle, size_t size, enum dma_data_direction dir) arm_dma_sync_single_for_device()
127 __dma_page_cpu_to_dev(page, offset, size, dir); arm_dma_sync_single_for_device()
147 static void *arm_coherent_dma_alloc(struct device *dev, size_t size,
149 static void arm_coherent_dma_free(struct device *dev, size_t size, void *cpu_addr,
224 static void __dma_clear_buffer(struct page *page, size_t size) __dma_clear_buffer() argument
232 phys_addr_t end = base + size; __dma_clear_buffer()
233 while (size > 0) { __dma_clear_buffer()
239 size -= PAGE_SIZE; __dma_clear_buffer()
244 memset(ptr, 0, size); __dma_clear_buffer()
245 dmac_flush_range(ptr, ptr + size); __dma_clear_buffer()
246 outer_flush_range(__pa(ptr), __pa(ptr) + size); __dma_clear_buffer()
251 * Allocate a DMA buffer for 'dev' of size 'size' using the
252 * specified gfp mask. Note that 'size' must be page aligned.
254 static struct page *__dma_alloc_buffer(struct device *dev, size_t size, gfp_t gfp) __dma_alloc_buffer() argument
256 unsigned long order = get_order(size); __dma_alloc_buffer()
267 for (p = page + (size >> PAGE_SHIFT), e = page + (1 << order); p < e; p++) __dma_alloc_buffer()
270 __dma_clear_buffer(page, size); __dma_alloc_buffer()
276 * Free a DMA buffer. 'size' must be page aligned.
278 static void __dma_free_buffer(struct page *page, size_t size) __dma_free_buffer() argument
280 struct page *e = page + (size >> PAGE_SHIFT); __dma_free_buffer()
290 static void *__alloc_from_contiguous(struct device *dev, size_t size,
294 static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp,
299 __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot, __dma_alloc_remap() argument
306 return dma_common_contiguous_remap(page, size, __dma_alloc_remap()
311 static void __dma_free_remap(void *cpu_addr, size_t size) __dma_free_remap() argument
313 dma_common_free_remap(cpu_addr, size, __dma_free_remap()
329 void __init init_dma_coherent_pool_size(unsigned long size) init_dma_coherent_pool_size() argument
332 * Catch any attempt to set the pool size too late. init_dma_coherent_pool_size()
337 * Set architecture specific coherent pool size only if init_dma_coherent_pool_size()
341 atomic_pool_size = size; init_dma_coherent_pool_size()
396 unsigned long size; member in struct:dma_contig_early_reserve
403 void __init dma_contiguous_early_fixup(phys_addr_t base, unsigned long size) dma_contiguous_early_fixup() argument
406 dma_mmu_remap[dma_mmu_remap_num].size = size; dma_contiguous_early_fixup()
415 phys_addr_t end = start + dma_mmu_remap[i].size; dma_contiguous_remap()
459 static void __dma_remap(struct page *page, size_t size, pgprot_t prot) __dma_remap() argument
462 unsigned end = start + size; __dma_remap()
464 apply_to_page_range(&init_mm, start, size, __dma_update_pte, &prot); __dma_remap()
468 static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp, __alloc_remap_buffer() argument
474 page = __dma_alloc_buffer(dev, size, gfp); __alloc_remap_buffer()
480 ptr = __dma_alloc_remap(page, size, gfp, prot, caller); __alloc_remap_buffer()
482 __dma_free_buffer(page, size); __alloc_remap_buffer()
491 static void *__alloc_from_pool(size_t size, struct page **ret_page) __alloc_from_pool() argument
501 val = gen_pool_alloc(atomic_pool, size); __alloc_from_pool()
512 static bool __in_atomic_pool(void *start, size_t size) __in_atomic_pool() argument
514 return addr_in_gen_pool(atomic_pool, (unsigned long)start, size); __in_atomic_pool()
517 static int __free_from_pool(void *start, size_t size) __free_from_pool() argument
519 if (!__in_atomic_pool(start, size)) __free_from_pool()
522 gen_pool_free(atomic_pool, (unsigned long)start, size); __free_from_pool()
527 static void *__alloc_from_contiguous(struct device *dev, size_t size, __alloc_from_contiguous() argument
531 unsigned long order = get_order(size); __alloc_from_contiguous()
532 size_t count = size >> PAGE_SHIFT; __alloc_from_contiguous()
540 __dma_clear_buffer(page, size); __alloc_from_contiguous()
546 ptr = __dma_alloc_remap(page, size, GFP_KERNEL, prot, caller); __alloc_from_contiguous()
552 __dma_remap(page, size, prot); __alloc_from_contiguous()
562 void *cpu_addr, size_t size, bool want_vaddr) __free_from_contiguous()
566 __dma_free_remap(cpu_addr, size); __free_from_contiguous()
568 __dma_remap(page, size, PAGE_KERNEL); __free_from_contiguous()
570 dma_release_from_contiguous(dev, page, size >> PAGE_SHIFT); __free_from_contiguous()
588 #define __alloc_remap_buffer(dev, size, gfp, prot, ret, c, wv) NULL
589 #define __alloc_from_pool(size, ret_page) NULL
590 #define __alloc_from_contiguous(dev, size, prot, ret, c, wv) NULL
591 #define __free_from_pool(cpu_addr, size) 0
592 #define __free_from_contiguous(dev, page, cpu_addr, size, wv) do { } while (0)
593 #define __dma_free_remap(cpu_addr, size) do { } while (0)
597 static void *__alloc_simple_buffer(struct device *dev, size_t size, gfp_t gfp, __alloc_simple_buffer() argument
601 page = __dma_alloc_buffer(dev, size, gfp); __alloc_simple_buffer()
611 static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, __dma_alloc() argument
622 if (limit && size >= limit) { __dma_alloc()
624 size, mask); __dma_alloc()
645 size = PAGE_ALIGN(size); __dma_alloc()
649 addr = __alloc_simple_buffer(dev, size, gfp, &page); __dma_alloc()
651 addr = __alloc_from_pool(size, &page); __dma_alloc()
653 addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller, want_vaddr); __dma_alloc()
655 addr = __alloc_from_contiguous(dev, size, prot, &page, caller, want_vaddr); __dma_alloc()
667 void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, arm_dma_alloc() argument
673 if (dma_alloc_from_coherent(dev, size, handle, &memory)) arm_dma_alloc()
676 return __dma_alloc(dev, size, handle, gfp, prot, false, arm_dma_alloc()
680 static void *arm_coherent_dma_alloc(struct device *dev, size_t size, arm_coherent_dma_alloc() argument
686 if (dma_alloc_from_coherent(dev, size, handle, &memory)) arm_coherent_dma_alloc()
689 return __dma_alloc(dev, size, handle, gfp, prot, true, arm_coherent_dma_alloc()
697 void *cpu_addr, dma_addr_t dma_addr, size_t size, arm_dma_mmap()
703 unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; arm_dma_mmap()
709 if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret)) arm_dma_mmap()
726 static void __arm_dma_free(struct device *dev, size_t size, void *cpu_addr, __arm_dma_free() argument
733 if (dma_release_from_coherent(dev, get_order(size), cpu_addr)) __arm_dma_free()
736 size = PAGE_ALIGN(size); __arm_dma_free()
739 __dma_free_buffer(page, size); __arm_dma_free()
740 } else if (__free_from_pool(cpu_addr, size)) { __arm_dma_free()
744 __dma_free_remap(cpu_addr, size); __arm_dma_free()
745 __dma_free_buffer(page, size); __arm_dma_free()
751 __free_from_contiguous(dev, page, cpu_addr, size, want_vaddr); __arm_dma_free()
755 void arm_dma_free(struct device *dev, size_t size, void *cpu_addr, arm_dma_free() argument
758 __arm_dma_free(dev, size, cpu_addr, handle, attrs, false); arm_dma_free()
761 static void arm_coherent_dma_free(struct device *dev, size_t size, void *cpu_addr, arm_coherent_dma_free() argument
764 __arm_dma_free(dev, size, cpu_addr, handle, attrs, true); arm_coherent_dma_free()
768 void *cpu_addr, dma_addr_t handle, size_t size, arm_dma_get_sgtable()
778 sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0); arm_dma_get_sgtable()
783 size_t size, enum dma_data_direction dir, dma_cache_maint_page()
787 size_t left = size; dma_cache_maint_page()
836 size_t size, enum dma_data_direction dir) __dma_page_cpu_to_dev()
840 dma_cache_maint_page(page, off, size, dir, dmac_map_area); __dma_page_cpu_to_dev()
844 outer_inv_range(paddr, paddr + size); __dma_page_cpu_to_dev()
846 outer_clean_range(paddr, paddr + size); __dma_page_cpu_to_dev()
852 size_t size, enum dma_data_direction dir) __dma_page_dev_to_cpu()
859 outer_inv_range(paddr, paddr + size); __dma_page_dev_to_cpu()
861 dma_cache_maint_page(page, off, size, dir, dmac_unmap_area); __dma_page_dev_to_cpu()
867 if (dir != DMA_TO_DEVICE && size >= PAGE_SIZE) { __dma_page_dev_to_cpu()
869 size_t left = size; __dma_page_dev_to_cpu()
1023 size_t size) __alloc_iova()
1025 unsigned int order = get_order(size); __alloc_iova()
1036 count = PAGE_ALIGN(size) >> PAGE_SHIFT; __alloc_iova()
1054 * address range of size bytes. __alloc_iova()
1081 dma_addr_t addr, size_t size) __free_iova()
1089 if (!size) __free_iova()
1099 if (addr + size > bitmap_base + mapping_size) { __free_iova()
1108 count = size >> PAGE_SHIFT; __free_iova()
1115 static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, __iommu_alloc_buffer() argument
1119 int count = size >> PAGE_SHIFT; __iommu_alloc_buffer()
1132 unsigned long order = get_order(size); __iommu_alloc_buffer()
1139 __dma_clear_buffer(page, size); __iommu_alloc_buffer()
1201 size_t size, struct dma_attrs *attrs) __iommu_free_buffer()
1203 int count = size >> PAGE_SHIFT; __iommu_free_buffer()
1226 __iommu_alloc_remap(struct page **pages, size_t size, gfp_t gfp, pgprot_t prot, __iommu_alloc_remap() argument
1229 return dma_common_pages_remap(pages, size, __iommu_alloc_remap()
1237 __iommu_create_mapping(struct device *dev, struct page **pages, size_t size) __iommu_create_mapping() argument
1240 unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT; __iommu_create_mapping()
1244 dma_addr = __alloc_iova(mapping, size); __iommu_create_mapping()
1269 __free_iova(mapping, dma_addr, size); __iommu_create_mapping()
1273 static int __iommu_remove_mapping(struct device *dev, dma_addr_t iova, size_t size) __iommu_remove_mapping() argument
1278 * add optional in-page offset from iova to size and align __iommu_remove_mapping()
1279 * result to page size __iommu_remove_mapping()
1281 size = PAGE_ALIGN((iova & ~PAGE_MASK) + size); __iommu_remove_mapping()
1284 iommu_unmap(mapping->domain, iova, size); __iommu_remove_mapping()
1285 __free_iova(mapping, iova, size); __iommu_remove_mapping()
1316 static void *__iommu_alloc_atomic(struct device *dev, size_t size, __iommu_alloc_atomic() argument
1322 addr = __alloc_from_pool(size, &page); __iommu_alloc_atomic()
1326 *handle = __iommu_create_mapping(dev, &page, size); __iommu_alloc_atomic()
1333 __free_from_pool(addr, size); __iommu_alloc_atomic()
1338 dma_addr_t handle, size_t size) __iommu_free_atomic()
1340 __iommu_remove_mapping(dev, handle, size); __iommu_free_atomic()
1341 __free_from_pool(cpu_addr, size); __iommu_free_atomic()
1344 static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, arm_iommu_alloc_attrs() argument
1352 size = PAGE_ALIGN(size); arm_iommu_alloc_attrs()
1355 return __iommu_alloc_atomic(dev, size, handle); arm_iommu_alloc_attrs()
1366 pages = __iommu_alloc_buffer(dev, size, gfp, attrs); arm_iommu_alloc_attrs()
1370 *handle = __iommu_create_mapping(dev, pages, size); arm_iommu_alloc_attrs()
1377 addr = __iommu_alloc_remap(pages, size, gfp, prot, arm_iommu_alloc_attrs()
1385 __iommu_remove_mapping(dev, *handle, size); arm_iommu_alloc_attrs()
1387 __iommu_free_buffer(dev, pages, size, attrs); arm_iommu_alloc_attrs()
1392 void *cpu_addr, dma_addr_t dma_addr, size_t size, arm_iommu_mmap_attrs()
1398 unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; arm_iommu_mmap_attrs()
1428 void arm_iommu_free_attrs(struct device *dev, size_t size, void *cpu_addr, arm_iommu_free_attrs() argument
1432 size = PAGE_ALIGN(size); arm_iommu_free_attrs()
1434 if (__in_atomic_pool(cpu_addr, size)) { arm_iommu_free_attrs()
1435 __iommu_free_atomic(dev, cpu_addr, handle, size); arm_iommu_free_attrs()
1446 dma_common_free_remap(cpu_addr, size, arm_iommu_free_attrs()
1450 __iommu_remove_mapping(dev, handle, size); arm_iommu_free_attrs()
1451 __iommu_free_buffer(dev, pages, size, attrs); arm_iommu_free_attrs()
1456 size_t size, struct dma_attrs *attrs) arm_iommu_get_sgtable()
1458 unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT; arm_iommu_get_sgtable()
1464 return sg_alloc_table_from_pages(sgt, pages, count, 0, size, arm_iommu_get_sgtable()
1493 size_t size, dma_addr_t *handle, __map_sg_chunk()
1504 size = PAGE_ALIGN(size); __map_sg_chunk()
1507 iova_base = iova = __alloc_iova(mapping, size); __map_sg_chunk()
1511 for (count = 0, s = sg; count < (size >> PAGE_SHIFT); s = sg_next(s)) { __map_sg_chunk()
1532 __free_iova(mapping, iova_base, size); __map_sg_chunk()
1543 unsigned int size = s->offset + s->length; __iommu_map_sg() local
1552 if (s->offset || (size & ~PAGE_MASK) || size + s->length > max) { __iommu_map_sg()
1553 if (__map_sg_chunk(dev, start, size, &dma->dma_address, __iommu_map_sg()
1558 dma->dma_length = size - offset; __iommu_map_sg()
1560 size = offset = s->offset; __iommu_map_sg()
1565 size += s->length; __iommu_map_sg()
1567 if (__map_sg_chunk(dev, start, size, &dma->dma_address, dir, attrs, __iommu_map_sg()
1572 dma->dma_length = size - offset; __iommu_map_sg()
1709 * @size: size of buffer to map
1715 unsigned long offset, size_t size, enum dma_data_direction dir, arm_coherent_iommu_map_page()
1720 int ret, prot, len = PAGE_ALIGN(size + offset); arm_coherent_iommu_map_page()
1743 * @size: size of buffer to map
1749 unsigned long offset, size_t size, enum dma_data_direction dir, arm_iommu_map_page()
1753 __dma_page_cpu_to_dev(page, offset, size, dir); arm_iommu_map_page()
1755 return arm_coherent_iommu_map_page(dev, page, offset, size, dir, attrs); arm_iommu_map_page()
1762 * @size: size of buffer (same as passed to dma_map_page)
1768 size_t size, enum dma_data_direction dir, arm_coherent_iommu_unmap_page()
1774 int len = PAGE_ALIGN(size + offset); arm_coherent_iommu_unmap_page()
1787 * @size: size of buffer (same as passed to dma_map_page)
1793 size_t size, enum dma_data_direction dir, arm_iommu_unmap_page()
1800 int len = PAGE_ALIGN(size + offset); arm_iommu_unmap_page()
1806 __dma_page_dev_to_cpu(page, offset, size, dir); arm_iommu_unmap_page()
1813 dma_addr_t handle, size_t size, enum dma_data_direction dir) arm_iommu_sync_single_for_cpu()
1823 __dma_page_dev_to_cpu(page, offset, size, dir); arm_iommu_sync_single_for_cpu()
1827 dma_addr_t handle, size_t size, enum dma_data_direction dir) arm_iommu_sync_single_for_device()
1837 __dma_page_cpu_to_dev(page, offset, size, dir); arm_iommu_sync_single_for_device()
1878 * @size: maximum size of the valid IO address space
1888 arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, u64 size) arm_iommu_create_mapping() argument
1890 unsigned int bits = size >> PAGE_SHIFT; arm_iommu_create_mapping()
1897 if (size > DMA_BIT_MASK(32) + 1) arm_iommu_create_mapping()
2063 static bool arm_setup_iommu_dma_ops(struct device *dev, u64 dma_base, u64 size, arm_setup_iommu_dma_ops() argument
2071 mapping = arm_iommu_create_mapping(dev->bus, dma_base, size); arm_setup_iommu_dma_ops()
2074 size, dev_name(dev)); arm_setup_iommu_dma_ops()
2101 static bool arm_setup_iommu_dma_ops(struct device *dev, u64 dma_base, u64 size, arm_setup_iommu_dma_ops() argument
2118 void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, arch_setup_dma_ops() argument
2124 if (arm_setup_iommu_dma_ops(dev, dma_base, size, iommu)) arch_setup_dma_ops()
75 arm_dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) arm_dma_map_page() argument
84 arm_coherent_dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) arm_coherent_dma_map_page() argument
105 arm_dma_unmap_page(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) arm_dma_unmap_page() argument
114 arm_dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) arm_dma_sync_single_for_cpu() argument
122 arm_dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) arm_dma_sync_single_for_device() argument
561 __free_from_contiguous(struct device *dev, struct page *page, void *cpu_addr, size_t size, bool want_vaddr) __free_from_contiguous() argument
696 arm_dma_mmap(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs) arm_dma_mmap() argument
767 arm_dma_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr, dma_addr_t handle, size_t size, struct dma_attrs *attrs) arm_dma_get_sgtable() argument
782 dma_cache_maint_page(struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, void (*op)(const void *, size_t, int)) dma_cache_maint_page() argument
835 __dma_page_cpu_to_dev(struct page *page, unsigned long off, size_t size, enum dma_data_direction dir) __dma_page_cpu_to_dev() argument
851 __dma_page_dev_to_cpu(struct page *page, unsigned long off, size_t size, enum dma_data_direction dir) __dma_page_dev_to_cpu() argument
1022 __alloc_iova(struct dma_iommu_mapping *mapping, size_t size) __alloc_iova() argument
1080 __free_iova(struct dma_iommu_mapping *mapping, dma_addr_t addr, size_t size) __free_iova() argument
1200 __iommu_free_buffer(struct device *dev, struct page **pages, size_t size, struct dma_attrs *attrs) __iommu_free_buffer() argument
1337 __iommu_free_atomic(struct device *dev, void *cpu_addr, dma_addr_t handle, size_t size) __iommu_free_atomic() argument
1391 arm_iommu_mmap_attrs(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs) arm_iommu_mmap_attrs() argument
1454 arm_iommu_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr, dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs) arm_iommu_get_sgtable() argument
1492 __map_sg_chunk(struct device *dev, struct scatterlist *sg, size_t size, dma_addr_t *handle, enum dma_data_direction dir, struct dma_attrs *attrs, bool is_coherent) __map_sg_chunk() argument
1714 arm_coherent_iommu_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) arm_coherent_iommu_map_page() argument
1748 arm_iommu_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) arm_iommu_map_page() argument
1767 arm_coherent_iommu_unmap_page(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) arm_coherent_iommu_unmap_page() argument
1792 arm_iommu_unmap_page(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) arm_iommu_unmap_page() argument
1812 arm_iommu_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) arm_iommu_sync_single_for_cpu() argument
1826 arm_iommu_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) arm_iommu_sync_single_for_device() argument
/linux-4.1.27/drivers/media/pci/ttpci/
H A Dav7110_ipack.h4 extern int av7110_ipack_init(struct ipack *p, int size,
5 void (*func)(u8 *buf, int size, void *priv));
/linux-4.1.27/arch/um/include/shared/
H A Dum_malloc.h11 extern void *uml_kmalloc(int size, int flags);
14 extern void *vmalloc(unsigned long size);
/linux-4.1.27/arch/x86/include/asm/
H A Dedac.h6 static inline void atomic_scrub(void *va, u32 size) atomic_scrub() argument
14 for (i = 0; i < size / 4; i++, virt_addr++) atomic_scrub()
/linux-4.1.27/drivers/gpu/drm/msm/
H A Dmsm_ringbuffer.c21 struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int size) msm_ringbuffer_new() argument
26 size = ALIGN(size, 4); /* size should be dword aligned */ msm_ringbuffer_new()
35 ring->bo = msm_gem_new(gpu->dev, size, MSM_BO_WC); msm_ringbuffer_new()
43 ring->end = ring->start + (size / 4); msm_ringbuffer_new()
46 ring->size = size; msm_ringbuffer_new()
/linux-4.1.27/arch/mips/ar7/
H A Dmemory.c36 u32 size = (64 << 20); memsize() local
37 u32 *addr = (u32 *)KSEG1ADDR(AR7_SDRAM_BASE + size - 4); memsize()
43 size >>= 1; memsize()
44 tmpaddr -= size >> 2; memsize()
48 tmpaddr += size >> 2; memsize()
51 size <<= 1; memsize()
52 } while (size < (64 << 20)); memsize()
56 return size; memsize()
/linux-4.1.27/arch/hexagon/mm/
H A Dioremap.c25 void __iomem *ioremap_nocache(unsigned long phys_addr, unsigned long size) ioremap_nocache() argument
34 last_addr = phys_addr + size - 1; ioremap_nocache()
37 if (!size || (last_addr < phys_addr)) ioremap_nocache()
40 /* Rounds up to next page size, including whole-page offset */ ioremap_nocache()
41 size = PAGE_ALIGN(offset + size); ioremap_nocache()
43 area = get_vm_area(size, VM_IOREMAP); ioremap_nocache()
46 if (ioremap_page_range(addr, addr+size, phys_addr, prot)) { ioremap_nocache()
/linux-4.1.27/tools/include/linux/
H A Dbitops.h35 #define for_each_set_bit(bit, addr, size) \
36 for ((bit) = find_first_bit((addr), (size)); \
37 (bit) < (size); \
38 (bit) = find_next_bit((addr), (size), (bit) + 1))
41 #define for_each_set_bit_from(bit, addr, size) \
42 for ((bit) = find_next_bit((addr), (size), (bit)); \
43 (bit) < (size); \
44 (bit) = find_next_bit((addr), (size), (bit) + 1))
/linux-4.1.27/tools/lib/api/fs/
H A Ddebugfs.h20 int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename);
21 int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name);
/linux-4.1.27/Documentation/video4linux/
H A Dextract_xc3028.pl51 # Calc chunk size
131 my $size = ord(substr($out,$i,1))*256+ord(substr($out,$i+1,1));
135 if ($size>0 && $size <0x8000) {
136 for (my $j=0;$j<$size;$j++) {
139 $i+=$size;
163 # Firmware 0, type: BASE FW F8MHZ (0x00000003), id: (0000000000000000), size: 6635
172 # Firmware 1, type: BASE FW F8MHZ MTS (0x00000007), id: (0000000000000000), size: 6635
181 # Firmware 2, type: BASE FW FM (0x00000401), id: (0000000000000000), size: 6525
190 # Firmware 3, type: BASE FW FM INPUT1 (0x00000c01), id: (0000000000000000), size: 6539
199 # Firmware 4, type: BASE FW (0x00000001), id: (0000000000000000), size: 6633
208 # Firmware 5, type: BASE FW MTS (0x00000005), id: (0000000000000000), size: 6617
217 # Firmware 6, type: STD FW (0x00000000), id: PAL/BG A2/A (0000000100000007), size: 161
226 # Firmware 7, type: STD FW MTS (0x00000004), id: PAL/BG A2/A (0000000100000007), size: 169
235 # Firmware 8, type: STD FW (0x00000000), id: PAL/BG A2/B (0000000200000007), size: 161
244 # Firmware 9, type: STD FW MTS (0x00000004), id: PAL/BG A2/B (0000000200000007), size: 169
253 # Firmware 10, type: STD FW (0x00000000), id: PAL/BG NICAM/A (0000000400000007), size: 161
262 # Firmware 11, type: STD FW MTS (0x00000004), id: PAL/BG NICAM/A (0000000400000007), size: 169
271 # Firmware 12, type: STD FW (0x00000000), id: PAL/BG NICAM/B (0000000800000007), size: 161
280 # Firmware 13, type: STD FW MTS (0x00000004), id: PAL/BG NICAM/B (0000000800000007), size: 169
289 # Firmware 14, type: STD FW (0x00000000), id: PAL/DK A2 (00000003000000e0), size: 161
298 # Firmware 15, type: STD FW MTS (0x00000004), id: PAL/DK A2 (00000003000000e0), size: 169
307 # Firmware 16, type: STD FW (0x00000000), id: PAL/DK NICAM (0000000c000000e0), size: 161
316 # Firmware 17, type: STD FW MTS (0x00000004), id: PAL/DK NICAM (0000000c000000e0), size: 169
325 # Firmware 18, type: STD FW (0x00000000), id: SECAM/K1 (0000000000200000), size: 161
334 # Firmware 19, type: STD FW MTS (0x00000004), id: SECAM/K1 (0000000000200000), size: 169
343 # Firmware 20, type: STD FW (0x00000000), id: SECAM/K3 (0000000004000000), size: 161
352 # Firmware 21, type: STD FW MTS (0x00000004), id: SECAM/K3 (0000000004000000), size: 169
361 # Firmware 22, type: STD FW D2633 DTV6 ATSC (0x00010030), id: (0000000000000000), size: 149
370 # Firmware 23, type: STD FW D2620 DTV6 QAM (0x00000068), id: (0000000000000000), size: 149
379 # Firmware 24, type: STD FW D2633 DTV6 QAM (0x00000070), id: (0000000000000000), size: 149
388 # Firmware 25, type: STD FW D2620 DTV7 (0x00000088), id: (0000000000000000), size: 149
397 # Firmware 26, type: STD FW D2633 DTV7 (0x00000090), id: (0000000000000000), size: 149
406 # Firmware 27, type: STD FW D2620 DTV78 (0x00000108), id: (0000000000000000), size: 149
415 # Firmware 28, type: STD FW D2633 DTV78 (0x00000110), id: (0000000000000000), size: 149
424 # Firmware 29, type: STD FW D2620 DTV8 (0x00000208), id: (0000000000000000), size: 149
433 # Firmware 30, type: STD FW D2633 DTV8 (0x00000210), id: (0000000000000000), size: 149
442 # Firmware 31, type: STD FW FM (0x00000400), id: (0000000000000000), size: 135
451 # Firmware 32, type: STD FW (0x00000000), id: PAL/I (0000000000000010), size: 161
460 # Firmware 33, type: STD FW MTS (0x00000004), id: PAL/I (0000000000000010), size: 169
469 # Firmware 34, type: STD FW (0x00000000), id: SECAM/L AM (0000001000400000), size: 169
473 # Firmware 35, type: STD FW (0x00000000), id: SECAM/L NICAM (0000000c00400000), size: 161
482 # Firmware 36, type: STD FW (0x00000000), id: SECAM/Lc (0000000000800000), size: 161
491 # Firmware 37, type: STD FW (0x00000000), id: NTSC/M Kr (0000000000008000), size: 161
500 # Firmware 38, type: STD FW LCD (0x00001000), id: NTSC/M Kr (0000000000008000), size: 161
509 # Firmware 39, type: STD FW LCD NOGD (0x00003000), id: NTSC/M Kr (0000000000008000), size: 161
518 # Firmware 40, type: STD FW MTS (0x00000004), id: NTSC/M Kr (0000000000008000), size: 169
527 # Firmware 41, type: STD FW (0x00000000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
536 # Firmware 42, type: STD FW LCD (0x00001000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
545 # Firmware 43, type: STD FW LCD NOGD (0x00003000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
554 # Firmware 44, type: STD FW (0x00000000), id: NTSC/M Jp (0000000000002000), size: 161
563 # Firmware 45, type: STD FW MTS (0x00000004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
572 # Firmware 46, type: STD FW MTS LCD (0x00001004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
581 # Firmware 47, type: STD FW MTS LCD NOGD (0x00003004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
590 # Firmware 48, type: SCODE FW HAS IF (0x60000000), IF = 3.28 MHz id: (0000000000000000), size: 192
600 # Firmware 49, type: SCODE FW HAS IF (0x60000000), IF = 3.30 MHz id: (0000000000000000), size: 192
610 # Firmware 50, type: SCODE FW HAS IF (0x60000000), IF = 3.44 MHz id: (0000000000000000), size: 192
620 # Firmware 51, type: SCODE FW HAS IF (0x60000000), IF = 3.46 MHz id: (0000000000000000), size: 192
630 # Firmware 52, type: SCODE FW DTV6 ATSC OREN36 HAS IF (0x60210020), IF = 3.80 MHz id: (0000000000000000), size: 192
640 # Firmware 53, type: SCODE FW HAS IF (0x60000000), IF = 4.00 MHz id: (0000000000000000), size: 192
650 # Firmware 54, type: SCODE FW DTV6 ATSC TOYOTA388 HAS IF (0x60410020), IF = 4.08 MHz id: (0000000000000000), size: 192
660 # Firmware 55, type: SCODE FW HAS IF (0x60000000), IF = 4.20 MHz id: (0000000000000000), size: 192
670 # Firmware 56, type: SCODE FW MONO HAS IF (0x60008000), IF = 4.32 MHz id: NTSC/M Kr (0000000000008000), size: 192
680 # Firmware 57, type: SCODE FW HAS IF (0x60000000), IF = 4.45 MHz id: (0000000000000000), size: 192
690 # Firmware 58, type: SCODE FW MTS LCD NOGD MONO IF HAS IF (0x6002b004), IF = 4.50 MHz id: NTSC PAL/M PAL/N (000000000000b700), size: 192
700 # Firmware 59, type: SCODE FW LCD NOGD IF HAS IF (0x60023000), IF = 4.60 MHz id: NTSC/M Kr (0000000000008000), size: 192
710 # Firmware 60, type: SCODE FW DTV6 QAM DTV7 DTV78 DTV8 ZARLINK456 HAS IF (0x620003e0), IF = 4.76 MHz id: (0000000000000000), size: 192
720 # Firmware 61, type: SCODE FW HAS IF (0x60000000), IF = 4.94 MHz id: (0000000000000000), size: 192
730 # Firmware 62, type: SCODE FW HAS IF (0x60000000), IF = 5.26 MHz id: (0000000000000000), size: 192
740 # Firmware 63, type: SCODE FW MONO HAS IF (0x60008000), IF = 5.32 MHz id: PAL/BG A2 NICAM (0000000f00000007), size: 192
750 # Firmware 64, type: SCODE FW DTV7 DTV78 DTV8 DIBCOM52 CHINA HAS IF (0x65000380), IF = 5.40 MHz id: (0000000000000000), size: 192
760 # Firmware 65, type: SCODE FW DTV6 ATSC OREN538 HAS IF (0x60110020), IF = 5.58 MHz id: (0000000000000000), size: 192
770 # Firmware 66, type: SCODE FW HAS IF (0x60000000), IF = 5.64 MHz id: PAL/BG A2 (0000000300000007), size: 192
780 # Firmware 67, type: SCODE FW HAS IF (0x60000000), IF = 5.74 MHz id: PAL/BG NICAM (0000000c00000007), size: 192
790 # Firmware 68, type: SCODE FW HAS IF (0x60000000), IF = 5.90 MHz id: (0000000000000000), size: 192
800 # Firmware 69, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.00 MHz id: PAL/DK PAL/I SECAM/K3 SECAM/L SECAM/Lc NICAM (0000000c04c000f0), size: 192
810 # Firmware 70, type: SCODE FW DTV6 QAM ATSC LG60 F6MHZ HAS IF (0x68050060), IF = 6.20 MHz id: (0000000000000000), size: 192
820 # Firmware 71, type: SCODE FW HAS IF (0x60000000), IF = 6.24 MHz id: PAL/I (0000000000000010), size: 192
830 # Firmware 72, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.32 MHz id: SECAM/K1 (0000000000200000), size: 192
840 # Firmware 73, type: SCODE FW HAS IF (0x60000000), IF = 6.34 MHz id: SECAM/K1 (0000000000200000), size: 192
850 # Firmware 74, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.50 MHz id: PAL/DK SECAM/K3 SECAM/L NICAM (0000000c044000e0), size: 192
860 # Firmware 75, type: SCODE FW DTV6 ATSC ATI638 HAS IF (0x60090020), IF = 6.58 MHz id: (0000000000000000), size: 192
870 # Firmware 76, type: SCODE FW HAS IF (0x60000000), IF = 6.60 MHz id: PAL/DK A2 (00000003000000e0), size: 192
880 # Firmware 77, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.68 MHz id: PAL/DK A2 (00000003000000e0), size: 192
890 # Firmware 78, type: SCODE FW DTV6 ATSC TOYOTA794 HAS IF (0x60810020), IF = 8.14 MHz id: (0000000000000000), size: 192
900 # Firmware 79, type: SCODE FW HAS IF (0x60000000), IF = 8.20 MHz id: (0000000000000000), size: 192
929 # Firmware 0, type: BASE FW F8MHZ (0x00000003), id: (0000000000000000), size: 8718
938 # Firmware 1, type: BASE FW F8MHZ MTS (0x00000007), id: (0000000000000000), size: 8712
947 # Firmware 2, type: BASE FW FM (0x00000401), id: (0000000000000000), size: 8562
956 # Firmware 3, type: BASE FW FM INPUT1 (0x00000c01), id: (0000000000000000), size: 8576
965 # Firmware 4, type: BASE FW (0x00000001), id: (0000000000000000), size: 8706
974 # Firmware 5, type: BASE FW MTS (0x00000005), id: (0000000000000000), size: 8682
983 # Firmware 6, type: STD FW (0x00000000), id: PAL/BG A2/A (0000000100000007), size: 161
992 # Firmware 7, type: STD FW MTS (0x00000004), id: PAL/BG A2/A (0000000100000007), size: 169
1001 # Firmware 8, type: STD FW (0x00000000), id: PAL/BG A2/B (0000000200000007), size: 161
1010 # Firmware 9, type: STD FW MTS (0x00000004), id: PAL/BG A2/B (0000000200000007), size: 169
1019 # Firmware 10, type: STD FW (0x00000000), id: PAL/BG NICAM/A (0000000400000007), size: 161
1028 # Firmware 11, type: STD FW MTS (0x00000004), id: PAL/BG NICAM/A (0000000400000007), size: 169
1037 # Firmware 12, type: STD FW (0x00000000), id: PAL/BG NICAM/B (0000000800000007), size: 161
1046 # Firmware 13, type: STD FW MTS (0x00000004), id: PAL/BG NICAM/B (0000000800000007), size: 169
1055 # Firmware 14, type: STD FW (0x00000000), id: PAL/DK A2 (00000003000000e0), size: 161
1064 # Firmware 15, type: STD FW MTS (0x00000004), id: PAL/DK A2 (00000003000000e0), size: 169
1073 # Firmware 16, type: STD FW (0x00000000), id: PAL/DK NICAM (0000000c000000e0), size: 161
1082 # Firmware 17, type: STD FW MTS (0x00000004), id: PAL/DK NICAM (0000000c000000e0), size: 169
1091 # Firmware 18, type: STD FW (0x00000000), id: SECAM/K1 (0000000000200000), size: 161
1100 # Firmware 19, type: STD FW MTS (0x00000004), id: SECAM/K1 (0000000000200000), size: 169
1109 # Firmware 20, type: STD FW (0x00000000), id: SECAM/K3 (0000000004000000), size: 161
1118 # Firmware 21, type: STD FW MTS (0x00000004), id: SECAM/K3 (0000000004000000), size: 169
1127 # Firmware 22, type: STD FW D2633 DTV6 ATSC (0x00010030), id: (0000000000000000), size: 149
1136 # Firmware 23, type: STD FW D2620 DTV6 QAM (0x00000068), id: (0000000000000000), size: 149
1145 # Firmware 24, type: STD FW D2633 DTV6 QAM (0x00000070), id: (0000000000000000), size: 149
1154 # Firmware 25, type: STD FW D2620 DTV7 (0x00000088), id: (0000000000000000), size: 149
1163 # Firmware 26, type: STD FW D2633 DTV7 (0x00000090), id: (0000000000000000), size: 149
1172 # Firmware 27, type: STD FW D2620 DTV78 (0x00000108), id: (0000000000000000), size: 149
1181 # Firmware 28, type: STD FW D2633 DTV78 (0x00000110), id: (0000000000000000), size: 149
1190 # Firmware 29, type: STD FW D2620 DTV8 (0x00000208), id: (0000000000000000), size: 149
1199 # Firmware 30, type: STD FW D2633 DTV8 (0x00000210), id: (0000000000000000), size: 149
1208 # Firmware 31, type: STD FW FM (0x00000400), id: (0000000000000000), size: 135
1217 # Firmware 32, type: STD FW (0x00000000), id: PAL/I (0000000000000010), size: 161
1226 # Firmware 33, type: STD FW MTS (0x00000004), id: PAL/I (0000000000000010), size: 169
1235 # Firmware 34, type: STD FW (0x00000000), id: SECAM/L AM (0000001000400000), size: 169
1244 # Firmware 35, type: STD FW (0x00000000), id: SECAM/L NICAM (0000000c00400000), size: 161
1253 # Firmware 36, type: STD FW (0x00000000), id: SECAM/Lc (0000000000800000), size: 161
1262 # Firmware 37, type: STD FW (0x00000000), id: NTSC/M Kr (0000000000008000), size: 161
1271 # Firmware 38, type: STD FW LCD (0x00001000), id: NTSC/M Kr (0000000000008000), size: 161
1280 # Firmware 39, type: STD FW LCD NOGD (0x00003000), id: NTSC/M Kr (0000000000008000), size: 161
1289 # Firmware 40, type: STD FW MTS (0x00000004), id: NTSC/M Kr (0000000000008000), size: 169
1298 # Firmware 41, type: STD FW (0x00000000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
1307 # Firmware 42, type: STD FW LCD (0x00001000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
1316 # Firmware 43, type: STD FW LCD NOGD (0x00003000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
1325 # Firmware 44, type: STD FW (0x00000000), id: NTSC/M Jp (0000000000002000), size: 161
1334 # Firmware 45, type: STD FW MTS (0x00000004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
1343 # Firmware 46, type: STD FW MTS LCD (0x00001004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
1352 # Firmware 47, type: STD FW MTS LCD NOGD (0x00003004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
1361 # Firmware 48, type: SCODE FW HAS IF (0x60000000), IF = 3.28 MHz id: (0000000000000000), size: 192
1371 # Firmware 49, type: SCODE FW HAS IF (0x60000000), IF = 3.30 MHz id: (0000000000000000), size: 192
1381 # Firmware 50, type: SCODE FW HAS IF (0x60000000), IF = 3.44 MHz id: (0000000000000000), size: 192
1391 # Firmware 51, type: SCODE FW HAS IF (0x60000000), IF = 3.46 MHz id: (0000000000000000), size: 192
1401 # Firmware 52, type: SCODE FW DTV6 ATSC OREN36 HAS IF (0x60210020), IF = 3.80 MHz id: (0000000000000000), size: 192
1411 # Firmware 53, type: SCODE FW HAS IF (0x60000000), IF = 4.00 MHz id: (0000000000000000), size: 192
1421 # Firmware 54, type: SCODE FW DTV6 ATSC TOYOTA388 HAS IF (0x60410020), IF = 4.08 MHz id: (0000000000000000), size: 192
1431 # Firmware 55, type: SCODE FW HAS IF (0x60000000), IF = 4.20 MHz id: (0000000000000000), size: 192
1441 # Firmware 56, type: SCODE FW MONO HAS IF (0x60008000), IF = 4.32 MHz id: NTSC/M Kr (0000000000008000), size: 192
1451 # Firmware 57, type: SCODE FW HAS IF (0x60000000), IF = 4.45 MHz id: (0000000000000000), size: 192
1461 # Firmware 58, type: SCODE FW MTS LCD NOGD MONO IF HAS IF (0x6002b004), IF = 4.50 MHz id: NTSC PAL/M PAL/N (000000000000b700), size: 192
1471 # Firmware 59, type: SCODE FW LCD NOGD IF HAS IF (0x60023000), IF = 4.60 MHz id: NTSC/M Kr (0000000000008000), size: 192
1481 # Firmware 60, type: SCODE FW DTV6 QAM DTV7 DTV78 DTV8 ZARLINK456 HAS IF (0x620003e0), IF = 4.76 MHz id: (0000000000000000), size: 192
1491 # Firmware 61, type: SCODE FW HAS IF (0x60000000), IF = 4.94 MHz id: (0000000000000000), size: 192
1501 # Firmware 62, type: SCODE FW HAS IF (0x60000000), IF = 5.26 MHz id: (0000000000000000), size: 192
1511 # Firmware 63, type: SCODE FW MONO HAS IF (0x60008000), IF = 5.32 MHz id: PAL/BG A2 NICAM (0000000f00000007), size: 192
1521 # Firmware 64, type: SCODE FW DTV7 DTV78 DTV8 DIBCOM52 CHINA HAS IF (0x65000380), IF = 5.40 MHz id: (0000000000000000), size: 192
1531 # Firmware 65, type: SCODE FW DTV6 ATSC OREN538 HAS IF (0x60110020), IF = 5.58 MHz id: (0000000000000000), size: 192
1541 # Firmware 66, type: SCODE FW HAS IF (0x60000000), IF = 5.64 MHz id: PAL/BG A2 (0000000300000007), size: 192
1551 # Firmware 67, type: SCODE FW HAS IF (0x60000000), IF = 5.74 MHz id: PAL/BG NICAM (0000000c00000007), size: 192
1561 # Firmware 68, type: SCODE FW HAS IF (0x60000000), IF = 5.90 MHz id: (0000000000000000), size: 192
1571 # Firmware 69, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.00 MHz id: PAL/DK PAL/I SECAM/K3 SECAM/L SECAM/Lc NICAM (0000000c04c000f0), size: 192
1581 # Firmware 70, type: SCODE FW DTV6 QAM ATSC LG60 F6MHZ HAS IF (0x68050060), IF = 6.20 MHz id: (0000000000000000), size: 192
1591 # Firmware 71, type: SCODE FW HAS IF (0x60000000), IF = 6.24 MHz id: PAL/I (0000000000000010), size: 192
1601 # Firmware 72, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.32 MHz id: SECAM/K1 (0000000000200000), size: 192
1611 # Firmware 73, type: SCODE FW HAS IF (0x60000000), IF = 6.34 MHz id: SECAM/K1 (0000000000200000), size: 192
1621 # Firmware 74, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.50 MHz id: PAL/DK SECAM/K3 SECAM/L NICAM (0000000c044000e0), size: 192
1631 # Firmware 75, type: SCODE FW DTV6 ATSC ATI638 HAS IF (0x60090020), IF = 6.58 MHz id: (0000000000000000), size: 192
1641 # Firmware 76, type: SCODE FW HAS IF (0x60000000), IF = 6.60 MHz id: PAL/DK A2 (00000003000000e0), size: 192
1651 # Firmware 77, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.68 MHz id: PAL/DK A2 (00000003000000e0), size: 192
1661 # Firmware 78, type: SCODE FW DTV6 ATSC TOYOTA794 HAS IF (0x60810020), IF = 8.14 MHz id: (0000000000000000), size: 192
1671 # Firmware 79, type: SCODE FW HAS IF (0x60000000), IF = 8.20 MHz id: (0000000000000000), size: 192
/linux-4.1.27/drivers/gpu/drm/nouveau/nvkm/core/
H A Dioctl.c34 nvkm_ioctl_nop(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_nop() argument
42 nv_ioctl(object, "nop size %d\n", size); nvkm_ioctl_nop()
51 nvkm_ioctl_sclass(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_sclass() argument
64 nv_ioctl(object, "sclass size %d\n", size); nvkm_ioctl_sclass()
68 if (size == args->v0.count * sizeof(args->v0.oclass[0])) { nvkm_ioctl_sclass()
84 nvkm_ioctl_new(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_new() argument
98 nv_ioctl(client, "new size %d\n", size); nvkm_ioctl_new()
141 data, size, &engctx); nvkm_ioctl_new()
149 ret = nvkm_object_ctor(engctx, engine, oclass, data, size, &object); nvkm_ioctl_new()
183 nvkm_ioctl_del(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_del() argument
191 nv_ioctl(object, "delete size %d\n", size); nvkm_ioctl_del()
202 nvkm_ioctl_mthd(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_mthd() argument
211 nv_ioctl(object, "mthd size %d\n", size); nvkm_ioctl_mthd()
216 ret = ofuncs->mthd(object, args->v0.method, data, size); nvkm_ioctl_mthd()
224 nvkm_ioctl_rd(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_rd() argument
233 nv_ioctl(object, "rd size %d\n", size); nvkm_ioctl_rd()
235 nv_ioctl(object, "rd vers %d size %d addr %016llx\n", nvkm_ioctl_rd()
236 args->v0.version, args->v0.size, args->v0.addr); nvkm_ioctl_rd()
237 switch (args->v0.size) { nvkm_ioctl_rd()
266 nvkm_ioctl_wr(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_wr() argument
275 nv_ioctl(object, "wr size %d\n", size); nvkm_ioctl_wr()
277 nv_ioctl(object, "wr vers %d size %d addr %016llx data %08x\n", nvkm_ioctl_wr()
278 args->v0.version, args->v0.size, args->v0.addr, nvkm_ioctl_wr()
280 switch (args->v0.size) { nvkm_ioctl_wr()
309 nvkm_ioctl_map(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_map() argument
318 nv_ioctl(object, "map size %d\n", size); nvkm_ioctl_map()
331 nvkm_ioctl_unmap(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_unmap() argument
339 nv_ioctl(object, "unmap size %d\n", size); nvkm_ioctl_unmap()
348 nvkm_ioctl_ntfy_new(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_ntfy_new() argument
358 nv_ioctl(object, "ntfy new size %d\n", size); nvkm_ioctl_ntfy_new()
365 ret = nvkm_client_notify_new(object, event, data, size); nvkm_ioctl_ntfy_new()
377 nvkm_ioctl_ntfy_del(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_ntfy_del() argument
386 nv_ioctl(object, "ntfy del size %d\n", size); nvkm_ioctl_ntfy_del()
397 nvkm_ioctl_ntfy_get(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_ntfy_get() argument
406 nv_ioctl(object, "ntfy get size %d\n", size); nvkm_ioctl_ntfy_get()
417 nvkm_ioctl_ntfy_put(struct nvkm_handle *handle, void *data, u32 size) nvkm_ioctl_ntfy_put() argument
426 nv_ioctl(object, "ntfy put size %d\n", size); nvkm_ioctl_ntfy_put()
458 void *data, u32 size, u8 owner, u8 *route, u64 *token) nvkm_ioctl_path()
490 ret = nvkm_ioctl_v0[type].func(handle, data, size); nvkm_ioctl_path()
498 void *data, u32 size, void **hack) nvkm_ioctl()
506 nv_ioctl(client, "size %d\n", size); nvkm_ioctl()
514 data, size, args->v0.owner, nvkm_ioctl()
457 nvkm_ioctl_path(struct nvkm_handle *parent, u32 type, u32 nr, u32 *path, void *data, u32 size, u8 owner, u8 *route, u64 *token) nvkm_ioctl_path() argument
497 nvkm_ioctl(struct nvkm_client *client, bool supervisor, void *data, u32 size, void **hack) nvkm_ioctl() argument
/linux-4.1.27/arch/arm/common/
H A Ddmabounce.c52 size_t size; member in struct:safe_buffer
62 unsigned long size; member in struct:dmabounce_pool
108 size_t size, enum dma_data_direction dir) alloc_safe_buffer()
115 dev_dbg(dev, "%s(ptr=%p, size=%d, dir=%d)\n", alloc_safe_buffer()
116 __func__, ptr, size, dir); alloc_safe_buffer()
118 if (size <= device_info->small.size) { alloc_safe_buffer()
120 } else if (size <= device_info->large.size) { alloc_safe_buffer()
133 buf->size = size; alloc_safe_buffer()
141 buf->safe = dma_alloc_coherent(dev, size, &buf->safe_dma_addr, alloc_safe_buffer()
147 "%s: could not alloc dma memory (size=%d)\n", alloc_safe_buffer()
148 __func__, size); alloc_safe_buffer()
177 b->safe_dma_addr + b->size > safe_dma_addr) { find_safe_buffer()
202 dma_free_coherent(device_info->dev, buf->size, buf->safe, free_safe_buffer()
222 static int needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size) needs_bounce() argument
231 if (limit && size > limit) { needs_bounce()
233 "mask %#Lx)\n", size, *dev->dma_mask); needs_bounce()
238 if ((dma_addr | (dma_addr + size - 1)) & ~mask) needs_bounce()
242 return !!dev->archdata.dmabounce->needs_bounce(dev, dma_addr, size); needs_bounce()
245 static inline dma_addr_t map_single(struct device *dev, void *ptr, size_t size, map_single() argument
254 buf = alloc_safe_buffer(device_info, ptr, size, dir); map_single()
266 dev_dbg(dev, "%s: copy unsafe %p to safe %p, size %d\n", map_single()
267 __func__, ptr, buf->safe, size); map_single()
268 memcpy(buf->safe, ptr, size); map_single()
275 size_t size, enum dma_data_direction dir) unmap_single()
277 BUG_ON(buf->size != size); unmap_single()
289 dev_dbg(dev, "%s: copy back safe %p to unsafe %p size %d\n", unmap_single()
290 __func__, buf->safe, ptr, size); unmap_single()
291 memcpy(ptr, buf->safe, size); unmap_single()
298 __cpuc_flush_dcache_area(ptr, size); unmap_single()
312 unsigned long offset, size_t size, enum dma_data_direction dir, dmabounce_map_page()
318 dev_dbg(dev, "%s(page=%p,off=%#lx,size=%zx,dir=%x)\n", dmabounce_map_page()
319 __func__, page, offset, size, dir); dmabounce_map_page()
323 ret = needs_bounce(dev, dma_addr, size); dmabounce_map_page()
328 arm_dma_ops.sync_single_for_device(dev, dma_addr, size, dir); dmabounce_map_page()
337 return map_single(dev, page_address(page) + offset, size, dir); dmabounce_map_page()
346 static void dmabounce_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, dmabounce_unmap_page() argument
351 dev_dbg(dev, "%s(dma=%#x,size=%d,dir=%x)\n", dmabounce_unmap_page()
352 __func__, dma_addr, size, dir); dmabounce_unmap_page()
356 arm_dma_ops.sync_single_for_cpu(dev, dma_addr, size, dir); dmabounce_unmap_page()
360 unmap_single(dev, buf, size, dir); dmabounce_unmap_page()
387 dev_dbg(dev, "%s: copy back safe %p to unsafe %p size %d\n", __dmabounce_sync_for_cpu()
395 dma_addr_t handle, size_t size, enum dma_data_direction dir) dmabounce_sync_for_cpu()
397 if (!__dmabounce_sync_for_cpu(dev, handle, size, dir)) dmabounce_sync_for_cpu()
400 arm_dma_ops.sync_single_for_cpu(dev, handle, size, dir); dmabounce_sync_for_cpu()
427 dev_dbg(dev, "%s: copy out unsafe %p to safe %p, size %d\n", __dmabounce_sync_for_device()
435 dma_addr_t handle, size_t size, enum dma_data_direction dir) dmabounce_sync_for_device()
437 if (!__dmabounce_sync_for_device(dev, handle, size, dir)) dmabounce_sync_for_device()
440 arm_dma_ops.sync_single_for_device(dev, handle, size, dir); dmabounce_sync_for_device()
468 const char *name, unsigned long size) dmabounce_init_pool()
470 pool->size = size; dmabounce_init_pool()
472 pool->pool = dma_pool_create(name, dev, size, dmabounce_init_pool()
107 alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr, size_t size, enum dma_data_direction dir) alloc_safe_buffer() argument
274 unmap_single(struct device *dev, struct safe_buffer *buf, size_t size, enum dma_data_direction dir) unmap_single() argument
311 dmabounce_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) dmabounce_map_page() argument
394 dmabounce_sync_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dmabounce_sync_for_cpu() argument
434 dmabounce_sync_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dmabounce_sync_for_device() argument
467 dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev, const char *name, unsigned long size) dmabounce_init_pool() argument
/linux-4.1.27/sound/isa/gus/
H A Dgus_dram.c29 unsigned int address, unsigned int size) snd_gus_dram_poke()
35 while (size > 0) { snd_gus_dram_poke()
36 size1 = size > sizeof(buffer) ? sizeof(buffer) : size; snd_gus_dram_poke()
52 size -= size1; snd_gus_dram_poke()
60 unsigned int address, unsigned int size) snd_gus_dram_write()
62 return snd_gus_dram_poke(gus, buffer, address, size); snd_gus_dram_write()
66 unsigned int address, unsigned int size, snd_gus_dram_peek()
73 while (size > 0) { snd_gus_dram_peek()
74 size1 = size > sizeof(buffer) ? sizeof(buffer) : size; snd_gus_dram_peek()
91 size -= size1; snd_gus_dram_peek()
98 unsigned int address, unsigned int size, snd_gus_dram_read()
101 return snd_gus_dram_peek(gus, buffer, address, size, rom); snd_gus_dram_read()
28 snd_gus_dram_poke(struct snd_gus_card *gus, char __user *_buffer, unsigned int address, unsigned int size) snd_gus_dram_poke() argument
59 snd_gus_dram_write(struct snd_gus_card *gus, char __user *buffer, unsigned int address, unsigned int size) snd_gus_dram_write() argument
65 snd_gus_dram_peek(struct snd_gus_card *gus, char __user *_buffer, unsigned int address, unsigned int size, int rom) snd_gus_dram_peek() argument
97 snd_gus_dram_read(struct snd_gus_card *gus, char __user *buffer, unsigned int address, unsigned int size, int rom) snd_gus_dram_read() argument
/linux-4.1.27/arch/unicore32/include/asm/
H A Dmemblock.h23 unsigned long size; member in struct:membank
38 #define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size)
39 #define bank_pfn_size(bank) ((bank)->size >> PAGE_SHIFT)
41 #define bank_phys_end(bank) ((bank)->start + (bank)->size)
42 #define bank_phys_size(bank) ((bank)->size)
/linux-4.1.27/drivers/block/drbd/
H A Ddrbd_interval.h10 unsigned int size; /* size in bytes */ member in struct:drbd_interval
37 #define drbd_for_each_overlap(i, root, sector, size) \
38 for (i = drbd_find_overlap(root, sector, size); \
40 i = drbd_next_overlap(i, sector, size))
/linux-4.1.27/arch/alpha/include/asm/
H A Ddma-mapping.h17 static inline void *dma_alloc_attrs(struct device *dev, size_t size, dma_alloc_attrs() argument
21 return get_dma_ops(dev)->alloc(dev, size, dma_handle, gfp, attrs); dma_alloc_attrs()
26 static inline void dma_free_attrs(struct device *dev, size_t size, dma_free_attrs() argument
30 get_dma_ops(dev)->free(dev, size, vaddr, dma_handle, attrs); dma_free_attrs()
51 #define dma_cache_sync(dev, va, size, dir) ((void)0)
/linux-4.1.27/fs/ext2/
H A Dacl.h38 static inline int ext2_acl_count(size_t size) ext2_acl_count() argument
41 size -= sizeof(ext2_acl_header); ext2_acl_count()
42 s = size - 4 * sizeof(ext2_acl_entry_short); ext2_acl_count()
44 if (size % sizeof(ext2_acl_entry_short)) ext2_acl_count()
46 return size / sizeof(ext2_acl_entry_short); ext2_acl_count()
/linux-4.1.27/fs/ext3/
H A Dacl.h38 static inline int ext3_acl_count(size_t size) ext3_acl_count() argument
41 size -= sizeof(ext3_acl_header); ext3_acl_count()
42 s = size - 4 * sizeof(ext3_acl_entry_short); ext3_acl_count()
44 if (size % sizeof(ext3_acl_entry_short)) ext3_acl_count()
46 return size / sizeof(ext3_acl_entry_short); ext3_acl_count()
/linux-4.1.27/fs/ext4/
H A Dacl.h38 static inline int ext4_acl_count(size_t size) ext4_acl_count() argument
41 size -= sizeof(ext4_acl_header); ext4_acl_count()
42 s = size - 4 * sizeof(ext4_acl_entry_short); ext4_acl_count()
44 if (size % sizeof(ext4_acl_entry_short)) ext4_acl_count()
46 return size / sizeof(ext4_acl_entry_short); ext4_acl_count()
/linux-4.1.27/drivers/xen/xenfs/
H A Dxenstored.c12 size_t size, loff_t *off) xsd_read()
15 return simple_read_from_buffer(buf, size, off, str, strlen(str)); xsd_read()
35 size_t size = vma->vm_end - vma->vm_start; xsd_kva_mmap() local
37 if ((size > PAGE_SIZE) || (vma->vm_pgoff != 0)) xsd_kva_mmap()
42 size, vma->vm_page_prot)) xsd_kva_mmap()
11 xsd_read(struct file *file, char __user *buf, size_t size, loff_t *off) xsd_read() argument
/linux-4.1.27/drivers/rapidio/
H A Drio-sysfs.c130 unsigned int size = 0x100; rio_read_config() local
136 size = RIO_MAINT_SPACE_SZ; rio_read_config()
138 if (off >= size) rio_read_config()
140 if (off + count > size) { rio_read_config()
141 size -= off; rio_read_config()
142 count = size; rio_read_config()
144 size = count; rio_read_config()
147 if ((off & 1) && size) { rio_read_config()
152 size--; rio_read_config()
155 if ((off & 3) && size > 2) { rio_read_config()
161 size -= 2; rio_read_config()
164 while (size > 3) { rio_read_config()
172 size -= 4; rio_read_config()
175 if (size >= 2) { rio_read_config()
181 size -= 2; rio_read_config()
184 if (size > 0) { rio_read_config()
189 --size; rio_read_config()
202 unsigned int size = count; rio_write_config() local
209 size = RIO_MAINT_SPACE_SZ - off; rio_write_config()
210 count = size; rio_write_config()
213 if ((off & 1) && size) { rio_write_config()
216 size--; rio_write_config()
219 if ((off & 3) && (size > 2)) { rio_write_config()
224 size -= 2; rio_write_config()
227 while (size > 3) { rio_write_config()
234 size -= 4; rio_write_config()
237 if (size >= 2) { rio_write_config()
242 size -= 2; rio_write_config()
245 if (size) { rio_write_config()
248 --size; rio_write_config()
259 .size = RIO_MAINT_SPACE_SZ,
/linux-4.1.27/arch/sparc/include/asm/
H A Duaccess_64.h52 static inline int __access_ok(const void __user * addr, unsigned long size) __access_ok() argument
57 static inline int access_ok(int type, const void __user * addr, unsigned long size) access_ok() argument
83 * They automatically use the right size if we just have the right
109 #define __put_user_nocheck(data, addr, size) ({ \
111 switch (size) { \
121 #define __put_user_asm(x, size, addr, ret) \
124 "1:\t" "st"#size "a %1, [%2] %%asi\n\t" \
143 #define __get_user_nocheck(data, addr, size, type) ({ \
146 switch (size) { \
160 #define __get_user_nocheck_ret(data, addr, size, type, retval) ({ \
162 switch (size) { \
174 #define __get_user_asm(x, size, addr, ret) \
177 "1:\t" "ld"#size "a [%2] %%asi, %1\n\t" \
195 #define __get_user_asm_ret(x, size, addr, retval) \
199 "1:\t" "ld"#size "a [%1] %%asi, %0\n\n\t" \
208 "1:\t" "ld"#size "a [%1] %%asi, %0\n\n\t" \
225 unsigned long size);
227 unsigned long size);
229 copy_from_user(void *to, const void __user *from, unsigned long size) copy_from_user() argument
231 unsigned long ret = ___copy_from_user(to, from, size); copy_from_user()
234 ret = copy_from_user_fixup(to, from, size); copy_from_user()
242 unsigned long size);
244 unsigned long size);
246 copy_to_user(void __user *to, const void *from, unsigned long size) copy_to_user() argument
248 unsigned long ret = ___copy_to_user(to, from, size); copy_to_user()
251 ret = copy_to_user_fixup(to, from, size); copy_to_user()
258 unsigned long size);
260 unsigned long size);
262 copy_in_user(void __user *to, void __user *from, unsigned long size) copy_in_user() argument
264 unsigned long ret = ___copy_in_user(to, from, size); copy_in_user()
267 ret = copy_in_user_fixup(to, from, size); copy_in_user()
/linux-4.1.27/drivers/pnp/isapnp/
H A Dcore.c367 static int __init isapnp_read_tag(unsigned char *type, unsigned short *size) isapnp_read_tag() argument
377 *size = (tmp[1] << 8) | tmp[0]; isapnp_read_tag()
380 *size = tag & 0x07; isapnp_read_tag()
382 if (*type == 0xff && *size == 0xffff) /* probably invalid data */ isapnp_read_tag()
399 int size, int number) isapnp_parse_device()
406 isapnp_peek(tmp, size); isapnp_parse_device()
428 int size) isapnp_parse_irq_resource()
435 isapnp_peek(tmp, size); isapnp_parse_irq_resource()
441 if (size > 2) isapnp_parse_irq_resource()
452 int size) isapnp_parse_dma_resource()
456 isapnp_peek(tmp, size); isapnp_parse_dma_resource()
465 int size) isapnp_parse_port_resource()
471 isapnp_peek(tmp, size); isapnp_parse_port_resource()
486 int size) isapnp_parse_fixed_port_resource()
491 isapnp_peek(tmp, size); isapnp_parse_fixed_port_resource()
503 int size) isapnp_parse_mem_resource()
509 isapnp_peek(tmp, size); isapnp_parse_mem_resource()
524 int size) isapnp_parse_mem32_resource()
530 isapnp_peek(tmp, size); isapnp_parse_mem32_resource()
545 int size) isapnp_parse_fixed_mem32_resource()
551 isapnp_peek(tmp, size); isapnp_parse_fixed_mem32_resource()
562 isapnp_parse_name(char *name, unsigned int name_max, unsigned short *size) isapnp_parse_name() argument
566 *size >= name_max ? (name_max - 1) : *size; isapnp_parse_name()
569 *size -= size1; isapnp_parse_name()
581 unsigned short size) isapnp_create_device()
590 if ((dev = isapnp_parse_device(card, size, number++)) == NULL) isapnp_create_device()
596 if (isapnp_read_tag(&type, &size) < 0) isapnp_create_device()
602 if (size >= 5 && size <= 6) { isapnp_create_device()
604 isapnp_parse_device(card, size, isapnp_create_device()
607 size = 0; isapnp_create_device()
617 if (size == 4 && compat < DEVICE_COUNT_COMPATIBLE) { isapnp_create_device()
624 size = 0; isapnp_create_device()
628 if (size < 2 || size > 3) isapnp_create_device()
630 isapnp_parse_irq_resource(dev, option_flags, size); isapnp_create_device()
631 size = 0; isapnp_create_device()
634 if (size != 2) isapnp_create_device()
636 isapnp_parse_dma_resource(dev, option_flags, size); isapnp_create_device()
637 size = 0; isapnp_create_device()
640 if (size > 1) isapnp_create_device()
643 if (size > 0) { isapnp_create_device()
644 isapnp_peek(tmp, size); isapnp_create_device()
646 size = 0; isapnp_create_device()
651 if (size != 0) isapnp_create_device()
656 if (size != 7) isapnp_create_device()
658 isapnp_parse_port_resource(dev, option_flags, size); isapnp_create_device()
659 size = 0; isapnp_create_device()
662 if (size != 3) isapnp_create_device()
665 size); isapnp_create_device()
666 size = 0; isapnp_create_device()
671 if (size != 9) isapnp_create_device()
673 isapnp_parse_mem_resource(dev, option_flags, size); isapnp_create_device()
674 size = 0; isapnp_create_device()
677 isapnp_parse_name(dev->name, sizeof(dev->name), &size); isapnp_create_device()
686 if (size != 17) isapnp_create_device()
688 isapnp_parse_mem32_resource(dev, option_flags, size); isapnp_create_device()
689 size = 0; isapnp_create_device()
692 if (size != 9) isapnp_create_device()
695 size); isapnp_create_device()
696 size = 0; isapnp_create_device()
699 if (size > 0) isapnp_create_device()
700 isapnp_skip_bytes(size); isapnp_create_device()
707 if (size > 0) isapnp_create_device()
708 isapnp_skip_bytes(size); isapnp_create_device()
719 unsigned short size; isapnp_parse_resource_map() local
722 if (isapnp_read_tag(&type, &size) < 0) isapnp_parse_resource_map()
726 if (size != 2) isapnp_parse_resource_map()
731 size = 0; isapnp_parse_resource_map()
734 if (size >= 5 && size <= 6) { isapnp_parse_resource_map()
735 if (isapnp_create_device(card, size) == 1) isapnp_parse_resource_map()
737 size = 0; isapnp_parse_resource_map()
744 &size); isapnp_parse_resource_map()
753 if (size > 0) isapnp_parse_resource_map()
754 isapnp_skip_bytes(size); isapnp_parse_resource_map()
761 if (size > 0) isapnp_parse_resource_map()
762 isapnp_skip_bytes(size); isapnp_parse_resource_map()
398 isapnp_parse_device(struct pnp_card *card, int size, int number) isapnp_parse_device() argument
426 isapnp_parse_irq_resource(struct pnp_dev *dev, unsigned int option_flags, int size) isapnp_parse_irq_resource() argument
450 isapnp_parse_dma_resource(struct pnp_dev *dev, unsigned int option_flags, int size) isapnp_parse_dma_resource() argument
463 isapnp_parse_port_resource(struct pnp_dev *dev, unsigned int option_flags, int size) isapnp_parse_port_resource() argument
484 isapnp_parse_fixed_port_resource(struct pnp_dev *dev, unsigned int option_flags, int size) isapnp_parse_fixed_port_resource() argument
501 isapnp_parse_mem_resource(struct pnp_dev *dev, unsigned int option_flags, int size) isapnp_parse_mem_resource() argument
522 isapnp_parse_mem32_resource(struct pnp_dev *dev, unsigned int option_flags, int size) isapnp_parse_mem32_resource() argument
543 isapnp_parse_fixed_mem32_resource(struct pnp_dev *dev, unsigned int option_flags, int size) isapnp_parse_fixed_mem32_resource() argument
580 isapnp_create_device(struct pnp_card *card, unsigned short size) isapnp_create_device() argument
/linux-4.1.27/arch/score/include/asm/
H A Dpage.h7 /* PAGE_SHIFT determines the page size */
19 /* align addr on a size boundary - adjust address up/down if needed */
20 #define _ALIGN_UP(addr, size) (((addr)+((size)-1))&(~((size)-1)))
21 #define _ALIGN_DOWN(addr, size) ((addr)&(~((size)-1)))
23 /* align addr on a size boundary - adjust address up if needed */
24 #define _ALIGN(addr, size) _ALIGN_UP(addr, size)
/linux-4.1.27/arch/mips/pci/
H A Dops-nile4.c75 int where, int size, u32 *val) nile4_pcibios_read()
80 if ((size == 2) && (where & 1)) nile4_pcibios_read()
82 else if ((size == 4) && (where & 3)) nile4_pcibios_read()
90 if (size == 1) nile4_pcibios_read()
92 else if (size == 2) nile4_pcibios_read()
101 int where, int size, u32 val) nile4_pcibios_write()
106 if ((size == 2) && (where & 1)) nile4_pcibios_write()
108 else if ((size == 4) && (where & 3)) nile4_pcibios_write()
116 if (size == 1) nile4_pcibios_write()
119 else if (size == 2) nile4_pcibios_write()
74 nile4_pcibios_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val) nile4_pcibios_read() argument
100 nile4_pcibios_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val) nile4_pcibios_write() argument
/linux-4.1.27/arch/openrisc/include/asm/
H A Ddma-mapping.h43 static inline void *dma_alloc_attrs(struct device *dev, size_t size, dma_alloc_attrs() argument
50 memory = ops->alloc(dev, size, dma_handle, gfp, attrs); dma_alloc_attrs()
52 debug_dma_alloc_coherent(dev, size, *dma_handle, memory); dma_alloc_attrs()
59 static inline void dma_free_attrs(struct device *dev, size_t size, dma_free_attrs() argument
65 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); dma_free_attrs()
67 ops->free(dev, size, cpu_addr, dma_handle, attrs); dma_free_attrs()
70 static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, dma_alloc_noncoherent() argument
77 return dma_alloc_attrs(dev, size, dma_handle, gfp, &attrs); dma_alloc_noncoherent()
80 static inline void dma_free_noncoherent(struct device *dev, size_t size, dma_free_noncoherent() argument
87 dma_free_attrs(dev, size, cpu_addr, dma_handle, &attrs); dma_free_noncoherent()

Completed in 4228 milliseconds

1234567891011>>