Skip to content

Commit 40ef8cb

Browse files
committed
powerpc: Get 64-bit configs to compile with ARCH=powerpc
This is a bunch of mostly small fixes that are needed to get ARCH=powerpc to compile for 64-bit. This adds setup_64.c from arch/ppc64/kernel/setup.c and locks.c from arch/ppc64/lib/locks.c. Signed-off-by: Paul Mackerras <[email protected]>
1 parent bc6f8a4 commit 40ef8cb

File tree

22 files changed

+1631
-104
lines changed

22 files changed

+1631
-104
lines changed

arch/powerpc/kernel/Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ CFLAGS_prom_init.o += -fPIC
1010
CFLAGS_btext.o += -fPIC
1111
endif
1212

13+
obj-y := semaphore.o traps.o
14+
obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
15+
obj-$(CONFIG_POWER4) += idle_power4.o
16+
17+
ifeq ($(CONFIG_PPC_MERGE),y)
18+
1319
extra-$(CONFIG_PPC_STD_MMU) := head_32.o
1420
extra-$(CONFIG_PPC64) := head_64.o
1521
extra-$(CONFIG_40x) := head_4xx.o
@@ -21,15 +27,12 @@ extra-$(CONFIG_PPC64) += entry_64.o
2127
extra-$(CONFIG_PPC_FPU) += fpu.o
2228
extra-y += vmlinux.lds
2329

24-
obj-y += traps.o prom.o semaphore.o
30+
obj-y += process.o init_task.o \
31+
prom.o systbl.o
2532
obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o
26-
obj-$(CONFIG_PPC64) += idle_power4.o
27-
obj-$(CONFIG_PPC64) += misc_64.o
28-
ifeq ($(CONFIG_PPC32),y)
33+
obj-$(CONFIG_PPC64) += setup_64.o misc_64.o
2934
obj-$(CONFIG_PPC_OF) += prom_init.o of_device.o
3035
obj-$(CONFIG_MODULES) += ppc_ksyms.o
31-
endif
32-
obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
3336
obj-$(CONFIG_BOOTX_TEXT) += btext.o
3437

3538
ifeq ($(CONFIG_PPC_ISERIES),y)

arch/powerpc/kernel/asm-offsets.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ int main(void)
111111
DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
112112
DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
113113
DEFINE(PLATFORM, offsetof(struct systemcfg, platform));
114+
DEFINE(PLATFORM_LPAR, PLATFORM_LPAR);
114115

115116
/* paca */
116117
DEFINE(PACA_SIZE, sizeof(struct paca_struct));

arch/powerpc/kernel/btext.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static unsigned char vga_font[cmapsz];
5050
int boot_text_mapped;
5151
int force_printk_to_btext = 0;
5252

53-
53+
#ifdef CONFIG_PPC32
5454
/* Calc BAT values for mapping the display and store them
5555
* in disp_BAT. Those values are then used from head.S to map
5656
* the display during identify_machine() and MMU_Init()
@@ -93,6 +93,7 @@ btext_prepare_BAT(void)
9393
}
9494
logicalDisplayBase = (void *) (vaddr + lowbits);
9595
}
96+
#endif
9697

9798
/* This function will enable the early boot text when doing OF booting. This
9899
* way, xmon output should work too

arch/powerpc/kernel/head_64.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,7 @@ bad_stack:
746746
* any task or sent any task a signal, you should use
747747
* ret_from_except or ret_from_except_lite instead of this.
748748
*/
749+
.globl fast_exception_return
749750
fast_exception_return:
750751
ld r12,_MSR(r1)
751752
ld r11,_NIP(r1)

arch/powerpc/kernel/ppc_ksyms.c

Lines changed: 40 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include <asm/commproc.h>
5252
#endif
5353

54+
#ifdef CONFIG_PPC32
5455
extern void transfer_to_handler(void);
5556
extern void do_IRQ(struct pt_regs *regs);
5657
extern void machine_check_exception(struct pt_regs *regs);
@@ -61,14 +62,12 @@ extern int do_signal(sigset_t *, struct pt_regs *);
6162
extern int pmac_newworld;
6263
extern int sys_sigreturn(struct pt_regs *regs);
6364

