Skip to content

Commit ab1f9da

Browse files
committed
powerpc: Merge arch/ppc64/mm to arch/powerpc/mm
This moves the remaining files in arch/ppc64/mm to arch/powerpc/mm, and arranges that we use them when compiling with ARCH=ppc64. Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 70d64ce commit ab1f9da

20 files changed

+39
-1288
lines changed

arch/powerpc/mm/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
obj-y := fault.o mem.o lmb.o
66
obj-$(CONFIG_PPC32) += init_32.o pgtable_32.o mmu_context_32.o \
77
tlb_32.o
8-
obj-$(CONFIG_PPC64) += init_64.o pgtable_64.o mmu_context_64.o
8+
hash-$(CONFIG_PPC_MULTIPLATFORM) := hash_native_64.o
9+
obj-$(CONFIG_PPC64) += init_64.o pgtable_64.o mmu_context_64.o \
10+
hash_utils_64.o hash_low_64.o tlb_64.o \
11+
slb_low.o slb.o stab.o mmap.o imalloc.o \
12+
$(hash-y)
913
obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o hash_low_32.o
1014
obj-$(CONFIG_40x) += 4xx_mmu.o
1115
obj-$(CONFIG_44x) += 44x_mmu.o
1216
obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o
17+
obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
18+
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o

arch/ppc64/mm/hash_low.S renamed to arch/powerpc/mm/hash_low_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* described in the kernel's COPYING file.
1111
*/
1212

13-
#include <asm/processor.h>
13+
#include <asm/reg.h>
1414
#include <asm/pgtable.h>
1515
#include <asm/mmu.h>
1616
#include <asm/page.h>
File renamed without changes.

arch/ppc64/mm/hash_utils.c renamed to arch/powerpc/mm/hash_utils_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ extern unsigned long dart_tablebase;
7878
hpte_t *htab_address;
7979
unsigned long htab_hash_mask;
8080

81-
extern unsigned long _SDR1;
81+
unsigned long _SDR1;
8282

8383
#define KB (1024)
8484
#define MB (1024*KB)
File renamed without changes.
File renamed without changes.

arch/powerpc/mm/init_64.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,8 @@
7373
#warning TASK_SIZE is smaller than it needs to be.
7474
#endif
7575

76-
int mem_init_done;
77-
unsigned long ioremap_bot = IMALLOC_BASE;
78-
static unsigned long phbs_io_bot = PHBS_IO_BASE;
79-
80-
extern pgd_t swapper_pg_dir[];
81-
extern struct task_struct *current_set[NR_CPUS];
82-
8376
unsigned long klimit = (unsigned long)_end;
8477

85-
unsigned long _SDR1=0;
86-
unsigned long _ASR=0;
87-
8878
/* max amount of RAM to use */
8979
unsigned long __max_memory;
9080

@@ -193,19 +183,6 @@ static int __init setup_kcore(void)
193183
}
194184
module_init(setup_kcore);
195185

196-
void __iomem * reserve_phb_iospace(unsigned long size)
197-
{
198-
void __iomem *virt_addr;
199-
200-
if (phbs_io_bot >= IMALLOC_BASE)
201-
panic("reserve_phb_iospace(): phb io space overflow\n");
202-
203-
virt_addr = (void __iomem *) phbs_io_bot;
204-
phbs_io_bot += size;
205-
206-
return virt_addr;
207-
}
208-
209186
static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags)
210187
{
211188
memset(addr, 0, kmem_cache_size(cache));
@@ -244,16 +221,3 @@ void pgtable_cache_init(void)
244221
name);
245222
}
246223
}
247-
248-
pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr,
249-
unsigned long size, pgprot_t vma_prot)
250-
{
251-
if (ppc_md.phys_mem_access_prot)
252-
return ppc_md.phys_mem_access_prot(file, addr, size, vma_prot);
253-
254-
if (!page_is_ram(addr >> PAGE_SHIFT))
255-
vma_prot = __pgprot(pgprot_val(vma_prot)
256-
| _PAGE_GUARDED | _PAGE_NO_CACHE);
257-
return vma_prot;
258-
}
259-
EXPORT_SYMBOL(phys_mem_access_prot);

arch/powerpc/mm/mem.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
#include <asm/prom.h>
4848
#include <asm/lmb.h>
4949
#include <asm/sections.h>
50+
#ifdef CONFIG_PPC64
51+
#include <asm/vdso.h>
52+
#endif
5053

5154
#include "mmu_decl.h"
5255

@@ -334,7 +337,7 @@ void flush_dcache_icache_page(struct page *page)
334337
void *start = kmap_atomic(page, KM_PPC_SYNC_ICACHE);
335338
__flush_dcache_icache(start);
336339
kunmap_atomic(start, KM_PPC_SYNC_ICACHE);
337-
#elif defined(CONFIG_8xx)
340+
#elif defined(CONFIG_8xx) || defined(CONFIG_PPC64)
338341
/* On 8xx there is no need to kmap since highmem is not supported */
339342
__flush_dcache_icache(page_address(page));
340343
#else
@@ -463,18 +466,18 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
463466
if (pgdir == NULL)
464467
return;
465468

466-
ptep = find_linux_pte(pgdir, ea);
469+
ptep = find_linux_pte(pgdir, address);
467470
if (!ptep)
468471
return;
469472

