// SPDX-License-Identifier: GPL-2.0-only
/*
 * Linux v6.18, arch/x86/mm/init.c:188-198
 * Source: https://github.com/torvalds/linux/blob/v6.18/arch/x86/mm/init.c
 * Complete function: early_alloc_pgt_buf
 * Source body unchanged. Kernel dependencies are not bundled.
 * License text: GPL-2.0.txt
 * Source has no SPDX header; license follows kernel COPYING.
 */

void  __init early_alloc_pgt_buf(void)
{
	unsigned long tables = INIT_PGT_BUF_SIZE;
	phys_addr_t base;

	base = __pa(extend_brk(tables, PAGE_SIZE));

	pgt_buf_start = base >> PAGE_SHIFT;
	pgt_buf_end = pgt_buf_start;
	pgt_buf_top = pgt_buf_start + (tables >> PAGE_SHIFT);
}

