]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ppc: Various minor compile fixes
authorPaul Mackerras <paulus@samba.org>
Tue, 11 Oct 2005 12:08:12 +0000 (22:08 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 11 Oct 2005 12:08:12 +0000 (22:08 +1000)
This fixes up a variety of minor problems in compiling with ARCH=ppc
arising from using the merged versions of various header files.
A lot of the changes are just adding #include <asm/machdep.h> to
files that use ppc_md or smp_ops_t.

This also arranges for us to use semaphore.c, vecemu.c, vector.S and
fpu.S from arch/powerpc/kernel when compiling with ARCH=ppc.

Signed-off-by: Paul Mackerras <paulus@samba.org>
35 files changed:
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/platforms/4xx/Makefile [new file with mode: 0644]
arch/powerpc/platforms/85xx/Makefile [new file with mode: 0644]
arch/ppc/Makefile
arch/ppc/kernel/Makefile
arch/ppc/kernel/asm-offsets.c
arch/ppc/kernel/head.S
arch/ppc/kernel/pci.c
arch/ppc/kernel/process.c
arch/ppc/kernel/setup.c
arch/ppc/kernel/traps.c
arch/ppc/platforms/chrp_smp.c
arch/ppc/platforms/ev64360.c
arch/ppc/platforms/gemini_setup.c
arch/ppc/platforms/katana.c
arch/ppc/platforms/lite5200.c
arch/ppc/platforms/pal4_setup.c
arch/ppc/platforms/pmac_pic.c
arch/ppc/syslib/gt64260_pic.c
arch/ppc/syslib/mpc52xx_pci.c
arch/ppc/syslib/mpc83xx_devices.c
arch/ppc/syslib/mv64360_pic.c
arch/ppc/syslib/mv64x60_dbg.c
arch/ppc/syslib/open_pic.c
arch/ppc/syslib/open_pic2.c
arch/ppc/syslib/ppc403_pic.c
arch/ppc/syslib/ppc4xx_pic.c
arch/ppc/syslib/ppc83xx_setup.c
arch/ppc/syslib/ppc85xx_setup.c
arch/ppc/syslib/pq2_devices.c
arch/ppc/syslib/xilinx_pic.c
arch/ppc/xmon/start.c
include/asm-powerpc/reg.h
include/asm-ppc/system.h

index 47a8eb6e7e3982d2a5f7bbe31f1a08b26cc72857..e1db51e6f23a749e8df184a0af0b1cd713f0dcea 100644 (file)
@@ -10,7 +10,7 @@ CFLAGS_prom_init.o      += -fPIC
 CFLAGS_btext.o         += -fPIC
 endif
 
-obj-y                          := semaphore.o traps.o
+obj-y                          := semaphore.o
 obj-$(CONFIG_ALTIVEC)          += vecemu.o vector.o
 obj-$(CONFIG_POWER4)           += idle_power4.o
 
@@ -28,7 +28,7 @@ extra-$(CONFIG_PPC_FPU)               += fpu.o
 extra-y                                += vmlinux.lds
 
 obj-y                          += process.o init_task.o \
-                                  prom.o systbl.o
+                                  prom.o systbl.o traps.o
 obj-$(CONFIG_PPC32)            += entry_32.o setup_32.o misc_32.o
 obj-$(CONFIG_PPC64)            += setup_64.o misc_64.o
 obj-$(CONFIG_PPC_OF)           += prom_init.o of_device.o
@@ -39,4 +39,12 @@ ifeq ($(CONFIG_PPC_ISERIES),y)
 $(obj)/head_64.o: $(obj)/lparmap.s
 AFLAGS_head_64.o += -I$(obj)
 endif
+
+else
+# stuff used from here for ARCH=ppc or ARCH=ppc64
+obj-$(CONFIG_PPC64)            += traps.o
+
+fpux-$(CONFIG_PPC32)           += fpu.o
+extra-$(CONFIG_PPC_FPU)                += $(fpux-y)
+
 endif
index ddf0c81e1958cd4b1f26a9129c46d87f264a3430..b0d6a7cd85e9dceb2590978b13dc547560bb5810 100644 (file)
@@ -252,6 +252,7 @@ int main(void)
        DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
        DEFINE(pbe_next, offsetof(struct pbe, next));
 
+       DEFINE(TASK_SIZE, TASK_SIZE);
        DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
 #else /* CONFIG_PPC64 */
        /* systemcfg offsets for use by vdso */
diff --git a/arch/powerpc/platforms/4xx/Makefile b/arch/powerpc/platforms/4xx/Makefile
new file mode 100644 (file)
index 0000000..79ff6b1
--- /dev/null
@@ -0,0 +1 @@
+# empty makefile so make clean works
\ No newline at end of file
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
new file mode 100644 (file)
index 0000000..6407197
--- /dev/null
@@ -0,0 +1 @@
+# empty makefile so make clean works
index 90c750227ed9e8a1cdd0a31e39ebbcf8fa5e40a1..aedc9ae13b2a942e9ae639e12c0c4585f84c32a0 100644 (file)
@@ -57,9 +57,10 @@ head-$(CONFIG_FSL_BOOKE)     := arch/ppc/kernel/head_fsl_booke.o
 
 head-$(CONFIG_6xx)             += arch/ppc/kernel/idle_6xx.o
 head-$(CONFIG_POWER4)          += arch/ppc/kernel/idle_power4.o
-head-$(CONFIG_PPC_FPU)         += arch/ppc/kernel/fpu.o
+head-$(CONFIG_PPC_FPU)         += arch/powerpc/kernel/fpu.o
 
-core-y                         += arch/ppc/kernel/ arch/ppc/platforms/ \
+core-y                         += arch/ppc/kernel/ arch/powerpc/kernel/ \
+                                  arch/ppc/platforms/ \
                                   arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/
 core-$(CONFIG_4xx)             += arch/ppc/platforms/4xx/
 core-$(CONFIG_83xx)            += arch/ppc/platforms/83xx/
index 74b30978619fb55b03c79c0cb643a64930e15212..59b6b62d112015e5f37579a7e4101b944bacce7c 100644 (file)
@@ -10,12 +10,11 @@ extra-$(CONFIG_FSL_BOOKE)   := head_fsl_booke.o
 extra-$(CONFIG_8xx)            := head_8xx.o
 extra-$(CONFIG_6xx)            += idle_6xx.o
 extra-$(CONFIG_POWER4)         += idle_power4.o
-extra-$(CONFIG_PPC_FPU)                += fpu.o
 extra-y                                += vmlinux.lds
 
 obj-y                          := entry.o traps.o irq.o idle.o time.o misc.o \
                                        process.o signal.o ptrace.o align.o \
-                                       semaphore.o syscalls.o setup.o \
+                                       syscalls.o setup.o \
                                        cputable.o ppc_htab.o perfmon.o
 obj-$(CONFIG_6xx)              += l2cr.o cpu_setup_6xx.o
 obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
@@ -26,7 +25,6 @@ obj-$(CONFIG_PCI)             += pci.o
 obj-$(CONFIG_KGDB)             += ppc-stub.o
 obj-$(CONFIG_SMP)              += smp.o smp-tbsync.o
 obj-$(CONFIG_TAU)              += temp.o
-obj-$(CONFIG_ALTIVEC)          += vecemu.o vector.o
 ifndef CONFIG_E200
 obj-$(CONFIG_FSL_BOOKE)                += perfmon_fsl_booke.o
 endif
@@ -37,9 +35,6 @@ obj-$(CONFIG_8xx)             += softemu8xx.o
 endif
 
 # These are here while we do the architecture merge
-vecemu-y                       += ../../powerpc/kernel/vecemu.o
-vector-y                       += ../../powerpc/kernel/vector.o
-fpu-y                          += ../../powerpc/kernel/fpu.o
 
 else
 obj-y                          := irq.o idle.o time.o \
index d9ad1d776d0ed84bb4cb04a3a7461e196c6fdae4..7972db1f65707bcfcb81c683ee70ff1502cfdb3a 100644 (file)
@@ -141,6 +141,7 @@ main(void)
        DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
        DEFINE(pbe_next, offsetof(struct pbe, next));
 
+       DEFINE(TASK_SIZE, TASK_SIZE);
        DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
        return 0;
 }