64-
long long __ashrdi3(long long, int);
65-
long long __ashldi3(long long, int);
66-
long long __lshrdi3(long long, int);
67-
68-
extern unsigned long mm_ptov (unsigned long paddr);
69-
7065
EXPORT_SYMBOL(clear_pages);
71-
EXPORT_SYMBOL(clear_user_page);
66+
EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
67+
EXPORT_SYMBOL(DMA_MODE_READ);
68+
EXPORT_SYMBOL(DMA_MODE_WRITE);
69+
EXPORT_SYMBOL(__div64_32);
70+
7271
EXPORT_SYMBOL(do_signal);
7372
EXPORT_SYMBOL(transfer_to_handler);
7473
EXPORT_SYMBOL(do_IRQ);
@@ -77,12 +76,8 @@ EXPORT_SYMBOL(alignment_exception);
7776
EXPORT_SYMBOL(program_check_exception);
7877
EXPORT_SYMBOL(single_step_exception);
7978
EXPORT_SYMBOL(sys_sigreturn);
80-
EXPORT_SYMBOL(ppc_n_lost_interrupts);
81-
EXPORT_SYMBOL(ppc_lost_interrupts);
79+
#endif
8280

83-
EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
84-
EXPORT_SYMBOL(DMA_MODE_READ);
85-
EXPORT_SYMBOL(DMA_MODE_WRITE);
8681
#if defined(CONFIG_PPC_PREP)
8782
EXPORT_SYMBOL(_prep_type);
8883
EXPORT_SYMBOL(ucSystemType);
@@ -110,7 +105,6 @@ EXPORT_SYMBOL(strnlen);
110105
EXPORT_SYMBOL(strcmp);
111106
EXPORT_SYMBOL(strncmp);
112107
EXPORT_SYMBOL(strcasecmp);
113-
EXPORT_SYMBOL(__div64_32);
114108

115109
EXPORT_SYMBOL(csum_partial);
116110
EXPORT_SYMBOL(csum_partial_copy_generic);
@@ -132,21 +126,21 @@ EXPORT_SYMBOL(_insw_ns);
132126
EXPORT_SYMBOL(_outsw_ns);
133127
EXPORT_SYMBOL(_insl_ns);
134128
EXPORT_SYMBOL(_outsl_ns);
135-
EXPORT_SYMBOL(iopa);
136-
EXPORT_SYMBOL(mm_ptov);
137129
EXPORT_SYMBOL(ioremap);
138130
#ifdef CONFIG_44x
139131
EXPORT_SYMBOL(ioremap64);
140132
#endif
141133
EXPORT_SYMBOL(__ioremap);
142134
EXPORT_SYMBOL(iounmap);
135+
#ifdef CONFIG_PPC32
143136
EXPORT_SYMBOL(ioremap_bot); /* aka VMALLOC_END */
137+
#endif
144138

145-
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
139+
#if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE))
146140
EXPORT_SYMBOL(ppc_ide_md);
147141
#endif
148142

149-
#ifdef CONFIG_PCI
143+
#if defined(CONFIG_PCI) && defined(CONFIG_PPC32)
150144
EXPORT_SYMBOL(isa_io_base);
151145
EXPORT_SYMBOL(isa_mem_base);
152146
EXPORT_SYMBOL(pci_dram_offset);
@@ -168,31 +162,31 @@ EXPORT_SYMBOL(flush_dcache_all);
168162
EXPORT_SYMBOL(start_thread);
169163
EXPORT_SYMBOL(kernel_thread);
170164

