void __init mem_init()

in mm/init.c [531:603]


void __init mem_init(void)
{
	/* Do sanity checks on IPC (compat) structures */
	BUILD_BUG_ON(sizeof(struct ipc64_perm) != 48);
#ifndef CONFIG_64BIT
	BUILD_BUG_ON(sizeof(struct semid64_ds) != 80);
	BUILD_BUG_ON(sizeof(struct msqid64_ds) != 104);
	BUILD_BUG_ON(sizeof(struct shmid64_ds) != 104);
#endif
#ifdef CONFIG_COMPAT
	BUILD_BUG_ON(sizeof(struct compat_ipc64_perm) != sizeof(struct ipc64_perm));
	BUILD_BUG_ON(sizeof(struct compat_semid64_ds) != 80);
	BUILD_BUG_ON(sizeof(struct compat_msqid64_ds) != 104);
	BUILD_BUG_ON(sizeof(struct compat_shmid64_ds) != 104);
#endif

	/* Do sanity checks on page table constants */
	BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t));
	BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t));
	BUILD_BUG_ON(PGD_ENTRY_SIZE != sizeof(pgd_t));
	BUILD_BUG_ON(PAGE_SHIFT + BITS_PER_PTE + BITS_PER_PMD + BITS_PER_PGD
			> BITS_PER_LONG);
#if CONFIG_PGTABLE_LEVELS == 3
	BUILD_BUG_ON(PT_INITIAL > PTRS_PER_PMD);
#else
	BUILD_BUG_ON(PT_INITIAL > PTRS_PER_PGD);
#endif

	high_memory = __va((max_pfn << PAGE_SHIFT));
	set_max_mapnr(max_low_pfn);
	memblock_free_all();

#ifdef CONFIG_PA11
	if (boot_cpu_data.cpu_type == pcxl2 || boot_cpu_data.cpu_type == pcxl) {
		pcxl_dma_start = (unsigned long)SET_MAP_OFFSET(MAP_START);
		parisc_vmalloc_start = SET_MAP_OFFSET(pcxl_dma_start
						+ PCXL_DMA_MAP_SIZE);
	} else
#endif
		parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START);

#if 0
	/*
	 * Do not expose the virtual kernel memory layout to userspace.
	 * But keep code for debugging purposes.
	 */
	printk("virtual kernel memory layout:\n"
	       "     vmalloc : 0x%px - 0x%px   (%4ld MB)\n"
	       "     fixmap  : 0x%px - 0x%px   (%4ld kB)\n"
	       "     memory  : 0x%px - 0x%px   (%4ld MB)\n"
	       "       .init : 0x%px - 0x%px   (%4ld kB)\n"
	       "       .data : 0x%px - 0x%px   (%4ld kB)\n"
	       "       .text : 0x%px - 0x%px   (%4ld kB)\n",

	       (void*)VMALLOC_START, (void*)VMALLOC_END,
	       (VMALLOC_END - VMALLOC_START) >> 20,

	       (void *)FIXMAP_START, (void *)(FIXMAP_START + FIXMAP_SIZE),
	       (unsigned long)(FIXMAP_SIZE / 1024),

	       __va(0), high_memory,
	       ((unsigned long)high_memory - (unsigned long)__va(0)) >> 20,

	       __init_begin, __init_end,
	       ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10,

	       _etext, _edata,
	       ((unsigned long)_edata - (unsigned long)_etext) >> 10,

	       _text, _etext,
	       ((unsigned long)_etext - (unsigned long)_text) >> 10);
#endif
}