index 2c3a1d34e3c79bf555931daf6d71e8bfb5bfdd87..5b43987a943bce1342e15ca5c91daed1de2b2fe2 100644 (file)
@@ -467,7 +467,7 @@ FPUnavailable:
        EXCEPTION_PROLOG
        bne     load_up_fpu             /* if from user, just load it up */
        addi    r3,r1,STACK_FRAME_OVERHEAD
-       EXC_XFER_EE_LITE(0x800, KernelFP)
+       EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception)
 
 /* Decrementer */
        EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
index 6600fd485b50c3a0ea6fe6b414e6711f38e2e1b3..163276be7cc54fce185ec9de7d1e936ea813fce2 100644 (file)
@@ -1034,6 +1034,10 @@ static ssize_t pci_show_devspec(struct device *dev, struct device_attribute *att
 }
 static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL);
 
+#else /* CONFIG_PPC_OF */
+void pcibios_make_OF_bus_map(void)
+{
+}
 #endif /* CONFIG_PPC_OF */
 
 /* Add sysfs properties */
index 82de66e4db6d55ee223b44c19701f39b06751549..0870e5553453a3425a2f9be8c2f53e9a93a54dc8 100644 (file)
@@ -557,14 +557,16 @@ int sys_clone(unsigned long clone_flags, unsigned long usp,
        return do_fork(clone_flags, usp, regs, 0, parent_tidp, child_tidp);
 }
 
