init.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. /*
  2. * linux/arch/arm/mm/init.c
  3. *
  4. * Copyright (C) 1995-2005 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/errno.h>
  12. #include <linux/ptrace.h>
  13. #include <linux/swap.h>
  14. #include <linux/init.h>
  15. #include <linux/bootmem.h>
  16. #include <linux/mman.h>
  17. #include <linux/nodemask.h>
  18. #include <linux/initrd.h>
  19. #include <asm/mach-types.h>
  20. #include <asm/setup.h>
  21. #include <asm/sizes.h>
  22. #include <asm/tlb.h>
  23. #include <asm/mach/arch.h>
  24. #include <asm/mach/map.h>
  25. DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
  26. extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
  27. extern void _stext, _text, _etext, __data_start, _end, __init_begin, __init_end;
  28. extern unsigned long phys_initrd_start;
  29. extern unsigned long phys_initrd_size;
  30. /*
  31. * The sole use of this is to pass memory configuration
  32. * data from paging_init to mem_init.
  33. */
  34. static struct meminfo meminfo __initdata = { 0, };
  35. /*
  36. * empty_zero_page is a special page that is used for
  37. * zero-initialized data and COW.
  38. */
  39. struct page *empty_zero_page;
  40. void show_mem(void)
  41. {
  42. int free = 0, total = 0, reserved = 0;
  43. int shared = 0, cached = 0, slab = 0, node;
  44. printk("Mem-info:\n");
  45. show_free_areas();
  46. printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
  47. for_each_online_node(node) {
  48. struct page *page, *end;
  49. page = NODE_MEM_MAP(node);
  50. end = page + NODE_DATA(node)->node_spanned_pages;
  51. do {
  52. total++;
  53. if (PageReserved(page))
  54. reserved++;
  55. else if (PageSwapCache(page))
  56. cached++;
  57. else if (PageSlab(page))
  58. slab++;
  59. else if (!page_count(page))
  60. free++;
  61. else
  62. shared += page_count(page) - 1;
  63. page++;
  64. } while (page < end);
  65. }
  66. printk("%d pages of RAM\n", total);
  67. printk("%d free pages\n", free);
  68. printk("%d reserved pages\n", reserved);
  69. printk("%d slab pages\n", slab);
  70. printk("%d pages shared\n", shared);
  71. printk("%d pages swap cached\n", cached);
  72. }
  73. static inline pmd_t *pmd_off(pgd_t *pgd, unsigned long virt)
  74. {
  75. return pmd_offset(pgd, virt);
  76. }
  77. static inline pmd_t *pmd_off_k(unsigned long virt)
  78. {
  79. return pmd_off(pgd_offset_k(virt), virt);
  80. }
  81. #define for_each_nodebank(iter,mi,no) \
  82. for (iter = 0; iter < mi->nr_banks; iter++) \
  83. if (mi->bank[iter].node == no)
  84. /*
  85. * FIXME: We really want to avoid allocating the bootmap bitmap
  86. * over the top of the initrd. Hopefully, this is located towards
  87. * the start of a bank, so if we allocate the bootmap bitmap at
  88. * the end, we won't clash.
  89. */
  90. static unsigned int __init
  91. find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages)
  92. {
  93. unsigned int start_pfn, bank, bootmap_pfn;
  94. start_pfn = PAGE_ALIGN(__pa(&_end)) >> PAGE_SHIFT;
  95. bootmap_pfn = 0;
  96. for_each_nodebank(bank, mi, node) {
  97. unsigned int start, end;
  98. start = mi->bank[bank].start >> PAGE_SHIFT;
  99. end = (mi->bank[bank].size +
  100. mi->bank[bank].start) >> PAGE_SHIFT;
  101. if (end < start_pfn)
  102. continue;
  103. if (start < start_pfn)
  104. start = start_pfn;
  105. if (end <= start)
  106. continue;
  107. if (end - start >= bootmap_pages) {
  108. bootmap_pfn = start;
  109. break;
  110. }
  111. }
  112. if (bootmap_pfn == 0)
  113. BUG();
  114. return bootmap_pfn;
  115. }
  116. static int __init check_initrd(struct meminfo *mi)
  117. {
  118. int initrd_node = -2;
  119. #ifdef CONFIG_BLK_DEV_INITRD
  120. unsigned long end = phys_initrd_start + phys_initrd_size;
  121. /*
  122. * Make sure that the initrd is within a valid area of
  123. * memory.
  124. */
  125. if (phys_initrd_size) {
  126. unsigned int i;
  127. initrd_node = -1;
  128. for (i = 0; i < mi->nr_banks; i++) {
  129. unsigned long bank_end;
  130. bank_end = mi->bank[i].start + mi->bank[i].size;
  131. if (mi->bank[i].start <= phys_initrd_start &&
  132. end <= bank_end)
  133. initrd_node = mi->bank[i].node;
  134. }
  135. }
  136. if (initrd_node == -1) {
  137. printk(KERN_ERR "initrd (0x%08lx - 0x%08lx) extends beyond "
  138. "physical memory - disabling initrd\n",
  139. phys_initrd_start, end);
  140. phys_initrd_start = phys_initrd_size = 0;
  141. }
  142. #endif
  143. return initrd_node;
  144. }
  145. /*
  146. * Reserve the various regions of node 0
  147. */
  148. static __init void reserve_node_zero(pg_data_t *pgdat)
  149. {
  150. unsigned long res_size = 0;
  151. /*
  152. * Register the kernel text and data with bootmem.
  153. * Note that this can only be in node 0.
  154. */
  155. #ifdef CONFIG_XIP_KERNEL
  156. reserve_bootmem_node(pgdat, __pa(&__data_start), &_end - &__data_start);
  157. #else
  158. reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext);
  159. #endif
  160. /*
  161. * Reserve the page tables. These are already in use,
  162. * and can only be in node 0.
  163. */
  164. reserve_bootmem_node(pgdat, __pa(swapper_pg_dir),
  165. PTRS_PER_PGD * sizeof(pgd_t));
  166. /*
  167. * Hmm... This should go elsewhere, but we really really need to
  168. * stop things allocating the low memory; ideally we need a better
  169. * implementation of GFP_DMA which does not assume that DMA-able
  170. * memory starts at zero.
  171. */
  172. if (machine_is_integrator() || machine_is_cintegrator())
  173. res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
  174. /*
  175. * These should likewise go elsewhere. They pre-reserve the
  176. * screen memory region at the start of main system memory.
  177. */
  178. if (machine_is_edb7211())
  179. res_size = 0x00020000;
  180. if (machine_is_p720t())
  181. res_size = 0x00014000;
  182. #ifdef CONFIG_SA1111
  183. /*
  184. * Because of the SA1111 DMA bug, we want to preserve our
  185. * precious DMA-able memory...
  186. */
  187. res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
  188. #endif
  189. if (res_size)
  190. reserve_bootmem_node(pgdat, PHYS_OFFSET, res_size);
  191. }
  192. void __init build_mem_type_table(void);
  193. void __init create_mapping(struct map_desc *md);
  194. static unsigned long __init
  195. bootmem_init_node(int node, int initrd_node, struct meminfo *mi)
  196. {
  197. unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
  198. unsigned long start_pfn, end_pfn, boot_pfn;
  199. unsigned int boot_pages;
  200. pg_data_t *pgdat;
  201. int i;
  202. start_pfn = -1UL;
  203. end_pfn = 0;
  204. /*
  205. * Calculate the pfn range, and map the memory banks for this node.
  206. */
  207. for_each_nodebank(i, mi, node) {
  208. unsigned long start, end;
  209. struct map_desc map;
  210. start = mi->bank[i].start >> PAGE_SHIFT;
  211. end = (mi->bank[i].start + mi->bank[i].size) >> PAGE_SHIFT;
  212. if (start_pfn > start)
  213. start_pfn = start;
  214. if (end_pfn < end)
  215. end_pfn = end;
  216. map.pfn = __phys_to_pfn(mi->bank[i].start);
  217. map.virtual = __phys_to_virt(mi->bank[i].start);
  218. map.length = mi->bank[i].size;
  219. map.type = MT_MEMORY;
  220. create_mapping(&map);
  221. }
  222. /*
  223. * If there is no memory in this node, ignore it.
  224. */
  225. if (end_pfn == 0)
  226. return end_pfn;
  227. /*
  228. * Allocate the bootmem bitmap page.
  229. */
  230. boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
  231. boot_pfn = find_bootmap_pfn(node, mi, boot_pages);
  232. /*
  233. * Initialise the bootmem allocator for this node, handing the
  234. * memory banks over to bootmem.
  235. */
  236. node_set_online(node);
  237. pgdat = NODE_DATA(node);
  238. init_bootmem_node(pgdat, boot_pfn, start_pfn, end_pfn);
  239. for_each_nodebank(i, mi, node)
  240. free_bootmem_node(pgdat, mi->bank[i].start, mi->bank[i].size);
  241. /*
  242. * Reserve the bootmem bitmap for this node.
  243. */
  244. reserve_bootmem_node(pgdat, boot_pfn << PAGE_SHIFT,
  245. boot_pages << PAGE_SHIFT);
  246. #ifdef CONFIG_BLK_DEV_INITRD
  247. /*
  248. * If the initrd is in this node, reserve its memory.
  249. */
  250. if (node == initrd_node) {
  251. reserve_bootmem_node(pgdat, phys_initrd_start,
  252. phys_initrd_size);
  253. initrd_start = __phys_to_virt(phys_initrd_start);
  254. initrd_end = initrd_start + phys_initrd_size;
  255. }
  256. #endif
  257. /*
  258. * Finally, reserve any node zero regions.
  259. */
  260. if (node == 0)
  261. reserve_node_zero(pgdat);
  262. /*
  263. * initialise the zones within this node.
  264. */
  265. memset(zone_size, 0, sizeof(zone_size));
  266. memset(zhole_size, 0, sizeof(zhole_size));
  267. /*
  268. * The size of this node has already been determined. If we need
  269. * to do anything fancy with the allocation of this memory to the
  270. * zones, now is the time to do it.
  271. */
  272. zone_size[0] = end_pfn - start_pfn;
  273. /*
  274. * For each bank in this node, calculate the size of the holes.
  275. * holes = node_size - sum(bank_sizes_in_node)
  276. */
  277. zhole_size[0] = zone_size[0];
  278. for_each_nodebank(i, mi, node)
  279. zhole_size[0] -= mi->bank[i].size >> PAGE_SHIFT;
  280. /*
  281. * Adjust the sizes according to any special requirements for
  282. * this machine type.
  283. */
  284. arch_adjust_zones(node, zone_size, zhole_size);
  285. free_area_init_node(node, pgdat, zone_size, start_pfn, zhole_size);
  286. return end_pfn;
  287. }
  288. static void __init bootmem_init(struct meminfo *mi)
  289. {
  290. unsigned long addr, memend_pfn = 0;
  291. int node, initrd_node, i;
  292. /*
  293. * Invalidate the node number for empty or invalid memory banks
  294. */
  295. for (i = 0; i < mi->nr_banks; i++)
  296. if (mi->bank[i].size == 0 || mi->bank[i].node >= MAX_NUMNODES)
  297. mi->bank[i].node = -1;
  298. memcpy(&meminfo, mi, sizeof(meminfo));
  299. /*
  300. * Clear out all the mappings below the kernel image.
  301. */
  302. for (addr = 0; addr < MODULE_START; addr += PGDIR_SIZE)
  303. pmd_clear(pmd_off_k(addr));
  304. #ifdef CONFIG_XIP_KERNEL
  305. /* The XIP kernel is mapped in the module area -- skip over it */
  306. addr = ((unsigned long)&_etext + PGDIR_SIZE - 1) & PGDIR_MASK;
  307. #endif
  308. for ( ; addr < PAGE_OFFSET; addr += PGDIR_SIZE)
  309. pmd_clear(pmd_off_k(addr));
  310. /*
  311. * Clear out all the kernel space mappings, except for the first
  312. * memory bank, up to the end of the vmalloc region.
  313. */
  314. for (addr = __phys_to_virt(mi->bank[0].start + mi->bank[0].size);
  315. addr < VMALLOC_END; addr += PGDIR_SIZE)
  316. pmd_clear(pmd_off_k(addr));
  317. /*
  318. * Locate which node contains the ramdisk image, if any.
  319. */
  320. initrd_node = check_initrd(mi);
  321. /*
  322. * Run through each node initialising the bootmem allocator.
  323. */
  324. for_each_node(node) {
  325. unsigned long end_pfn;
  326. end_pfn = bootmem_init_node(node, initrd_node, mi);
  327. /*
  328. * Remember the highest memory PFN.
  329. */
  330. if (end_pfn > memend_pfn)
  331. memend_pfn = end_pfn;
  332. }
  333. high_memory = __va(memend_pfn << PAGE_SHIFT);
  334. /*
  335. * This doesn't seem to be used by the Linux memory manager any
  336. * more, but is used by ll_rw_block. If we can get rid of it, we
  337. * also get rid of some of the stuff above as well.
  338. *
  339. * Note: max_low_pfn and max_pfn reflect the number of _pages_ in
  340. * the system, not the maximum PFN.
  341. */
  342. max_pfn = max_low_pfn = memend_pfn - PHYS_PFN_OFFSET;
  343. }
  344. /*
  345. * Set up device the mappings. Since we clear out the page tables for all
  346. * mappings above VMALLOC_END, we will remove any debug device mappings.
  347. * This means you have to be careful how you debug this function, or any
  348. * called function. This means you can't use any function or debugging
  349. * method which may touch any device, otherwise the kernel _will_ crash.
  350. */
  351. static void __init devicemaps_init(struct machine_desc *mdesc)
  352. {
  353. struct map_desc map;
  354. unsigned long addr;
  355. void *vectors;
  356. /*
  357. * Allocate the vector page early.
  358. */
  359. vectors = alloc_bootmem_low_pages(PAGE_SIZE);
  360. BUG_ON(!vectors);
  361. for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE)
  362. pmd_clear(pmd_off_k(addr));
  363. /*
  364. * Map the kernel if it is XIP.
  365. * It is always first in the modulearea.
  366. */
  367. #ifdef CONFIG_XIP_KERNEL
  368. map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PGDIR_MASK);
  369. map.virtual = MODULE_START;
  370. map.length = ((unsigned long)&_etext - map.virtual + ~PGDIR_MASK) & PGDIR_MASK;
  371. map.type = MT_ROM;
  372. create_mapping(&map);
  373. #endif
  374. /*
  375. * Map the cache flushing regions.
  376. */
  377. #ifdef FLUSH_BASE
  378. map.pfn = __phys_to_pfn(FLUSH_BASE_PHYS);
  379. map.virtual = FLUSH_BASE;
  380. map.length = SZ_1M;
  381. map.type = MT_CACHECLEAN;
  382. create_mapping(&map);
  383. #endif
  384. #ifdef FLUSH_BASE_MINICACHE
  385. map.pfn = __phys_to_pfn(FLUSH_BASE_PHYS + SZ_1M);
  386. map.virtual = FLUSH_BASE_MINICACHE;
  387. map.length = SZ_1M;
  388. map.type = MT_MINICLEAN;
  389. create_mapping(&map);
  390. #endif
  391. /*
  392. * Create a mapping for the machine vectors at the high-vectors
  393. * location (0xffff0000). If we aren't using high-vectors, also
  394. * create a mapping at the low-vectors virtual address.
  395. */
  396. map.pfn = __phys_to_pfn(virt_to_phys(vectors));
  397. map.virtual = 0xffff0000;
  398. map.length = PAGE_SIZE;
  399. map.type = MT_HIGH_VECTORS;
  400. create_mapping(&map);
  401. if (!vectors_high()) {
  402. map.virtual = 0;
  403. map.type = MT_LOW_VECTORS;
  404. create_mapping(&map);
  405. }
  406. /*
  407. * Ask the machine support to map in the statically mapped devices.
  408. */
  409. if (mdesc->map_io)
  410. mdesc->map_io();
  411. /*
  412. * Finally flush the caches and tlb to ensure that we're in a
  413. * consistent state wrt the writebuffer. This also ensures that
  414. * any write-allocated cache lines in the vector page are written
  415. * back. After this point, we can start to touch devices again.
  416. */
  417. local_flush_tlb_all();
  418. flush_cache_all();
  419. }
  420. /*
  421. * paging_init() sets up the page tables, initialises the zone memory
  422. * maps, and sets up the zero page, bad page and bad page tables.
  423. */
  424. void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
  425. {
  426. void *zero_page;
  427. build_mem_type_table();
  428. bootmem_init(mi);
  429. devicemaps_init(mdesc);
  430. top_pmd = pmd_off_k(0xffff0000);
  431. /*
  432. * allocate the zero page. Note that we count on this going ok.
  433. */
  434. zero_page = alloc_bootmem_low_pages(PAGE_SIZE);
  435. memzero(zero_page, PAGE_SIZE);
  436. empty_zero_page = virt_to_page(zero_page);
  437. flush_dcache_page(empty_zero_page);
  438. }
  439. static inline void free_area(unsigned long addr, unsigned long end, char *s)
  440. {
  441. unsigned int size = (end - addr) >> 10;
  442. for (; addr < end; addr += PAGE_SIZE) {
  443. struct page *page = virt_to_page(addr);
  444. ClearPageReserved(page);
  445. init_page_count(page);
  446. free_page(addr);
  447. totalram_pages++;
  448. }
  449. if (size && s)
  450. printk(KERN_INFO "Freeing %s memory: %dK\n", s, size);
  451. }
  452. static inline void
  453. free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn)
  454. {
  455. struct page *start_pg, *end_pg;
  456. unsigned long pg, pgend;
  457. /*
  458. * Convert start_pfn/end_pfn to a struct page pointer.
  459. */
  460. start_pg = pfn_to_page(start_pfn);
  461. end_pg = pfn_to_page(end_pfn);
  462. /*
  463. * Convert to physical addresses, and
  464. * round start upwards and end downwards.
  465. */
  466. pg = PAGE_ALIGN(__pa(start_pg));
  467. pgend = __pa(end_pg) & PAGE_MASK;
  468. /*
  469. * If there are free pages between these,
  470. * free the section of the memmap array.
  471. */
  472. if (pg < pgend)
  473. free_bootmem_node(NODE_DATA(node), pg, pgend - pg);
  474. }
  475. /*
  476. * The mem_map array can get very big. Free the unused area of the memory map.
  477. */
  478. static void __init free_unused_memmap_node(int node, struct meminfo *mi)
  479. {
  480. unsigned long bank_start, prev_bank_end = 0;
  481. unsigned int i;
  482. /*
  483. * [FIXME] This relies on each bank being in address order. This
  484. * may not be the case, especially if the user has provided the
  485. * information on the command line.
  486. */
  487. for_each_nodebank(i, mi, node) {
  488. bank_start = mi->bank[i].start >> PAGE_SHIFT;
  489. if (bank_start < prev_bank_end) {
  490. printk(KERN_ERR "MEM: unordered memory banks. "
  491. "Not freeing memmap.\n");
  492. break;
  493. }
  494. /*
  495. * If we had a previous bank, and there is a space
  496. * between the current bank and the previous, free it.
  497. */
  498. if (prev_bank_end && prev_bank_end != bank_start)
  499. free_memmap(node, prev_bank_end, bank_start);
  500. prev_bank_end = (mi->bank[i].start +
  501. mi->bank[i].size) >> PAGE_SHIFT;
  502. }
  503. }
  504. /*
  505. * mem_init() marks the free areas in the mem_map and tells us how much
  506. * memory is free. This is done after various parts of the system have
  507. * claimed their memory after the kernel image.
  508. */
  509. void __init mem_init(void)
  510. {
  511. unsigned int codepages, datapages, initpages;
  512. int i, node;
  513. codepages = &_etext - &_text;
  514. datapages = &_end - &__data_start;
  515. initpages = &__init_end - &__init_begin;
  516. #ifndef CONFIG_DISCONTIGMEM
  517. max_mapnr = virt_to_page(high_memory) - mem_map;
  518. #endif
  519. /* this will put all unused low memory onto the freelists */
  520. for_each_online_node(node) {
  521. pg_data_t *pgdat = NODE_DATA(node);
  522. free_unused_memmap_node(node, &meminfo);
  523. if (pgdat->node_spanned_pages != 0)
  524. totalram_pages += free_all_bootmem_node(pgdat);
  525. }
  526. #ifdef CONFIG_SA1111
  527. /* now that our DMA memory is actually so designated, we can free it */
  528. free_area(PAGE_OFFSET, (unsigned long)swapper_pg_dir, NULL);
  529. #endif
  530. /*
  531. * Since our memory may not be contiguous, calculate the
  532. * real number of pages we have in this system
  533. */
  534. printk(KERN_INFO "Memory:");
  535. num_physpages = 0;
  536. for (i = 0; i < meminfo.nr_banks; i++) {
  537. num_physpages += meminfo.bank[i].size >> PAGE_SHIFT;
  538. printk(" %ldMB", meminfo.bank[i].size >> 20);
  539. }
  540. printk(" = %luMB total\n", num_physpages >> (20 - PAGE_SHIFT));
  541. printk(KERN_NOTICE "Memory: %luKB available (%dK code, "
  542. "%dK data, %dK init)\n",
  543. (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
  544. codepages >> 10, datapages >> 10, initpages >> 10);
  545. if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
  546. extern int sysctl_overcommit_memory;
  547. /*
  548. * On a machine this small we won't get
  549. * anywhere without overcommit, so turn
  550. * it on by default.
  551. */
  552. sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
  553. }
  554. }
  555. void free_initmem(void)
  556. {
  557. if (!machine_is_integrator() && !machine_is_cintegrator()) {
  558. free_area((unsigned long)(&__init_begin),
  559. (unsigned long)(&__init_end),
  560. "init");
  561. }
  562. }
  563. #ifdef CONFIG_BLK_DEV_INITRD
  564. static int keep_initrd;
  565. void free_initrd_mem(unsigned long start, unsigned long end)
  566. {
  567. if (!keep_initrd)
  568. free_area(start, end, "initrd");
  569. }
  570. static int __init keepinitrd_setup(char *__unused)
  571. {
  572. keep_initrd = 1;
  573. return 1;
  574. }
  575. __setup("keepinitrd", keepinitrd_setup);
  576. #endif