mirror of
https://github.com/torvalds/linux.git
synced 2026-12-02 11:34:58 +00:00
Patch series "mm: cleanup usage of <asm/pgalloc.h>"
Most architectures have very similar versions of pXd_alloc_one() and
pXd_free_one() for intermediate levels of page table. These patches add
generic versions of these functions in <asm-generic/pgalloc.h> and enable
use of the generic functions where appropriate.
In addition, functions declared and defined in <asm/pgalloc.h> headers are
used mostly by core mm and early mm initialization in arch and there is no
actual reason to have the <asm/pgalloc.h> included all over the place.
The first patch in this series removes unneeded includes of
<asm/pgalloc.h>
In the end it didn't work out as neatly as I hoped and moving
pXd_alloc_track() definitions to <asm-generic/pgalloc.h> would require
unnecessary changes to arches that have custom page table allocations, so
I've decided to move lib/ioremap.c to mm/ and make pgalloc-track.h local
to mm/.
This patch (of 8):
In most cases <asm/pgalloc.h> header is required only for allocations of
page table memory. Most of the .c files that include that header do not
use symbols declared in <asm/pgalloc.h> and do not require that header.
As for the other header files that used to include <asm/pgalloc.h>, it is
possible to move that include into the .c file that actually uses symbols
from <asm/pgalloc.h> and drop the include from the header file.
The process was somewhat automated using
sed -i -E '/[<"]asm\/pgalloc\.h/d' \
$(grep -L -w -f /tmp/xx \
$(git grep -E -l '[<"]asm/pgalloc\.h'))
where /tmp/xx contains all the symbols defined in
arch/*/include/asm/pgalloc.h.
[[email protected]: fix powerpc warning]
Signed-off-by: Mike Rapoport <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Pekka Enberg <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]> [m68k]
Cc: Abdul Haleem <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Max Filippov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Satheesh Rajendran <[email protected]>
Cc: Stafford Horne <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
/*
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
* for more details.
|
|
*
|
|
* Copyright (C) 2003 Keith M Wesolowski
|
|
* Copyright (C) 2005 Ilya A. Volynets (Total Knowledge)
|
|
*/
|
|
#include <linux/types.h>
|
|
#include <linux/init.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/mm.h>
|
|
|
|
#include <asm/ip32/crime.h>
|
|
#include <asm/bootinfo.h>
|
|
#include <asm/page.h>
|
|
|
|
extern void crime_init(void);
|
|
|
|
void __init prom_meminit(void)
|
|
{
|
|
u64 base, size;
|
|
int bank;
|
|
|
|
crime_init();
|
|
|
|
for (bank=0; bank < CRIME_MAXBANKS; bank++) {
|
|
u64 bankctl = crime->bank_ctrl[bank];
|
|
base = (bankctl & CRIME_MEM_BANK_CONTROL_ADDR) << 25;
|
|
if (bank != 0 && base == 0)
|
|
continue;
|
|
size = (bankctl & CRIME_MEM_BANK_CONTROL_SDRAM_SIZE) ? 128 : 32;
|
|
size <<= 20;
|
|
if (base + size > (256 << 20))
|
|
base += CRIME_HI_MEM_BASE;
|
|
|
|
printk("CRIME MC: bank %u base 0x%016Lx size %LuMiB\n",
|
|
bank, base, size >> 20);
|
|
add_memory_region(base, size, BOOT_MEM_RAM);
|
|
}
|
|
}
|
|
|
|
|
|
void __init prom_free_prom_memory(void)
|
|
{
|
|
}
|