-int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6,
+int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3,
+            unsigned long p4, unsigned long p5, unsigned long p6,
             struct pt_regs *regs)
 {
        CHECK_FULL_REGS(regs);
        return do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL);
 }
 
-int sys_vfork(int p1, int p2, int p3, int p4, int p5, int p6,
+int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3,
+             unsigned long p4, unsigned long p5, unsigned long p6,
              struct pt_regs *regs)
 {
        CHECK_FULL_REGS(regs);
index fae6335193efc66a74f82d7d0e62c47eabbf9c77..6bcb85d2b7fd92be45bf49d1b7e9d23526c0276e 100644 (file)
@@ -87,6 +87,9 @@ extern void chrp_init(unsigned long r3, unsigned long r4,
 dev_t boot_dev;
 #endif /* CONFIG_PPC_MULTIPLATFORM */
 
+int have_of;
+EXPORT_SYMBOL(have_of);
+
 #ifdef __DO_IRQ_CANON
 int ppc_do_canonicalize_irqs;
 EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
@@ -420,6 +423,8 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
        }
 #endif
 
+       have_of = 1;
+
        /* prom_init has already been called from __start */
        if (boot_infos)
                relocate_nodes();
@@ -735,7 +740,7 @@ void __init setup_arch(char **cmdline_p)
 #endif
 
 #ifdef CONFIG_XMON
-       xmon_map_scc();
+       xmon_init(1);
        if (strstr(cmd_line, "xmon"))
                xmon(NULL);
 #endif /* CONFIG_XMON */
index 26606aa33de6e292a0689e19ab0c8694ede75c8c..3145e9773db99a01b1f10af6cd6e92e4830af501 100644 (file)
 #include <asm/perfmon.h>
 
 #ifdef CONFIG_XMON
+extern int xmon_bpt(struct pt_regs *regs);
+extern int xmon_sstep(struct pt_regs *regs);
+extern int xmon_iabr_match(struct pt_regs *regs);
+extern int xmon_dabr_match(struct pt_regs *regs);
+
 void (*debugger)(struct pt_regs *regs) = xmon;
 int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
 int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
@@ -814,6 +819,17 @@ void TAUException(struct pt_regs *regs)
 }
 #endif /* CONFIG_INT_TAU */
 
