13 #include <linux/module.h>
14 #include <linux/signal.h>
15 #include <linux/sched.h>
17 #include <linux/kernel.h>
18 #include <linux/errno.h>
19 #include <linux/string.h>
20 #include <linux/types.h>
22 #include <linux/ptrace.h>
23 #include <linux/mman.h>
33 #include <asm/asm-offsets.h>
34 #include <asm/bootinfo.h>
35 #include <asm/cachectl.h>
38 #include <asm/kmap_types.h>
39 #include <asm/mmu_context.h>
40 #include <asm/sections.h>
41 #include <asm/pgtable.h>
42 #include <asm/pgalloc.h>
44 #include <asm/fixmap.h>
47 #ifdef CONFIG_MIPS_MT_SMTC
51 #define ENTER_CRITICAL(flags) \
53 unsigned int mvpflags; \
54 local_irq_save(flags);\
56 #define EXIT_CRITICAL(flags) \
58 local_irq_restore(flags); \
62 #define ENTER_CRITICAL(flags) local_irq_save(flags)
63 #define EXIT_CRITICAL(flags) local_irq_restore(flags)
93 panic(
"Oh boy, that early out of memory?");
98 SetPageReserved(page);
108 #ifdef CONFIG_MIPS_MT_SMTC
109 static pte_t *kmap_coherent_pte;
110 static void __init kmap_coherent_init(
void)
119 static inline void kmap_coherent_init(
void) {}
126 unsigned long old_ctx;
134 #ifdef CONFIG_MIPS_MT_SMTC
142 #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
145 entrylo = pte_to_entrylo(
pte_val(pte));
153 #ifdef CONFIG_MIPS_MT_SMTC
176 return (
void*)
vaddr;
179 #define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
183 #ifndef CONFIG_MIPS_MT_SMTC
185 unsigned long flags, old_ctx;
222 pages_do_alias((
unsigned long)vto, vaddr &
PAGE_MASK))
266 #if defined(CONFIG_HIGHMEM) || defined(CONFIG_MIPS_MT_SMTC)
280 for ( ; (i <
PTRS_PER_PGD) && (vaddr < end); pgd++, i++) {
282 for ( ; (j <
PTRS_PER_PUD) && (vaddr < end); pud++, j++) {
284 for (; (k <
PTRS_PER_PMD) && (vaddr < end); pmd++, k++) {
299 #ifndef CONFIG_NEED_MULTIPLE_NODES
320 if (pagenr >= addr && pagenr < end)
329 unsigned long max_zone_pfns[MAX_NR_ZONES];
334 #ifdef CONFIG_HIGHMEM
337 kmap_coherent_init();
339 #ifdef CONFIG_ZONE_DMA
342 #ifdef CONFIG_ZONE_DMA32
347 #ifdef CONFIG_HIGHMEM
353 " %ldk highmem ignored\n",
360 free_area_init_nodes(max_zone_pfns);
369 unsigned long codesize, reservedpages, datasize, initsize;
370 unsigned long tmp, ram;
372 #ifdef CONFIG_HIGHMEM
373 #ifdef CONFIG_DISCONTIGMEM
374 #error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
385 reservedpages = ram = 0;
394 #ifdef CONFIG_HIGHMEM
399 SetPageReserved(page);
402 ClearPageReserved(page);
403 init_page_count(page);
424 "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
443 ClearPageReserved(page);
444 init_page_count(page);
449 printk(
KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
452 #ifdef CONFIG_BLK_DEV_INITRD
469 #ifndef CONFIG_MIPS_PGD_C0_CONTEXT
485 #ifndef __PAGETABLE_PMD_FOLDED