171-
EXPORT_SYMBOL(flush_instruction_cache);
172165
EXPORT_SYMBOL(giveup_fpu);
166+
#ifdef CONFIG_ALTIVEC
167+
EXPORT_SYMBOL(giveup_altivec);
168+
#endif /* CONFIG_ALTIVEC */
169+
#ifdef CONFIG_SPE
170+
EXPORT_SYMBOL(giveup_spe);
171+
#endif /* CONFIG_SPE */
172+
173173
#ifdef CONFIG_PPC64
174174
EXPORT_SYMBOL(__flush_icache_range);
175175
#else
176+
EXPORT_SYMBOL(flush_instruction_cache);
176177
EXPORT_SYMBOL(flush_icache_range);
177-
#endif
178-
EXPORT_SYMBOL(flush_dcache_range);
179-
EXPORT_SYMBOL(flush_icache_user_range);
180-
EXPORT_SYMBOL(flush_dcache_page);
181178
EXPORT_SYMBOL(flush_tlb_kernel_range);
182179
EXPORT_SYMBOL(flush_tlb_page);
183180
EXPORT_SYMBOL(_tlbie);
184-
#ifdef CONFIG_ALTIVEC
185-
EXPORT_SYMBOL(giveup_altivec);
186-
#endif /* CONFIG_ALTIVEC */
187-
#ifdef CONFIG_SPE
188-
EXPORT_SYMBOL(giveup_spe);
189-
#endif /* CONFIG_SPE */
181+
#endif
182+
EXPORT_SYMBOL(flush_dcache_range);
183+
190184
#ifdef CONFIG_SMP
191185
EXPORT_SYMBOL(smp_call_function);
186+
#ifdef CONFIG_PPC32
192187
EXPORT_SYMBOL(smp_hw_index);
193188
#endif
194-
195-
EXPORT_SYMBOL(ppc_md);
189+
#endif
196190

197191
#ifdef CONFIG_ADB
198192
EXPORT_SYMBOL(adb_request);
@@ -205,25 +199,27 @@ EXPORT_SYMBOL(adb_try_handler_change);
205199
EXPORT_SYMBOL(cuda_request);
206200
EXPORT_SYMBOL(cuda_poll);
207201
#endif /* CONFIG_ADB_CUDA */
208-
#ifdef CONFIG_PPC_MULTIPLATFORM
202+
#if defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_PPC32)
209203
EXPORT_SYMBOL(_machine);
210204
#endif
211205
#ifdef CONFIG_PPC_PMAC
212206
EXPORT_SYMBOL(sys_ctrler);
213-
EXPORT_SYMBOL(pmac_newworld);
214207
#endif
215208
#ifdef CONFIG_VT
216209
EXPORT_SYMBOL(kd_mksound);
217210
#endif
218211
EXPORT_SYMBOL(to_tm);
219212

220-
EXPORT_SYMBOL(pm_power_off);
221-
213+
#ifdef CONFIG_PPC32
214+
long long __ashrdi3(long long, int);
215+
long long __ashldi3(long long, int);
216+
long long __lshrdi3(long long, int);
222217
EXPORT_SYMBOL(__ashrdi3);
223218
EXPORT_SYMBOL(__ashldi3);
224219
EXPORT_SYMBOL(__lshrdi3);
220+
#endif
221+
225222
EXPORT_SYMBOL(memcpy);
226-
EXPORT_SYMBOL(cacheable_memcpy);
227223
EXPORT_SYMBOL(memset);
228224
EXPORT_SYMBOL(memmove);
229225
EXPORT_SYMBOL(memscan);
@@ -234,17 +230,14 @@ EXPORT_SYMBOL(memchr);
234230
EXPORT_SYMBOL(screen_info);
235231
#endif
236232

233+
#ifdef CONFIG_PPC32
234+
EXPORT_SYMBOL(pm_power_off);
237235
EXPORT_SYMBOL(__delay);
238236
EXPORT_SYMBOL(timer_interrupt);
239237
EXPORT_SYMBOL(irq_desc);
240238
EXPORT_SYMBOL(tb_ticks_per_jiffy);
241-
EXPORT_SYMBOL(get_wchan);
242239
EXPORT_SYMBOL(console_drivers);
243-
244-
#ifdef CONFIG_PPC_ISERIES
245-
EXPORT_SYMBOL(local_irq_disable);
246-
EXPORT_SYMBOL(local_irq_enable);
247-
EXPORT_SYMBOL(local_get_flags);
240+
EXPORT_SYMBOL(cacheable_memcpy);
248241
#endif
249242

