Lines Matching refs:kernel_size
128 static unsigned long count_valid_kernel_positions(unsigned long kernel_size, in count_valid_kernel_positions() argument
142 if (end - start < kernel_size) in count_valid_kernel_positions()
144 pos += (end - start - kernel_size) / THREAD_SIZE + 1; in count_valid_kernel_positions()
150 static unsigned long position_to_address(unsigned long pos, unsigned long kernel_size, in position_to_address() argument
163 if (end - start < kernel_size) in position_to_address()
165 if ((end - start - kernel_size) / THREAD_SIZE + 1 >= pos) in position_to_address()
167 pos -= (end - start - kernel_size) / THREAD_SIZE + 1; in position_to_address()
176 unsigned long base_pos, max_pos, kernel_size; in get_random_base() local
195 kernel_size = vmlinux.image_size + vmlinux.bss_size; in get_random_base()
196 if (safe_addr + kernel_size > memory_limit) in get_random_base()
199 max_pos = count_valid_kernel_positions(kernel_size, safe_addr, memory_limit); in get_random_base()
208 return position_to_address(base_pos + 1, kernel_size, safe_addr, memory_limit); in get_random_base()