
From: Ian Molton <spyro@f2s.com>

Various trivial fixes required to get a clean compile.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/arm26/kernel/armksyms.c    |   14 ++++----------
 25-akpm/arch/arm26/kernel/semaphore.c   |    8 +++++++-
 25-akpm/arch/arm26/lib/getuser.S        |    5 +++--
 25-akpm/arch/arm26/lib/putuser.S        |    5 +++--
 25-akpm/include/asm-arm26/checksum.h    |   14 ++++++++------
 25-akpm/include/asm-arm26/dma-mapping.h |    2 ++
 25-akpm/include/asm-arm26/irqchip.h     |   17 -----------------
 25-akpm/include/asm-arm26/posix_types.h |    8 ++++----
 25-akpm/include/asm-arm26/setup.h       |    2 +-
 25-akpm/include/asm-arm26/thread_info.h |    3 ++-
 10 files changed, 34 insertions(+), 44 deletions(-)

diff -puN arch/arm26/kernel/armksyms.c~arm26-necessary-compilation-fixes-for-2610 arch/arm26/kernel/armksyms.c
--- 25/arch/arm26/kernel/armksyms.c~arm26-necessary-compilation-fixes-for-2610	Thu Dec 23 14:22:06 2004
+++ 25-akpm/arch/arm26/kernel/armksyms.c	Thu Dec 23 14:22:06 2004
@@ -7,6 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/module.h>
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/user.h>
@@ -27,8 +28,6 @@
 #include <asm/elf.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/pgalloc.h>
-//#include <asm/proc-fns.h>
 #include <asm/processor.h>
 #include <asm/semaphore.h>
 #include <asm/system.h>
@@ -69,8 +68,9 @@ extern void fp_enter(void);
 /*
  * This has a special calling convention; it doesn't
  * modify any of the usual registers, except for LR.
+ * FIXME - we used to use our own local version - looks to be in kernel/softirq now
  */
-extern void __do_softirq(void);
+//extern void __do_softirq(void);
 
 #define EXPORT_SYMBOL_ALIAS(sym,orig)		\
  const char __kstrtab_##sym[]			\
@@ -95,7 +95,7 @@ EXPORT_SYMBOL(ret_from_exception);
 EXPORT_SYMBOL(kd_mksound);
 #endif
 
-EXPORT_SYMBOL(__do_softirq);
+//EXPORT_SYMBOL(__do_softirq);
 
 	/* platform dependent support */
 EXPORT_SYMBOL(dump_thread);
@@ -213,12 +213,6 @@ EXPORT_SYMBOL(sys_open);
 EXPORT_SYMBOL(sys_exit);
 EXPORT_SYMBOL(sys_wait4);
 
-	/* semaphores */
-EXPORT_SYMBOL(__down_failed);
-EXPORT_SYMBOL(__down_interruptible_failed);
-EXPORT_SYMBOL(__down_trylock_failed);
-EXPORT_SYMBOL(__up_wakeup);
-
 EXPORT_SYMBOL(get_wchan);
 
 #ifdef CONFIG_PREEMPT
diff -puN arch/arm26/kernel/semaphore.c~arm26-necessary-compilation-fixes-for-2610 arch/arm26/kernel/semaphore.c
--- 25/arch/arm26/kernel/semaphore.c~arm26-necessary-compilation-fixes-for-2610	Thu Dec 23 14:22:06 2004
+++ 25-akpm/arch/arm26/kernel/semaphore.c	Thu Dec 23 14:22:06 2004
@@ -12,6 +12,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/module.h>
 #include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