470-
vsid = get_vsid(vma->vm_mm->context.id, ea);
473+
vsid = get_vsid(vma->vm_mm->context.id, address);
471474

472475
local_irq_save(flags);
473476
tmp = cpumask_of_cpu(smp_processor_id());
474477
if (cpus_equal(vma->vm_mm->cpu_vm_mask, tmp))
475478
local = 1;
476479

477-
__hash_page(ea, pte_val(pte) & (_PAGE_USER|_PAGE_RW), vsid, ptep,
480+
__hash_page(address, pte_val(pte) & (_PAGE_USER|_PAGE_RW), vsid, ptep,
478481
0x300, local);
479482
local_irq_restore(flags);
480483
#endif
File renamed without changes.

arch/powerpc/mm/mmu_decl.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
#include <asm/tlbflush.h>
2323
#include <asm/mmu.h>
2424

25+
#ifdef CONFIG_PPC32
2526
extern void mapin_ram(void);
2627
extern int map_page(unsigned long va, phys_addr_t pa, int flags);
2728
extern void setbat(int index, unsigned long virt, unsigned long phys,
2829
unsigned int size, int flags);
29-
extern void reserve_phys_mem(unsigned long start, unsigned long size);
3030
extern void settlbcam(int index, unsigned long virt, phys_addr_t phys,
3131
unsigned int size, int flags, unsigned int pid);
3232
extern void invalidate_tlbcam_entry(int index);
@@ -36,16 +36,16 @@ extern unsigned long ioremap_base;
3636
extern unsigned long ioremap_bot;
3737
extern unsigned int rtas_data, rtas_size;
3838

39-
extern unsigned long __max_low_memory;
40-
extern unsigned long __initial_memory_limit;
41-
extern unsigned long total_memory;
42-
extern unsigned long total_lowmem;
43-
extern int mem_init_done;
44-
4539
extern PTE *Hash, *Hash_end;
4640
extern unsigned long Hash_size, Hash_mask;
4741

4842
extern unsigned int num_tlbcam_entries;
43+
#endif
44+
45+
extern unsigned long __max_low_memory;
46+
extern unsigned long __initial_memory_limit;
47+
extern unsigned long total_memory;
48+
extern unsigned long total_lowmem;
4949

5050
/* ...and now those things that may be slightly different between processor
5151
* architectures. -- Dan
@@ -66,8 +66,8 @@ extern void MMU_init_hw(void);
6666
extern unsigned long mmu_mapin_ram(void);
6767
extern void adjust_total_lowmem(void);
6868

69-
#else
70-
/* anything except 4xx or 8xx */
69+
#elif defined(CONFIG_PPC32)
70+
/* anything 32-bit except 4xx or 8xx */
7171
extern void MMU_init_hw(void);
7272
extern unsigned long mmu_mapin_ram(void);
7373

File renamed without changes.

arch/powerpc/mm/pgtable_64.c

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,30 +67,9 @@
6767
#include <asm/vdso.h>
6868
#include <asm/imalloc.h>
6969

70-
#if PGTABLE_RANGE > USER_VSID_RANGE
71-
#warning Limited user VSID range means pagetable space is wasted
72-
#endif
73-
74-
#if (TASK_SIZE_USER64 < PGTABLE_RANGE) && (TASK_SIZE_USER64 < USER_VSID_RANGE)
75-
#warning TASK_SIZE is smaller than it needs to be.
76-
#endif
77-
78-
int mem_init_done;
7970
unsigned long ioremap_bot = IMALLOC_BASE;
8071
static unsigned long phbs_io_bot = PHBS_IO_BASE;
8172

82-
extern pgd_t swapper_pg_dir[];
83-
extern struct task_struct *current_set[NR_CPUS];
84-
85-
unsigned long klimit = (unsigned long)_end;
86-
87-
/* max amount of RAM to use */
88-
unsigned long __max_memory;
89-
90-
/* info on what we think the IO hole is */
91-
unsigned long io_hole_start;
92-
unsigned long io_hole_size;
93-
9473
#ifdef CONFIG_PPC_ISERIES
9574

9675
void __iomem *ioremap(unsigned long addr, unsigned long size)
@@ -355,3 +334,16 @@ int iounmap_explicit(volatile void __iomem *start, unsigned long size)
355334
EXPORT_SYMBOL(ioremap);
356335
EXPORT_SYMBOL(__ioremap);
357336
EXPORT_SYMBOL(iounmap);
337+
338+
void __iomem * reserve_phb_iospace(unsigned long size)
339+
{
340+
void __iomem *virt_addr;
341+
342+
if (phbs_io_bot >= IMALLOC_BASE)
343+
panic("reserve_phb_iospace(): phb io space overflow\n");
344+
345+
virt_addr = (void __iomem *) phbs_io_bot;
346+
phbs_io_bot += size;
347+
348+
return virt_addr;
349+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

arch/ppc64/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ head-y := arch/ppc64/kernel/head.o
8383

8484
libs-y += arch/ppc64/lib/
8585
core-y += arch/ppc64/kernel/ arch/powerpc/kernel/
86-
core-y += arch/ppc64/mm/
86+
core-y += arch/powerpc/mm/
8787
core-y += arch/powerpc/platforms/
8888
core-$(CONFIG_XMON) += arch/ppc64/xmon/
8989
drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/

arch/ppc64/mm/Makefile

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)