Lines Matching +full:align +full:- +full:end

1 // SPDX-License-Identifier: GPL-2.0-only
23 * enum buf_end_align_type - Page alignment of a buffer
24 * end with regard to the end of the previous buffer.
28 * Symbol [ means the start of a buffer, ] means the end
33 * @SAME_PAGE_UNALIGNED: The end of this buffer is on
34 * the same page as the end of the previous buffer and
41 * @SAME_PAGE_ALIGNED: When the end of the previous buffer
42 * is not page aligned, the end of this buffer is on the
43 * same page as the end of the previous buffer and is page
45 * end of this buffer is aligned to the next page boundary.
52 * @NEXT_PAGE_UNALIGNED: The end of this buffer is on
53 * the page next to the end of the previous buffer and
60 * @NEXT_PAGE_ALIGNED: The end of this buffer is on
61 * the page next to the end of the previous buffer and
68 * @NEXT_NEXT_UNALIGNED: The end of this buffer is on
69 * the page that follows the page after the end of the
101 unsigned long end; in check_buffer_pages_allocated() local
104 end = PAGE_ALIGN(buffer->user_data + size); in check_buffer_pages_allocated()
105 page_addr = buffer->user_data; in check_buffer_pages_allocated()
106 for (; page_addr < end; page_addr += PAGE_SIZE) { in check_buffer_pages_allocated()
107 page_index = (page_addr - alloc->vm_start) / PAGE_SIZE; in check_buffer_pages_allocated()
108 if (!alloc->pages[page_index] || in check_buffer_pages_allocated()
109 !list_empty(page_to_lru(alloc->pages[page_index]))) { in check_buffer_pages_allocated()
111 alloc->pages[page_index] ? in check_buffer_pages_allocated()
138 size_t *sizes, int *seq, size_t end) in binder_selftest_free_buf() argument
145 for (i = 0; i < end / PAGE_SIZE; i++) { in binder_selftest_free_buf()
151 if (list_empty(page_to_lru(alloc->pages[i]))) { in binder_selftest_free_buf()
154 alloc->pages[i] ? "alloc" : "free", i); in binder_selftest_free_buf()
170 for (i = 0; i < (alloc->buffer_size / PAGE_SIZE); i++) { in binder_selftest_free_page()
171 if (alloc->pages[i]) { in binder_selftest_free_page()
173 list_empty(page_to_lru(alloc->pages[i])) ? in binder_selftest_free_page()
181 size_t *sizes, int *seq, size_t end) in binder_selftest_alloc_free() argument
186 binder_selftest_free_buf(alloc, buffers, sizes, seq, end); in binder_selftest_alloc_free()
193 binder_selftest_free_buf(alloc, buffers, sizes, seq, end); in binder_selftest_alloc_free()
211 int index, size_t end) in binder_selftest_free_seq() argument
216 binder_selftest_alloc_free(alloc, sizes, seq, end); in binder_selftest_free_seq()
223 binder_selftest_free_seq(alloc, sizes, seq, index + 1, end); in binder_selftest_free_seq()
239 front_sizes[i] = offset - last_offset; in binder_selftest_alloc_size()
240 back_sizes[BUFFER_NUM - i - 1] = front_sizes[i]; in binder_selftest_alloc_size()
244 * Only BUFFER_NUM - 1 buffer sizes are adjustable since in binder_selftest_alloc_size()
247 back_sizes[0] += alloc->buffer_size - end_offset[BUFFER_NUM - 1]; in binder_selftest_alloc_size()
249 end_offset[BUFFER_NUM - 1]); in binder_selftest_alloc_size()
250 binder_selftest_free_seq(alloc, back_sizes, seq, 0, alloc->buffer_size); in binder_selftest_alloc_size()
256 int align; in binder_selftest_alloc_offset() local
257 size_t end, prev; in binder_selftest_alloc_offset() local
263 prev = index == 0 ? 0 : end_offset[index - 1]; in binder_selftest_alloc_offset()
264 end = prev; in binder_selftest_alloc_offset()
268 for (align = SAME_PAGE_UNALIGNED; align < LOOP_END; align++) { in binder_selftest_alloc_offset()
269 if (align % 2) in binder_selftest_alloc_offset()
270 end = ALIGN(end, PAGE_SIZE); in binder_selftest_alloc_offset()
272 end += BUFFER_MIN_SIZE; in binder_selftest_alloc_offset()
273 end_offset[index] = end; in binder_selftest_alloc_offset()
279 * binder_selftest_alloc() - Test alloc and free of buffer pages.
294 if (!binder_selftest_run || !alloc->mapped) in binder_selftest_alloc()