+/*
+ * FP unavailable trap from kernel - print a message, but let
+ * the task use FP in the kernel until it returns to user mode.
+ */
+void kernel_fp_unavailable_exception(struct pt_regs *regs)
+{
+       regs->msr |= MSR_FP;
+       printk(KERN_ERR "floating point used in kernel (task=%p, pc=%lx)\n",
+              current, regs->nip);
+}
+
 void altivec_unavailable_exception(struct pt_regs *regs)
 {
        static int kernel_altivec_count;
index dc62e32094436bbcb6572cfefafed63871912566..97e539557ecbb9942f43c8eba1c1f0dd74b1b86f 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/residual.h>
 #include <asm/time.h>
 #include <asm/open_pic.h>
+#include <asm/machdep.h>
 
 extern unsigned long smp_chrp_cpu_nr;
 
index 9811a8a52c25cc80e652871602f3fb2bfdcdc551..53388a1c334f7dbe77a8b93c4e2b1d8e9c5ea9e9 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/bootinfo.h>
 #include <asm/ppcboot.h>
 #include <asm/mv64x60.h>
+#include <asm/machdep.h>
 #include <platforms/ev64360.h>
 
 #define BOARD_VENDOR    "Marvell"
index a8ed5c0a298061f60a91375647accbdcb5f1aa32..a2a09dc4b5e2f5de5f558485253c2501e9e02ac5 100644 (file)
@@ -36,6 +36,7 @@
 #include <asm/time.h>
 #include <asm/open_pic.h>
 #include <asm/bootinfo.h>
+#include <asm/machdep.h>
 
 void gemini_find_bridges(void);
 static int gemini_get_clock_speed(void);
index 2b53afae0e9c2d7cfe8a01b66d792652c3e6d29d..3eb611e23f69b3e83e99597d9547cfc92550b0bb 100644 (file)
@@ -42,6 +42,7 @@
 #include <asm/ppcboot.h>
 #include <asm/mv64x60.h>
 #include <platforms/katana.h>
+#include <asm/machdep.h>
 
 static struct mv64x60_handle   bh;
 static katana_id_t             katana_id;
index b604cf8b3cae910f7fd3828d85bbd1af86c29177..d44cc991179fddef3afbbdbe697b63726d8f53d7 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/io.h>
 #include <asm/mpc52xx.h>
 #include <asm/ppc_sys.h>
+#include <asm/machdep.h>
 
 #include <syslib/mpc52xx_pci.h>
 
index 12446b93e38c7e95fdef96ce853cfcac7cecb472..f93a3f871932888d91b54262082b6c182bf09cbb 100644 (file)
@@ -28,6 +28,7 @@
 #include <asm/io.h>
 #include <asm/todc.h>
 #include <asm/bootinfo.h>
+#include <asm/machdep.h>
 
 #include <syslib/cpc700.h>
 
index 3349cfb624a07df12c2107afc4a2763d380789f7..9f2d95ea856478212df2498a73085e0899612aa9 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/open_pic.h>
 #include <asm/xmon.h>
 #include <asm/pmac_feature.h>
+#include <asm/machdep.h>
 
 #include "pmac_pic.h"
 
index 44aa87385451e44b3a55141d713b2b7f72c95470..f97b3a9abd1e48137da4cc0a6eeb6a5d7a2a862d 100644 (file)
@@ -45,6 +45,7 @@
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/mv64x60.h>
+#include <asm/machdep.h>
 
 #define CPU_INTR_STR   "gt64260 cpu interface error"
 #define PCI0_INTR_STR  "gt64260 pci 0 error"
index 59cf3e8bd1a0a0c57c1b8f68adca4291eb4a19fe..02edff8befd0c585d6dacaec6a2c2d22fd9b9556 100644 (file)
@@ -21,6 +21,7 @@
 #include "mpc52xx_pci.h"
 
 #include <asm/delay.h>
+#include <asm/machdep.h>
 
 
 static int
index 95b3b8a7f0bae34386bfdbe6409a35253a4250ea..dbf8acac507feb0b232dd79fb57cfed0d4e00961 100644 (file)
@@ -21,6 +21,7 @@
 #include <asm/mpc83xx.h>
 #include <asm/irq.h>
 #include <asm/ppc_sys.h>
+#include <asm/machdep.h>
 
 /* We use offsets for IORESOURCE_MEM since we do not know at compile time
  * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup
index 8356da4678a2d49d8510b73680f5941042c44143..58b0aa813e85e512542a23a3e593561682ce1401 100644 (file)
@@ -48,6 +48,7 @@
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/mv64x60.h>
+#include <asm/machdep.h>
 
 #ifdef CONFIG_IRQ_ALL_CPUS
 #error "The mv64360 does not support distribution of IRQs on all CPUs"
index 2927c7adf5e51c455b30905fc0c2afbf0e5899cd..fa5b2e45e0ca54cc52b6a748ca67e6efaac0c105 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/irq.h>
 #include <asm/delay.h>
 #include <asm/mv64x60.h>
+#include <asm/machdep.h>
 
 
 #if defined(CONFIG_SERIAL_TEXT_DEBUG)
index 53da58523e39f3380e303f4f33e0ca20c32db81d..df0f76dc0ce36f23a13347fc9fce21a1403f5b1b 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/sections.h>
 #include <asm/open_pic.h>
 #include <asm/i8259.h>
+#include <asm/machdep.h>
 
 #include "open_pic_defs.h"
 
index 9a7e8748e2b2460353adc9d3f2974f81aa3e083d..ef365cc04bd9c3463603403b8ce86c9183677728 100644 (file)
@@ -28,6 +28,7 @@
 #include <asm/sections.h>
 #include <asm/open_pic.h>
 #include <asm/i8259.h>
+#include <asm/machdep.h>
 
 #include "open_pic_defs.h"
 
index ce4d1deb86e930ee75c4228a44bd4e418a1d743f..c46043c47225b72b737d79dcaac46cb2a4ced2bf 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/ppc4xx_pic.h>
+#include <asm/machdep.h>
 
 /* Function Prototypes */
 
index 40086212b9c3a4837dc923b65ab891a54dfcc640..0b435633a0d174da0991570bf73cacc6406108c0 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/ppc4xx_pic.h>
+#include <asm/machdep.h>
 
 /* See comment in include/arch-ppc/ppc4xx_pic.h
  * for more info about these two variables
index 890484e576e79ef7af48163043869da1a727e808..4da168a6ad0310777403b52b35ac3a9068963d97 100644 (file)
@@ -40,6 +40,7 @@
 #include <asm/ppc_sys.h>
 #include <asm/kgdb.h>
 #include <asm/delay.h>
+#include <asm/machdep.h>
 
 #include <syslib/ppc83xx_setup.h>
 #if defined(CONFIG_PCI)
index 832b8bf99ae71f890ba592797948cfe806e040ee..de2f90576577198d6019374173dc5e98192e6b89 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/mmu.h>
 #include <asm/ppc_sys.h>
 #include <asm/kgdb.h>
+#include <asm/machdep.h>
 
 #include <syslib/ppc85xx_setup.h>
 
index 1d3869768f969e53084c8ad2b074a4053641f05d..6f88ba93412b0489e81f01d339b48c8ad4e7d577 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/cpm2.h>
 #include <asm/irq.h>
 #include <asm/ppc_sys.h>
+#include <asm/machdep.h>
 
 struct platform_device ppc_sys_platform_devices[] = {
        [MPC82xx_CPM_FCC1] = {
index 2cbcad278cefc50cc273eeec464d29201e16f0f5..47f04c71fe9c023bdcf17f119b380b096eeecc69 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/io.h>
 #include <asm/xparameters.h>
 #include <asm/ibm4xx.h>
+#include <asm/machdep.h>
 
 /* No one else should require these constants, so define them locally here. */
 #define ISR 0                  /* Interrupt Status Register */
index 507d4eeffe078b4aaf99b74c87edefeb28494f27..98612d420346bde2e149e0368aadc84a82a82d40 100644 (file)
@@ -478,8 +478,9 @@ void *xmon_stdout;
 void *xmon_stderr;
 
 void
-xmon_init(void)
+xmon_init(int arg)
 {
+       xmon_map_scc();
 }
 
 int
index ff619630dff96ef4f2af1b9dedae16903df0c632..06a1f0f2db21708e688e187569064e2041fd87ad 100644 (file)
@@ -74,7 +74,9 @@
 #define MSR_DR         __MASK(MSR_DR_LG)       /* Data Relocate */
 #define MSR_PE         __MASK(MSR_PE_LG)       /* Protection Enable */
 #define MSR_PX         __MASK(MSR_PX_LG)       /* Protection Exclusive Mode */
+#ifndef MSR_PMM
 #define MSR_PMM                __MASK(MSR_PMM_LG)      /* Performance monitor */
+#endif
 #define MSR_RI         __MASK(MSR_RI_LG)       /* Recoverable Exception */
 #define MSR_LE         __MASK(MSR_LE_LG)       /* Little Endian */
 
 
 #else /* 32-bit */
 /* Default MSR for kernel mode. */
+#ifndef MSR_KERNEL     /* reg_booke.h also defines this */
 #ifdef CONFIG_APUS_FAST_EXCEPT
 #define MSR_KERNEL     (MSR_ME|MSR_IP|MSR_RI|MSR_IR|MSR_DR)
 #else
 #define MSR_KERNEL     (MSR_ME|MSR_RI|MSR_IR|MSR_DR)
 #endif
+#endif
 
 #define MSR_USER       (MSR_KERNEL|MSR_PR|MSR_EE)
 #endif
index 6a49b138c218cad837e0dd181df11dd44690054d..af93ff04c53f62216ee2a8cb8ad2d8a3caebf938 100644 (file)
@@ -77,6 +77,7 @@ extern void enable_kernel_fp(void);
 extern void enable_kernel_altivec(void);
 extern void giveup_altivec(struct task_struct *);
 extern void load_up_altivec(struct task_struct *);
+extern int emulate_altivec(struct pt_regs *);
 extern void giveup_spe(struct task_struct *);
 extern void load_up_spe(struct task_struct *);
 extern int fix_alignment(struct pt_regs *);
@@ -89,6 +90,8 @@ extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
 extern void bad_page_fault(struct pt_regs *, unsigned long, int);
 extern int die(const char *, struct pt_regs *, long);
 extern void _exception(int, struct pt_regs *, int, unsigned long);
+void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
+
 #ifdef CONFIG_BOOKE_WDT
 extern u32 booke_wdt_enabled;
 extern u32 booke_wdt_period;