| /linux/fs/btrfs/tests/ |
| H A D | free-space-tree-tests.c | 154 u32 alignment) in test_empty_block_group() argument 168 u32 alignment) in test_remove_all() argument 188 u32 alignment) in test_remove_beginning() argument 191 {cache->start + alignment, cache->length - alignment}, in test_remove_beginning() 196 cache->start, alignment); in test_remove_beginning() 211 u32 alignment) in test_remove_end() argument 214 {cache->start, cache->length - alignment}, in test_remove_end() 219 cache->start + cache->length - alignment, in test_remove_end() 220 alignment); in test_remove_end() 234 u32 alignment) in test_remove_middle() argument [all …]
|
| /linux/tools/testing/selftests/exec/ |
| H A D | load_address.c | 13 unsigned long long alignment; member 28 stats->alignment = 0; in ExtractStatistics() 43 if (align > stats->alignment) in ExtractStatistics() 44 stats->alignment = align; in ExtractStatistics() 78 extracted.load_address, extracted.alignment); in main() 90 ksft_test_result(extracted.alignment != 0, in main() 91 "Alignment%s found\n", extracted.alignment ? "" : " NOT"); in main() 94 pow2 = extracted.alignment & (extracted.alignment - 1); in main() 97 pow2 == 0 ? "" : " NOT", extracted.alignment); in main() 100 misalign = extracted.load_address & (extracted.alignment - 1); in main()
|
| /linux/drivers/gpu/drm/i915/ |
| H A D | i915_gem_gtt.c | 192 u64 size, u64 alignment, unsigned long color, in i915_gem_gtt_insert() argument 203 GEM_BUG_ON(alignment && !is_power_of_2(alignment)); in i915_gem_gtt_insert() 204 GEM_BUG_ON(alignment && !IS_ALIGNED(alignment, I915_GTT_MIN_ALIGNMENT)); in i915_gem_gtt_insert() 214 if (unlikely(round_up(start, alignment) > round_down(end - size, alignment))) in i915_gem_gtt_insert() 230 if (alignment <= I915_GTT_MIN_ALIGNMENT) in i915_gem_gtt_insert() 231 alignment = 0; in i915_gem_gtt_insert() 234 size, alignment, color, in i915_gem_gtt_insert() 241 size, alignment, color, in i915_gem_gtt_insert() 275 size, alignment ?: I915_GTT_MIN_ALIGNMENT); in i915_gem_gtt_insert() 284 err = i915_gem_evict_something(vm, ww, size, alignment, color, in i915_gem_gtt_insert() [all …]
|
| /linux/drivers/misc/ |
| H A D | pci_endpoint_test.c | 130 size_t alignment; member 137 size_t alignment; member 464 struct pci_endpoint_test_xfer_param *param, size_t alignment) in pci_endpoint_test_validate_xfer_params() argument 471 if (param->size > SIZE_MAX - alignment) { in pci_endpoint_test_validate_xfer_params() 497 size_t alignment = test->alignment; in pci_endpoint_test_copy() local 509 ret = pci_endpoint_test_validate_xfer_params(dev, ¶m, alignment); in pci_endpoint_test_copy() 525 orig_src_addr = kzalloc(size + alignment, GFP_KERNEL); in pci_endpoint_test_copy() 531 get_random_bytes(orig_src_addr, size + alignment); in pci_endpoint_test_copy() 533 size + alignment, DMA_TO_DEVICE); in pci_endpoint_test_copy() 540 if (alignment && !IS_ALIGNED(orig_src_phys_addr, alignment)) { in pci_endpoint_test_copy() [all …]
|
| /linux/scripts/ |
| H A D | recordmcount.pl | 174 my $alignment; # The .align value to use for $mcount_section 201 $alignment = 8; 211 $alignment = 4; 225 $alignment = 8; 231 $alignment = 2; 268 $alignment = 2; 274 $alignment = 3; 293 $alignment = 8; 357 $alignment = 2; 360 $alignment = 2; [all …]
|
| /linux/rust/kernel/ |
| H A D | ptr.rs | 177 fn align_down(self, alignment: Alignment) -> Self; in align_down() 193 fn align_up(self, alignment: Alignment) -> Option<Self>; in align_up() 202 fn align_down(self, alignment: Alignment) -> Self { 205 ::core::num::NonZero::<Self>::try_from(alignment.as_nonzero()) 212 fn align_up(self, alignment: Alignment) -> Option<Self> { 213 let aligned_down = self.align_down(alignment); 217 Self::try_from(alignment.as_usize())
|
| /linux/arch/mips/cavium-octeon/executive/ |
| H A D | cvmx-bootmem.c | 131 static void *cvmx_bootmem_alloc_range(uint64_t size, uint64_t alignment, in cvmx_bootmem_alloc_range() argument 136 cvmx_bootmem_phy_alloc(size, min_addr, max_addr, alignment, 0); in cvmx_bootmem_alloc_range() 145 uint64_t alignment) in cvmx_bootmem_alloc_address() argument 147 return cvmx_bootmem_alloc_range(size, alignment, address, in cvmx_bootmem_alloc_address() 165 void *cvmx_bootmem_alloc_named(uint64_t size, uint64_t alignment, char *name) in cvmx_bootmem_alloc_named() argument 167 return cvmx_bootmem_alloc_named_range(size, 0, 0, alignment, name); in cvmx_bootmem_alloc_named() 218 uint64_t address_max, uint64_t alignment, in cvmx_bootmem_phy_alloc() argument 235 (unsigned long long)alignment); in cvmx_bootmem_phy_alloc() 279 if (alignment < CVMX_BOOTMEM_ALIGNMENT_SIZE) in cvmx_bootmem_phy_alloc() 280 alignment = CVMX_BOOTMEM_ALIGNMENT_SIZE; in cvmx_bootmem_phy_alloc() [all …]
|
| /linux/drivers/gpu/drm/msm/disp/dpu1/ |
| H A D | msm_media_info.h | 1072 unsigned int alignment = 0, bpp = 4; in VENUS_RGB_STRIDE() local 1079 alignment = 128; in VENUS_RGB_STRIDE() 1082 alignment = 256; in VENUS_RGB_STRIDE() 1087 alignment = 256; in VENUS_RGB_STRIDE() 1093 return MSM_MEDIA_ALIGN(width * bpp, alignment); in VENUS_RGB_STRIDE() 1098 unsigned int alignment = 0; in VENUS_RGB_SCANLINES() local 1105 alignment = 32; in VENUS_RGB_SCANLINES() 1110 alignment = 16; in VENUS_RGB_SCANLINES() 1116 return MSM_MEDIA_ALIGN(height, alignment); in VENUS_RGB_SCANLINES()
|
| /linux/arch/powerpc/lib/ |
| H A D | rheap.c | 253 rh_info_t *rh_create(unsigned int alignment) in rh_create() argument 258 if ((alignment & (alignment - 1)) != 0) in rh_create() 265 info->alignment = alignment; in rh_create() 300 void rh_init(rh_info_t * info, unsigned int alignment, int max_blocks, in rh_init() argument 307 if ((alignment & (alignment - 1)) != 0) in rh_init() 310 info->alignment = alignment; in rh_init() 338 m = info->alignment - 1; in rh_attach_region() 383 m = info->alignment - 1; in rh_detach_region() 442 unsigned long rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owner) in rh_alloc_align() argument 450 if (size <= 0 || (alignment & (alignment - 1)) != 0) in rh_alloc_align() [all …]
|
| /linux/Documentation/ABI/testing/ |
| H A D | sysfs-bus-iio-dma-buffer | 5 DMA buffers tend to have a alignment requirement for the 6 buffers. If this alignment requirement is not met samples might 9 This property reports the alignment requirements in bytes. 13 The alignment requirements in number of sample sets will depend 15 that the alignment requirement in samples sets might change 17 the alignment requirement reported in bytes by this property
|
| /linux/drivers/bluetooth/ |
| H A D | hci_h4.c | 158 u8 alignment = hu->alignment ? hu->alignment : 1; in h4_recv_buf() local 255 hu->padding = (skb->len + 1) % alignment; in h4_recv_buf() 256 hu->padding = (alignment - hu->padding) % alignment; in h4_recv_buf() 263 hu->padding = (skb->len + 1) % alignment; in h4_recv_buf() 264 hu->padding = (alignment - hu->padding) % alignment; in h4_recv_buf()
|
| /linux/arch/um/drivers/ |
| H A D | cow_user.c | 92 __u32 alignment; member 104 __u32 alignment; member 198 int sectorsize, int alignment, unsigned long long *size) in write_cow_header() argument 252 header->alignment = htobe32(alignment); in write_cow_header() 347 *align_out = be32toh(header->v3.alignment); in read_cow_header() 378 *align_out = be32toh(header->v3_b.alignment); in read_cow_header() 404 int alignment, int *bitmap_offset_out, in init_cow_file() argument 412 alignment, &size); in init_cow_file() 416 *bitmap_offset_out = ROUND_UP(sizeof(struct cow_header_v3), alignment); in init_cow_file() 417 cow_sizes(COW_VERSION, size, sectorsize, alignment, *bitmap_offset_out, in init_cow_file()
|
| /linux/Documentation/arch/arm/ |
| H A D | mem_alignment.rst | 2 Memory alignment 6 kernel code lately. Therefore the alignment fixup is now unconditionally 13 Of course this is a bad idea to rely on the alignment trap to perform 16 alignment trap can fixup misaligned access for the exception cases, but at 19 Now for user space applications, it is possible to configure the alignment 30 To change the alignment trap behavior, simply echo a number into 31 /proc/cpu/alignment. The number is made up from various bits: 56 echo 1 > /proc/cpu/alignment
|
| /linux/drivers/mtd/ubi/ |
| H A D | vmt.c | 34 __ATTR(alignment, S_IRUGO, vol_attribute_show, NULL); 85 ret = sprintf(buf, "%d\n", vol->alignment); in vol_attribute_show() 228 vol->usable_leb_size = ubi->leb_size - ubi->leb_size % req->alignment; in ubi_create_volume() 247 vol->alignment = req->alignment; in ubi_create_volume() 248 vol->data_pad = ubi->leb_size % vol->alignment; in ubi_create_volume() 307 vtbl_rec.alignment = cpu_to_be32(vol->alignment); in ubi_create_volume() 684 int reserved_pebs, alignment, data_pad, vol_type, name_len, upd_marker; in self_check_volume() local 702 if (vol->reserved_pebs < 0 || vol->alignment < 0 || vol->data_pad < 0 || in self_check_volume() 707 if (vol->alignment > ubi->leb_size || vol->alignment == 0) { in self_check_volume() 712 n = vol->alignment & (ubi->min_io_size - 1); in self_check_volume() [all …]
|
| H A D | vtbl.c | 160 int i, n, reserved_pebs, alignment, data_pad, vol_type, name_len; in vtbl_check() local 169 alignment = be32_to_cpu(vtbl[i].alignment); in vtbl_check() 193 if (reserved_pebs < 0 || alignment < 0 || data_pad < 0 || in vtbl_check() 199 if (alignment > ubi->leb_size || alignment == 0) { in vtbl_check() 204 n = alignment & (ubi->min_io_size - 1); in vtbl_check() 205 if (alignment != 1 && n) { in vtbl_check() 210 n = ubi->leb_size % alignment; in vtbl_check() 539 vol->alignment = be32_to_cpu(vtbl[i].alignment); in init_volumes() 631 vol->alignment = UBI_LAYOUT_VOLUME_ALIGN; in init_volumes()
|
| /linux/arch/powerpc/include/asm/ |
| H A D | rheap.h | 27 unsigned int alignment; member 50 extern rh_info_t *rh_create(unsigned int alignment); 56 extern void rh_init(rh_info_t * info, unsigned int alignment, int max_blocks, 66 extern unsigned long rh_alloc_align(rh_info_t * info, int size, int alignment,
|
| /linux/arch/xtensa/lib/ |
| H A D | memset.S | 45 movi a6, 3 # for alignment tests 57 .align 4 # 1 mod 4 alignment for LOOPNEZ 58 .byte 0 # (0 mod 4 alignment for LBEG) 106 bbci.l a5, 0, .L20 # branch if dst alignment half-aligned 126 .byte 0 # 1 mod 4 alignment for LOOPNEZ 127 # (0 mod 4 alignment for LBEG)
|
| /linux/arch/mips/include/asm/octeon/ |
| H A D | cvmx-bootmem.h | 162 uint64_t alignment); 186 extern void *cvmx_bootmem_alloc_named(uint64_t size, uint64_t alignment, 274 uint64_t address_max, uint64_t alignment, 301 uint64_t alignment,
|
| /linux/tools/testing/selftests/kvm/ |
| H A D | kvm_page_table_test.c | 245 uint64_t alignment; in pre_init_before_test() local 250 alignment = max(large_page_size, guest_page_size); in pre_init_before_test() 251 test_mem_size = (test_mem_size + alignment - 1) & ~(alignment - 1); in pre_init_before_test() 265 alignment = max(0x100000UL, alignment); in pre_init_before_test() 267 guest_test_phys_mem = align_down(guest_test_phys_mem, alignment); in pre_init_before_test()
|
| H A D | pre_fault_memory_test.c | 164 uint64_t gpa, gva, alignment, guest_page_size; in __test_pre_fault_memory() local 176 alignment = guest_page_size = vm_guest_mode_params[VM_MODE_DEFAULT].page_size; in __test_pre_fault_memory() 179 alignment = max(0x100000UL, guest_page_size); in __test_pre_fault_memory() 181 alignment = SZ_2M; in __test_pre_fault_memory() 183 gpa = align_down(gpa, alignment); in __test_pre_fault_memory()
|
| /linux/Documentation/core-api/ |
| H A D | unaligned-memory-access.rst | 36 Natural alignment 39 The rule mentioned above forms what we refer to as natural alignment: 43 When writing code, assume the target architecture has natural alignment 46 In reality, only a few architectures require natural alignment on all sizes 48 writing code that satisfies natural alignment requirements is the easiest way 100 Fortunately, the compiler understands the alignment constraints, so in the 126 For a natural alignment scheme, the compiler would only have to add a single 128 to satisfy alignment constraints for arrays of these structures. 137 architectural alignment requirements. However, again, the compiler is aware 138 of the alignment constraints and will generate extra instructions to perform [all …]
|
| /linux/mm/ |
| H A D | cma.c | 431 phys_addr_t alignment, unsigned int order_per_bit, in __cma_declare_contiguous_nid() argument 440 __func__, &size, &base, &limit, &alignment); in __cma_declare_contiguous_nid() 450 if (alignment && !is_power_of_2(alignment)) in __cma_declare_contiguous_nid() 457 alignment = max_t(phys_addr_t, alignment, CMA_MIN_ALIGNMENT_BYTES); in __cma_declare_contiguous_nid() 458 if (fixed && base & (alignment - 1)) { in __cma_declare_contiguous_nid() 460 &base, &alignment); in __cma_declare_contiguous_nid() 463 base = ALIGN(base, alignment); in __cma_declare_contiguous_nid() 464 size = ALIGN(size, alignment); in __cma_declare_contiguous_nid() 465 limit &= ~(alignment - 1); in __cma_declare_contiguous_nid() 495 base = cma_alloc_mem(base, size, alignment, limit, nid); in __cma_declare_contiguous_nid() [all …]
|
| /linux/tools/testing/memblock/tests/ |
| H A D | basic_api.c | 2177 const phys_addr_t alignment = SMP_CACHE_BYTES; in memblock_trim_memory_aligned_check() local 2182 .base = alignment, in memblock_trim_memory_aligned_check() 2183 .size = alignment * 4 in memblock_trim_memory_aligned_check() 2190 memblock_trim_memory(alignment); in memblock_trim_memory_aligned_check() 2223 const phys_addr_t alignment = SMP_CACHE_BYTES; in memblock_trim_memory_too_small_check() local 2228 .base = alignment, in memblock_trim_memory_too_small_check() 2229 .size = alignment * 2 in memblock_trim_memory_too_small_check() 2232 .base = alignment * 4, in memblock_trim_memory_too_small_check() 2233 .size = alignment - SZ_2 in memblock_trim_memory_too_small_check() 2241 memblock_trim_memory(alignment); in memblock_trim_memory_too_small_check() [all …]
|
| /linux/arch/x86/lib/ |
| H A D | checksum_32.S | 55 testl $3, %esi # Check alignment. 56 jz 2f # Jump if alignment is ok. 57 testl $1, %esi # Check alignment. 58 jz 10f # Jump if alignment is boundary of 2 bytes. 282 testl $2, %edi # Check alignment. 283 jz 2f # Jump if alignment is ok.
|
| /linux/lib/zstd/compress/ |
| H A D | zstd_cwksp.h | 218 MEM_STATIC size_t ZSTD_cwksp_aligned_alloc_size(size_t size, size_t alignment) { in ZSTD_cwksp_aligned_alloc_size() argument 219 return ZSTD_cwksp_alloc_size(ZSTD_cwksp_align(size, alignment)); in ZSTD_cwksp_aligned_alloc_size() 481 …M_STATIC void* ZSTD_cwksp_reserve_object_aligned(ZSTD_cwksp* ws, size_t byteSize, size_t alignment) in ZSTD_cwksp_reserve_object_aligned() argument 483 size_t const mask = alignment - 1; in ZSTD_cwksp_reserve_object_aligned() 484 size_t const surplus = (alignment > sizeof(void*)) ? alignment - sizeof(void*) : 0; in ZSTD_cwksp_reserve_object_aligned() 488 assert(ZSTD_isPower2(alignment)); in ZSTD_cwksp_reserve_object_aligned()
|