250243
#ifdef CONFIG_XMON
@@ -255,22 +248,6 @@ EXPORT_SYMBOL(__up);
255248
EXPORT_SYMBOL(__down);
256249
EXPORT_SYMBOL(__down_interruptible);
257250

258-
#if defined(CONFIG_KGDB) || defined(CONFIG_XMON)
259-
extern void (*debugger)(struct pt_regs *regs);
260-
extern int (*debugger_bpt)(struct pt_regs *regs);
261-
extern int (*debugger_sstep)(struct pt_regs *regs);
262-
extern int (*debugger_iabr_match)(struct pt_regs *regs);
263-
extern int (*debugger_dabr_match)(struct pt_regs *regs);
264-
extern void (*debugger_fault_handler)(struct pt_regs *regs);
265-
266-
EXPORT_SYMBOL(debugger);
267-
EXPORT_SYMBOL(debugger_bpt);
268-
EXPORT_SYMBOL(debugger_sstep);
269-
EXPORT_SYMBOL(debugger_iabr_match);
270-
EXPORT_SYMBOL(debugger_dabr_match);
271-
EXPORT_SYMBOL(debugger_fault_handler);
272-
#endif
273-
274251
#ifdef CONFIG_8xx
275252
EXPORT_SYMBOL(cpm_install_handler);
276253
EXPORT_SYMBOL(cpm_free_handler);
@@ -280,22 +257,24 @@ EXPORT_SYMBOL(cpm_free_handler);
280257
EXPORT_SYMBOL(__res);
281258
#endif
282259

260+
#ifdef CONFIG_PPC32
283261
EXPORT_SYMBOL(next_mmu_context);
284262
EXPORT_SYMBOL(set_context);
285-
EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */
286263
EXPORT_SYMBOL(disarm_decr);
287-
#ifdef CONFIG_PPC_STD_MMU
264+
#endif
265+
266+
#ifdef CONFIG_PPC_STD_MMU_32
288267
extern long mol_trampoline;
289268
EXPORT_SYMBOL(mol_trampoline); /* For MOL */
290269
EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
270+
EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */
291271
#ifdef CONFIG_SMP
292272
extern int mmu_hash_lock;
293273
EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
294274
#endif /* CONFIG_SMP */
295275
extern long *intercept_table;
296276
EXPORT_SYMBOL(intercept_table);
297-
#endif /* CONFIG_PPC_STD_MMU */
298-
EXPORT_SYMBOL(cur_cpu_spec);
277+
#endif /* CONFIG_PPC_STD_MMU_32 */
299278
#ifdef CONFIG_PPC_PMAC
300279
extern unsigned long agp_special_page;
301280
EXPORT_SYMBOL(agp_special_page);

arch/powerpc/kernel/prom.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
#include <asm/sections.h>
4848
#include <asm/machdep.h>
4949
#include <asm/pSeries_reconfig.h>
50+
#include <asm/pci-bridge.h>
51+
#ifdef CONFIG_PPC64
52+
#include <asm/systemcfg.h>
53+
#endif
5054

5155
#ifdef DEBUG
5256
#define DBG(fmt...) printk(KERN_ERR fmt)
@@ -1072,7 +1076,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
10721076
} else {
10731077
/* Check if it's the boot-cpu, set it's hw index in paca now */
10741078
if (get_flat_dt_prop(node, "linux,boot-cpu", NULL) != NULL) {
1075-
u32 *prop = get_flat_dt_prop(node, "reg", NULL);
1079+
prop = get_flat_dt_prop(node, "reg", NULL);
10761080
set_hard_smp_processor_id(0, prop == NULL ? 0 : *prop);
10771081
boot_cpuid_phys = get_hard_smp_processor_id(0);
10781082
}

0 commit comments

Comments
 (0)