@@ -179,7 +180,7 @@ int __down_trylock(struct semaphore * se
  * registers (r0 to r3 and lr), but not ip, as we use it as a return
  * value in some cases..
  */
-asm("	.section .sched.text			\n\
+asm("	.section .sched.text , #alloc, #execinstr	\n\
 	.align	5				\n\
 	.globl	__down_failed			\n\
 __down_failed:					\n\
@@ -215,3 +216,8 @@ __up_wakeup:					\n\
 	ldmfd	sp!, {r0 - r3, pc}^		\n\
 	");
 
+EXPORT_SYMBOL(__down_failed);
+EXPORT_SYMBOL(__down_interruptible_failed);
+EXPORT_SYMBOL(__down_trylock_failed);
+EXPORT_SYMBOL(__up_wakeup);
+
diff -puN arch/arm26/lib/getuser.S~arm26-necessary-compilation-fixes-for-2610 arch/arm26/lib/getuser.S
--- 25/arch/arm26/lib/getuser.S~arm26-necessary-compilation-fixes-for-2610	Thu Dec 23 14:22:06 2004
+++ 25-akpm/arch/arm26/lib/getuser.S	Thu Dec 23 14:22:06 2004
@@ -1,5 +1,5 @@
 /*
- *  linux/arch/arm/lib/getuser.S
+ *  linux/arch/arm26/lib/getuser.S
  *
  *  Copyright (C) 2001 Russell King
  *
@@ -28,6 +28,7 @@
  */
 #include <asm/asm_offsets.h>
 #include <asm/thread_info.h>
+#include <asm/errno.h>
 
         .global __get_user_1
 __get_user_1:
@@ -98,7 +99,7 @@ __get_user_bad_8:
         mov     r2, #0
 __get_user_bad:
         mov     r1, #0
-        mov     r0, #-14
+        mov     r0, #-EFAULT
         ldmfd   sp!, {pc}^
 
 .section __ex_table, "a"
diff -puN arch/arm26/lib/putuser.S~arm26-necessary-compilation-fixes-for-2610 arch/arm26/lib/putuser.S
--- 25/arch/arm26/lib/putuser.S~arm26-necessary-compilation-fixes-for-2610	Thu Dec 23 14:22:06 2004
+++ 25-akpm/arch/arm26/lib/putuser.S	Thu Dec 23 14:22:06 2004
@@ -1,5 +1,5 @@
 /*
- *  linux/arch/arm/lib/putuser.S
+ *  linux/arch/arm26/lib/putuser.S
  *
  *  Copyright (C) 2001 Russell King
  *
@@ -28,6 +28,7 @@
  */
 #include <asm/asm_offsets.h>
 #include <asm/thread_info.h>
+#include <asm/errno.h>
 
         .global __put_user_1
 __put_user_1:
@@ -95,7 +96,7 @@ __put_user_8:
         ldmfd   sp!, {pc}^
 
 __put_user_bad:
-	mov	r0, #-14
+	mov	r0, #-EFAULT
 	mov	pc, lr
 
 .section __ex_table, "a"
diff -puN include/asm-arm26/checksum.h~arm26-necessary-compilation-fixes-for-2610 include/asm-arm26/checksum.h
--- 25/include/asm-arm26/checksum.h~arm26-necessary-compilation-fixes-for-2610	Thu Dec 23 14:22:06 2004
+++ 25-akpm/include/asm-arm26/checksum.h	Thu Dec 23 14:22:06 2004
@@ -9,6 +9,8 @@
 #ifndef __ASM_ARM_CHECKSUM_H
 #define __ASM_ARM_CHECKSUM_H
 
+#include <linux/in6.h>
+
 /*
  * computes the checksum of a memory block at buff, length len,
  * and adds in "sum" (32-bit)
@@ -35,13 +37,13 @@ unsigned int
 csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum);
 
 unsigned int
-csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *err_ptr);
+csum_partial_copy_from_user(const char __user *src, char *dst, int len, int sum, int *err_ptr);
 
 /*
- * These are the old (and unsafe) way of doing checksums, a warning message will be
- * printed if they are used and an exception occurs.
+ * This is the old (and unsafe) way of doing checksums, a warning message will
+ * be printed if it is used and an exception occurs.
  *
- * these functions should go away after some time.
+ * this functions should go away after some time.
  */
 #define csum_partial_copy(src,dst,len,sum)	csum_partial_copy_nocheck(src,dst,len,sum)
 
@@ -105,7 +107,7 @@ csum_tcpudp_nofold(unsigned long saddr, 
 	adcs	%0, %0, %5					\n\
 	adc	%0, %0, #0"
 	: "=&r"(sum)
-	: "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len) << 16), "Ir" (proto << 8)
+	: "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto))
 	: "cc");
 	return sum;
 }	
@@ -127,7 +129,7 @@ csum_tcpudp_magic(unsigned long saddr, u
 	addcs	%0, %0, #0x10000				\n\
 	mvn	%0, %0"
 	: "=&r"(sum)
-	: "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (proto << 8)
+	: "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto))
 	: "cc");
 	return sum >> 16;
 }
