mirror of
https://github.com/torvalds/linux.git
synced 2024-12-15 15:41:58 +00:00
26dd3e4ff9
Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file. This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. In the case of some code where it is modular, we can extend that to also include files that are building basic support functionality but not related to loading or registering the final module; such files also have no need whatsoever for module.h The advantage in removing such instances is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using. Since module.h might have been the implicit source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each instance for the presence of either and replace/add as needed. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. Build coverage of all the mips defconfigs revealed the module.h header was masking a couple of implicit include instances, so we add the appropriate headers there. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: David Daney <david.daney@cavium.com> Cc: John Crispin <john@phrozen.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: "Steven J. Hill" <steven.hill@cavium.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/15131/ [james.hogan@imgtec.com: Preserve sort order where it already exists] Signed-off-by: James Hogan <james.hogan@imgtec.com>
70 lines
1.8 KiB
C
70 lines
1.8 KiB
C
/*
|
|
* Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
|
|
* Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
#include <linux/bootmem.h>
|
|
#include <linux/init.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/pfn.h>
|
|
#include <linux/proc_fs.h>
|
|
#include <linux/string.h>
|
|
#include <linux/swap.h>
|
|
|
|
#include <asm/bootinfo.h>
|
|
#include <asm/page.h>
|
|
#include <asm/sections.h>
|
|
|
|
#include <asm/mach-ar7/ar7.h>
|
|
|
|
static int __init memsize(void)
|
|
{
|
|
u32 size = (64 << 20);
|
|
u32 *addr = (u32 *)KSEG1ADDR(AR7_SDRAM_BASE + size - 4);
|
|
u32 *kernel_end = (u32 *)KSEG1ADDR(CPHYSADDR((u32)&_end));
|
|
u32 *tmpaddr = addr;
|
|
|
|
while (tmpaddr > kernel_end) {
|
|
*tmpaddr = (u32)tmpaddr;
|
|
size >>= 1;
|
|
tmpaddr -= size >> 2;
|
|
}
|
|
|
|
do {
|
|
tmpaddr += size >> 2;
|
|
if (*tmpaddr != (u32)tmpaddr)
|
|
break;
|
|
size <<= 1;
|
|
} while (size < (64 << 20));
|
|
|
|
writel((u32)tmpaddr, &addr);
|
|
|
|
return size;
|
|
}
|
|
|
|
void __init prom_meminit(void)
|
|
{
|
|
unsigned long pages;
|
|
|
|
pages = memsize() >> PAGE_SHIFT;
|
|
add_memory_region(PHYS_OFFSET, pages << PAGE_SHIFT, BOOT_MEM_RAM);
|
|
}
|
|
|
|
void __init prom_free_prom_memory(void)
|
|
{
|
|
/* Nothing to free */
|
|
}
|