diff -puN /dev/null include/asm-arm26/dma-mapping.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/include/asm-arm26/dma-mapping.h	Thu Dec 23 14:22:06 2004
@@ -0,0 +1,2 @@
+#include <asm-generic/dma-mapping-broken.h>
+
diff -puN include/asm-arm26/irqchip.h~arm26-necessary-compilation-fixes-for-2610 include/asm-arm26/irqchip.h
--- 25/include/asm-arm26/irqchip.h~arm26-necessary-compilation-fixes-for-2610	Thu Dec 23 14:22:06 2004
+++ 25-akpm/include/asm-arm26/irqchip.h	Thu Dec 23 14:22:06 2004
@@ -85,23 +85,6 @@ void __set_irq_handler(unsigned int irq,
 void set_irq_chip(unsigned int irq, struct irqchip *);
 void set_irq_flags(unsigned int irq, unsigned int flags);
 
-#ifdef not_yet
-/*
- * This is to be used by the top-level machine IRQ decoder only.
- */
-static inline void call_irq(struct pt_regs *regs, unsigned int irq)
-{
-	struct irqdesc *desc = irq_desc + irq;
-
-	spin_lock(&irq_controller_lock);
-	desc->handle(irq, desc, regs);
-	spin_unlock(&irq_controller_lock);
-
-	if (softirq_pending(smp_processor_id()))
-		do_softirq();
-}
-#endif
-
 #define IRQF_VALID	(1 << 0)
 #define IRQF_PROBE	(1 << 1)
 #define IRQF_NOAUTOEN	(1 << 2)
diff -puN include/asm-arm26/posix_types.h~arm26-necessary-compilation-fixes-for-2610 include/asm-arm26/posix_types.h
--- 25/include/asm-arm26/posix_types.h~arm26-necessary-compilation-fixes-for-2610	Thu Dec 23 14:22:06 2004
+++ 25-akpm/include/asm-arm26/posix_types.h	Thu Dec 23 14:22:06 2004
@@ -61,19 +61,19 @@ typedef struct {
 
 #undef	__FD_SET
 #define __FD_SET(fd, fdsetp) \
-		(((fd_set *)fdsetp)->fds_bits[fd >> 5] |= (1<<(fd & 31)))
+		(((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] |= (1<<((fd) & 31)))
 
 #undef	__FD_CLR
 #define __FD_CLR(fd, fdsetp) \
-		(((fd_set *)fdsetp)->fds_bits[fd >> 5] &= ~(1<<(fd & 31)))
+		(((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] &= ~(1<<((fd) & 31)))
 
 #undef	__FD_ISSET
 #define __FD_ISSET(fd, fdsetp) \
-		((((fd_set *)fdsetp)->fds_bits[fd >> 5] & (1<<(fd & 31))) != 0)
+		((((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] & (1<<((fd) & 31))) != 0)
 
 #undef	__FD_ZERO
 #define __FD_ZERO(fdsetp) \
-		(memset (fdsetp, 0, sizeof (*(fd_set *)fdsetp)))
+		(memset ((fdsetp), 0, sizeof (*(fd_set *)(fdsetp))))
 
 #endif
 
diff -puN include/asm-arm26/setup.h~arm26-necessary-compilation-fixes-for-2610 include/asm-arm26/setup.h
--- 25/include/asm-arm26/setup.h~arm26-necessary-compilation-fixes-for-2610	Thu Dec 23 14:22:06 2004
+++ 25-akpm/include/asm-arm26/setup.h	Thu Dec 23 14:22:06 2004
@@ -171,7 +171,7 @@ struct tagtable {
 	int (*parse)(const struct tag *);
 };
 
-#define __tag __attribute__((unused, __section__(".taglist")))
+#define __tag __attribute_used__ __attribute__((__section__(".taglist")))
 #define __tagtable(tag, fn) \
 static struct tagtable __tagtable_##fn __tag = { tag, fn }
 
diff -puN include/asm-arm26/thread_info.h~arm26-necessary-compilation-fixes-for-2610 include/asm-arm26/thread_info.h
--- 25/include/asm-arm26/thread_info.h~arm26-necessary-compilation-fixes-for-2610	Thu Dec 23 14:22:06 2004
+++ 25-akpm/include/asm-arm26/thread_info.h	Thu Dec 23 14:22:06 2004
@@ -18,6 +18,7 @@
 struct task_struct;
 struct exec_domain;
 
+#include <linux/compiler.h>
 #include <asm/fpstate.h>
 #include <asm/ptrace.h>
 #include <asm/types.h>
@@ -80,7 +81,7 @@ static inline struct thread_info *curren
 }
 
 /* FIXME - PAGE_SIZE < 32K */
-#define THREAD_SIZE		(8192)
+#define THREAD_SIZE		(8*32768) // FIXME - this needs attention (see kernel/fork.c which gets a nice div by zero if this is lower than 8*32768
 #define __get_user_regs(x) (((struct pt_regs *)((unsigned long)(x) + THREAD_SIZE - 8)) - 1)
 
 extern struct thread_info *alloc_thread_info(struct task_struct *task);
_
