"sparse" warnings..

Anton Blanchard anton at samba.org
Mon May 3 13:36:04 EST 2004


> Ok, having made "sparse" be somewhat more amenable to cross-compiling (ie
> understanding that the target might be 64-bit, even though it itself is
> running in 32-bit mode), I'm starting to find things in the ppc64 tree
> that sparse really doesn't like.

Cool. I had a play with sparse on ppc64 when I got bored on a plane
once. Ive attached what I had back then but it will probably be a big
mess of rejects these days.

The local_paca hack is pretty ugly too.

>   warning: include/asm/thread_info.h:72:5: undefined preprocessor identifier 'PAGE_SIZE'
>   warning: include/asm/thread_info.h:72:23: undefined preprocessor identifier 'PAGE_SIZE'
>
> Lookie there - it's comparing something that isn't defined. It so happens
> that it works (when PAGE_SIZE isn't defined, the preprocessor arithmetic
> rules means that it gets evaluated as zero), but it works for all the
> wrong reasons.

Oh yeah I ended up killing that check completely in the patch below
since it was just informational and could just as easily be served by a
comment right above the THREAD_SIZE definition.

Anton

===== arch/ppc64/kernel/align.c 1.10 vs edited =====
--- 1.10/arch/ppc64/kernel/align.c	Sat Jun  7 11:19:26 2003
+++ edited/arch/ppc64/kernel/align.c	Sat Jun 21 00:24:19 2003
@@ -215,7 +215,7 @@
 	unsigned long i;
 	int ret;
 	unsigned dsisr;
-	unsigned char *addr, *p;
+	unsigned char __user *addr, *p;
 	unsigned long *lp;
 	union {
 		long ll;
@@ -257,7 +257,7 @@
 	flags = aligninfo[instr].flags;

 	/* DAR has the operand effective address */
-	addr = (unsigned char *)regs->dar;
+	addr = (unsigned char __user *)regs->dar;

 	/* A size of 0 indicates an instruction we don't support */
 	/* we also don't support the multiples (lmw, stmw, lmd, stmd) */
@@ -270,7 +270,7 @@
 	 * storage
 	 */
 	if (instr == DCBZ)
-		addr = (unsigned char *) ((unsigned long)addr & -L1_CACHE_BYTES);
+		addr = (unsigned char __user *)((unsigned long)addr & -L1_CACHE_BYTES);

 	/* Verify the address of the operand */
 	if (user_mode(regs)) {
===== arch/ppc64/kernel/irq.c 1.29 vs edited =====
--- 1.29/arch/ppc64/kernel/irq.c	Sat Jun  7 11:59:39 2003
+++ edited/arch/ppc64/kernel/irq.c	Fri Jun 20 17:23:12 2003
@@ -618,7 +618,7 @@
 	return sprintf(page, "%16lx\n", irq_affinity[(long)data]);
 }

-static unsigned int parse_hex_value (const char *buffer,
+static unsigned int parse_hex_value (const char __user *buffer,
 		unsigned long count, unsigned long *ret)
 {
 	unsigned char hexnum [HEX_DIGITS];
@@ -655,7 +655,7 @@
 	return 0;
 }

-static int irq_affinity_write_proc (struct file *file, const char *buffer,
+static int irq_affinity_write_proc (struct file *file, const char __user *buffer,
 					unsigned long count, void *data)
 {
 	int irq = (long)data, full_count = count, err;
@@ -689,7 +689,7 @@
 	return sprintf (page, "%08lx\n", *mask);
 }

-static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
+static int prof_cpu_mask_write_proc (struct file *file, const char __user *buffer,
 					unsigned long count, void *data)
 {
 	unsigned long *mask = (unsigned long *) data, full_count = count, err;
===== arch/ppc64/kernel/pacaData.c 1.7 vs edited =====
--- 1.7/arch/ppc64/kernel/pacaData.c	Wed May 21 06:11:13 2003
+++ edited/arch/ppc64/kernel/pacaData.c	Fri Jun 20 17:04:52 2003
@@ -54,7 +54,7 @@
 		.xFPRegsInUse = 1,					    \
 		.xDynProcStatus = 2,					    \
 		.xDecrVal = 0x00ff0000,					    \
-		.xEndOfQuantum = 0xffffffffffffffff			    \
+		.xEndOfQuantum = 0xffffffffffffffffUL			    \
 	},								    \
 	.xRegSav = {							    \
 		.xDesc = 0xd397d9e2,	/* "LpRS" */			    \
===== arch/ppc64/kernel/process.c 1.35 vs edited =====
--- 1.35/arch/ppc64/kernel/process.c	Sat Jun  7 11:19:27 2003
+++ edited/arch/ppc64/kernel/process.c	Fri Jun 20 18:22:58 2003
@@ -337,7 +337,7 @@
 		giveup_fpu(current);

 	return do_fork(clone_flags & ~CLONE_IDLETASK, p2, regs, 0,
-		    (int *)parent_tidptr, (int *)child_tidptr);
+		    (int __user *)parent_tidptr, (int __user *)child_tidptr);
 }

 int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3,
@@ -368,14 +368,15 @@
 	int error;
 	char * filename;

-	filename = getname((char *) a0);
+	filename = getname((char __user *) a0);
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
 		goto out;
 	if (regs->msr & MSR_FP)
 		giveup_fpu(current);

-	error = do_execve(filename, (char **) a1, (char **) a2, regs);
+	error = do_execve(filename, (char __user * __user *)a1,
+			  (char __user * __user *)a2, regs);

 	if (error == 0)
 		current->ptrace &= ~PT_DTRACE;
===== arch/ppc64/kernel/prom.c 1.28 vs edited =====
--- 1.28/arch/ppc64/kernel/prom.c	Wed May 28 08:36:24 2003
+++ edited/arch/ppc64/kernel/prom.c	Fri Jun 20 00:03:06 2003
@@ -224,7 +224,7 @@


 static void __init
-prom_exit()
+prom_exit(void)
 {
 	unsigned long offset = reloc_offset();

@@ -2036,7 +2036,7 @@


 void __init
-abort()
+abort(void)
 {
 #ifdef CONFIG_XMON
 	xmon(NULL);
===== arch/ppc64/kernel/rtasd.c 1.10 vs edited =====
--- 1.10/arch/ppc64/kernel/rtasd.c	Wed Feb 12 15:28:08 2003
+++ edited/arch/ppc64/kernel/rtasd.c	Fri Jun 20 18:27:32 2003
@@ -69,7 +69,7 @@
 	return 0;
 }

-static ssize_t rtas_log_read(struct file * file, char * buf,
+static ssize_t rtas_log_read(struct file * file, char __user *buf,
 			 size_t count, loff_t *ppos)
 {
 	int error;
===== arch/ppc64/kernel/signal.c 1.28 vs edited =====
--- 1.28/arch/ppc64/kernel/signal.c	Tue May 20 01:18:53 2003
+++ edited/arch/ppc64/kernel/signal.c	Sat Jun 21 01:14:52 2003
@@ -72,7 +72,7 @@
 /*
  * Atomically swap in the new signal mask, and wait for a signal.
  */
-long sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, int p3, int p4,
+long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, int p3, int p4,
 		       int p6, int p7, struct pt_regs *regs)
 {
 	sigset_t saveset, newset;
@@ -102,9 +102,9 @@
 	}
 }

-long sys_sigaltstack(const stack_t *uss, stack_t *uoss, unsigned long r5,
-		     unsigned long r6, unsigned long r7, unsigned long r8,
-		     struct pt_regs *regs)
+long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
+		     unsigned long r5, unsigned long r6, unsigned long r7,
+		     unsigned long r8, struct pt_regs *regs)
 {
 	return do_sigaltstack(uss, uoss, regs->gpr[1]);
 }
@@ -115,7 +115,7 @@
  */

 static int
-setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
+setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
 		 int signr, sigset_t *set, unsigned long handler)
 {
 	int err = 0;
@@ -146,7 +146,8 @@
  */

 static int
-restore_sigcontext(struct pt_regs *regs, sigset_t *set, struct sigcontext *sc)
+restore_sigcontext(struct pt_regs *regs, sigset_t *set,
+		   struct sigcontext __user *sc)
 {
 	unsigned int err = 0;

@@ -186,7 +187,7 @@
 }

 static int
-setup_trampoline(unsigned int syscall, unsigned int *tramp)
+setup_trampoline(unsigned int syscall, unsigned int __user *tramp)
 {
 	int i, err = 0;

@@ -216,7 +217,7 @@
 		     unsigned long r6, unsigned long r7, unsigned long r8,
 		     struct pt_regs *regs)
 {
-	struct ucontext *uc = (struct ucontext *)regs->gpr[1];
+	struct ucontext __user *uc = (struct ucontext __user *)regs->gpr[1];
 	sigset_t set;
 	stack_t st;

@@ -260,11 +261,11 @@
 	 * entry is the TOC value we need to use.
 	 */
 	func_descr_t *funct_desc_ptr;
-	struct rt_sigframe *frame;
+	struct rt_sigframe __user *frame;
 	unsigned long newsp = 0;
 	int err = 0;

-	frame = get_sigframe(ka, regs, sizeof(*frame));
+	frame = (struct rt_sigframe __user *)get_sigframe(ka, regs, sizeof(*frame));

 	if (verify_area(VERIFY_WRITE, frame, sizeof(*frame)))
 		goto badframe;
===== arch/ppc64/kernel/signal32.c 1.40 vs edited =====
--- 1.40/arch/ppc64/kernel/signal32.c	Tue May 20 01:18:53 2003
+++ edited/arch/ppc64/kernel/signal32.c	Fri Jun 20 17:54:44 2003
@@ -200,14 +200,15 @@
 		     unsigned long r6, unsigned long r7, unsigned long r8,
 		     struct pt_regs *regs)
 {
-	struct sigcontext32 *sc, sigctx;
-	struct sigregs32 *sr;
+	struct sigcontext32 __user *sc;
+	struct sigcontext32 sigctx;
+	struct sigregs32 __user *sr;
 	int ret;
 	elf_gregset_t32 saved_regs;  /* an array of ELF_NGREG unsigned ints (32 bits) */
 	sigset_t set;
 	int i;

-	sc = (struct sigcontext32 *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32);
+	sc = (struct sigcontext32 __user *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32);
 	if (copy_from_user(&sigctx, sc, sizeof(sigctx)))
 		goto badframe;

@@ -224,7 +225,7 @@
 	if (regs->msr & MSR_FP )
 		giveup_fpu(current);
 	/* Last stacked signal - restore registers */
-	sr = (struct sigregs32*)(u64)sigctx.regs;
+	sr = (struct sigregs32 __user *)(u64)sigctx.regs;
 	/*
 	 * copy the 32 bit register values off the user stack
 	 * into the 32 bit register area
@@ -294,7 +295,7 @@
 /*
  * Set up a signal frame.
  */
-static void setup_frame32(struct pt_regs *regs, struct sigregs32 *frame,
+static void setup_frame32(struct pt_regs *regs, struct sigregs32 __user *frame,
             unsigned int newsp)
 {
 	struct sigcontext32 *sc = (struct sigcontext32 *)(u64)newsp;
@@ -410,9 +411,9 @@
 			unsigned long r6, unsigned long r7, unsigned long r8,
 			struct pt_regs * regs)
 {
-	struct rt_sigframe_32 *rt_sf;
+	struct rt_sigframe_32 __user *rt_sf;
 	struct sigcontext32 sigctx;
-	struct sigregs32 *sr;
+	struct sigregs32 __user *sr;
 	int ret;
 	elf_gregset_t32 saved_regs;   /* an array of 32 bit register values */
 	sigset_t set;
@@ -421,11 +422,12 @@
 	mm_segment_t old_fs;

 	/* Adjust the inputted reg1 to point to the first rt signal frame */
-	rt_sf = (struct rt_sigframe_32 *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32);
+	rt_sf = (struct rt_sigframe_32 __user *)(regs->gpr[1] +
+			__SIGNAL_FRAMESIZE32);
 	/* Copy the information from the user stack  */
 	if (copy_from_user(&sigctx, &rt_sf->uc.uc_mcontext, sizeof(sigctx))
 	    || copy_from_user(&set, &rt_sf->uc.uc_sigmask, sizeof(set))
-	    || copy_from_user(&st,&rt_sf->uc.uc_stack, sizeof(st)))
+	    || copy_from_user(&st, &rt_sf->uc.uc_stack, sizeof(st)))
 		goto badframe;

 	/*
@@ -448,7 +450,7 @@
 	 * Set to point to the next rt_sigframe - this is used to
 	 * determine whether this is the last signal to process
 	 */
-	sr = (struct sigregs32 *)(u64)sigctx.regs;
+	sr = (struct sigregs32 __user *)(u64)sigctx.regs;
 	if (copy_from_user(saved_regs, &sr->gp_regs, sizeof(sr->gp_regs)))
 		goto badframe;
 	/*
@@ -509,8 +511,8 @@



-long sys32_rt_sigaction(int sig, const struct sigaction32 *act,
-		struct sigaction32 *oact, size_t sigsetsize)
+long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
+		struct sigaction32 __user *oact, size_t sigsetsize)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -570,23 +572,23 @@
  * of a signed int (msr in 32-bit mode) and the register representation
  * of a signed int (msr in 64-bit mode) is performed.
  */
-long sys32_rt_sigprocmask(u32 how, compat_sigset_t *set,
-		compat_sigset_t *oset, size_t sigsetsize)
+long sys32_rt_sigprocmask(u32 how, compat_sigset_t __user *set,
+		compat_sigset_t __user *oset, size_t sigsetsize)
 {
 	sigset_t s;
-	compat_sigset_t s32;
+	compat_sigset_t _s32;
 	int ret;
 	mm_segment_t old_fs = get_fs();

 	if (set) {
-		if (copy_from_user (&s32, set, sizeof(compat_sigset_t)))
+		if (copy_from_user (&_s32, set, sizeof(compat_sigset_t)))
 			return -EFAULT;

 		switch (_NSIG_WORDS) {
-		case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
-		case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
-		case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
-		case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
+		case 4: s.sig[3] = _s32.sig[6] | (((long)_s32.sig[7]) << 32);
+		case 3: s.sig[2] = _s32.sig[4] | (((long)_s32.sig[5]) << 32);
+		case 2: s.sig[1] = _s32.sig[2] | (((long)_s32.sig[3]) << 32);
+		case 1: s.sig[0] = _s32.sig[0] | (((long)_s32.sig[1]) << 32);
 		}
 	}

@@ -598,21 +600,21 @@
 		return ret;
 	if (oset) {
 		switch (_NSIG_WORDS) {
-		case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3];
-		case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2];
-		case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
-		case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
+		case 4: _s32.sig[7] = (s.sig[3] >> 32); _s32.sig[6] = s.sig[3];
+		case 3: _s32.sig[5] = (s.sig[2] >> 32); _s32.sig[4] = s.sig[2];
+		case 2: _s32.sig[3] = (s.sig[1] >> 32); _s32.sig[2] = s.sig[1];
+		case 1: _s32.sig[1] = (s.sig[0] >> 32); _s32.sig[0] = s.sig[0];
 		}
-		if (copy_to_user (oset, &s32, sizeof(compat_sigset_t)))
+		if (copy_to_user (oset, &_s32, sizeof(compat_sigset_t)))
 			return -EFAULT;
 	}
 	return 0;
 }

-long sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
+long sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize)
 {
 	sigset_t s;
-	compat_sigset_t s32;
+	compat_sigset_t _s32;
 	int ret;
 	mm_segment_t old_fs = get_fs();

@@ -621,19 +623,19 @@
 	set_fs(old_fs);
 	if (!ret) {
 		switch (_NSIG_WORDS) {
-		case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3];
-		case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2];
-		case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
-		case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
+		case 4: _s32.sig[7] = (s.sig[3] >> 32); _s32.sig[6] = s.sig[3];
+		case 3: _s32.sig[5] = (s.sig[2] >> 32); _s32.sig[4] = s.sig[2];
+		case 2: _s32.sig[3] = (s.sig[1] >> 32); _s32.sig[2] = s.sig[1];
+		case 1: _s32.sig[1] = (s.sig[0] >> 32); _s32.sig[0] = s.sig[0];
 		}
-		if (copy_to_user (set, &s32, sizeof(compat_sigset_t)))
+		if (copy_to_user (set, &_s32, sizeof(compat_sigset_t)))
 			return -EFAULT;
 	}
 	return ret;
 }


-static int copy_siginfo_to_user32(siginfo_t32 *d, siginfo_t *s)
+static int copy_siginfo_to_user32(siginfo_t32 __user *d, siginfo_t *s)
 {
 	int err;

@@ -675,23 +677,25 @@
 	return err;
 }

-long sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
-		struct compat_timespec *uts, compat_size_t sigsetsize)
+long sys32_rt_sigtimedwait(compat_sigset_t __user *uthese,
+			   siginfo_t32 __user *uinfo,
+			   struct compat_timespec __user *uts,
+			   compat_size_t sigsetsize)
 {
 	sigset_t s;
-	compat_sigset_t s32;
+	compat_sigset_t _s32;
 	struct timespec t;
 	int ret;
 	mm_segment_t old_fs = get_fs();
 	siginfo_t info;

-	if (copy_from_user(&s32, uthese, sizeof(compat_sigset_t)))
+	if (copy_from_user(&_s32, uthese, sizeof(compat_sigset_t)))
 		return -EFAULT;
 	switch (_NSIG_WORDS) {
-	case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
-	case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
-	case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
-	case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
+	case 4: s.sig[3] = _s32.sig[6] | (((long)_s32.sig[7]) << 32);
+	case 3: s.sig[2] = _s32.sig[4] | (((long)_s32.sig[5]) << 32);
+	case 2: s.sig[1] = _s32.sig[2] | (((long)_s32.sig[3]) << 32);
+	case 1: s.sig[0] = _s32.sig[0] | (((long)_s32.sig[1]) << 32);
 	}
 	if (uts && get_compat_timespec(&t, uts))
 		return -EFAULT;
@@ -752,7 +756,7 @@
  * (msr in 32-bit mode) and the register representation of a signed int
  * (msr in 64-bit mode) is performed.
  */
-long sys32_rt_sigqueueinfo(u32 pid, u32 sig, siginfo_t32 *uinfo)
+long sys32_rt_sigqueueinfo(u32 pid, u32 sig, siginfo_t32 __user *uinfo)
 {
 	siginfo_t info;
 	siginfo_t32 info32;
@@ -770,17 +774,17 @@
 	return ret;
 }

-int sys32_rt_sigsuspend(compat_sigset_t* unewset, size_t sigsetsize, int p3,
-		int p4, int p6, int p7, struct pt_regs *regs)
+int sys32_rt_sigsuspend(compat_sigset_t __user *unewset, size_t sigsetsize,
+		int p3, int p4, int p6, int p7, struct pt_regs *regs)
 {
 	sigset_t saveset, newset;
-	compat_sigset_t s32;
+	compat_sigset_t _s32;

 	/* XXX: Don't preclude handling different sized sigset_t's.  */
 	if (sigsetsize != sizeof(sigset_t))
 		return -EINVAL;

-	if (copy_from_user(&s32, unewset, sizeof(s32)))
+	if (copy_from_user(&_s32, unewset, sizeof(_s32)))
 		return -EFAULT;

 	/*
@@ -788,10 +792,10 @@
 	 * in the "wrong" endian in 32-bit user storage).
 	 */
 	switch (_NSIG_WORDS) {
-	case 4: newset.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
-	case 3: newset.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
-	case 2: newset.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
-	case 1: newset.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
+	case 4: newset.sig[3] = _s32.sig[6] | (((long)_s32.sig[7]) << 32);
+	case 3: newset.sig[2] = _s32.sig[4] | (((long)_s32.sig[5]) << 32);
+	case 2: newset.sig[1] = _s32.sig[2] | (((long)_s32.sig[3]) << 32);
+	case 1: newset.sig[0] = _s32.sig[0] | (((long)_s32.sig[1]) << 32);
 	}

 	sigdelsetmask(&newset, ~_BLOCKABLE);
@@ -825,11 +829,12 @@
 /*
  * Set up a rt signal frame.
  */
-static void setup_rt_frame32(struct pt_regs *regs, struct sigregs32 *frame,
-            unsigned int newsp)
+static void setup_rt_frame32(struct pt_regs *regs,
+			     struct sigregs32 __user *frame, unsigned int newsp)
 {
 	unsigned int copyreg4, copyreg5;
-	struct rt_sigframe_32 * rt_sf = (struct rt_sigframe_32 *) (u64)newsp;
+	struct rt_sigframe_32 __user *rt_sf =
+		(struct rt_sigframe_32 __user *) (u64)newsp;
 	int i;

 	if (verify_area(VERIFY_WRITE, frame, sizeof(*frame)))
@@ -891,7 +896,7 @@
 	newsp -= __SIGNAL_FRAMESIZE32;


-	if (put_user((u32)(regs->gpr[1]), (unsigned int *)(u64)newsp)
+	if (put_user((u32)(regs->gpr[1]), (unsigned int __user *)(u64)newsp)
 	    || get_user(regs->nip, &rt_sf->uc.uc_mcontext.handler)
 	    || get_user(regs->gpr[3], &rt_sf->uc.uc_mcontext.signal)
 	    || get_user(copyreg4, &rt_sf->pinfo)
@@ -922,8 +927,8 @@
 		sigset_t *oldset, struct pt_regs * regs, unsigned int *newspp,
 		unsigned int frame)
 {
-	struct sigcontext32 *sc;
-	struct rt_sigframe_32 *rt_sf;
+	struct sigcontext32 __user *sc;
+	struct rt_sigframe_32 __user *rt_sf;
 	struct k_sigaction *ka = &current->sighand->action[sig-1];

 	if (regs->trap == 0x0C00 /* System Call! */
@@ -943,7 +948,7 @@
 	 */
 	if (ka->sa.sa_flags & SA_SIGINFO) {
 		*newspp -= sizeof(*rt_sf);
-		rt_sf = (struct rt_sigframe_32 *)(u64)(*newspp);
+		rt_sf = (struct rt_sigframe_32 __user *)(u64)(*newspp);
 		if (verify_area(VERIFY_WRITE, rt_sf, sizeof(*rt_sf)))
 			goto badframe;
 		if (__put_user((u32)(u64)ka->sa.sa_handler,
@@ -969,7 +974,7 @@
 	} else {
 		/* Put a sigcontext on the stack */
 		*newspp -= sizeof(*sc);
-		sc = (struct sigcontext32 *)(u64)*newspp;
+		sc = (struct sigcontext32 __user *)(u64)*newspp;
 		if (verify_area(VERIFY_WRITE, sc, sizeof(*sc)))
 			goto badframe;
 		/*
@@ -1016,7 +1021,7 @@
 int sys32_sigaltstack(u32 newstack, u32 oldstack, int p3,
 		      int p4, int p6, int p7, struct pt_regs *regs)
 {
-	stack_t uss, uoss;
+	stack_t __user uss, uoss;
 	int ret;
 	mm_segment_t old_fs;
 	unsigned long sp;
@@ -1030,7 +1035,7 @@
 	/* Put new stack info in local 64 bit stack struct */
 	if (newstack &&
 		(get_user((long)uss.ss_sp,
-			  &((stack_32_t *)(long)newstack)->ss_sp) ||
+			  &((stack_32_t __user *)(long)newstack)->ss_sp) ||
 		 __get_user(uss.ss_flags,
 			 &((stack_32_t *)(long)newstack)->ss_flags) ||
 		 __get_user(uss.ss_size,
@@ -1045,7 +1050,7 @@
 	/* Copy the stack information to the user output buffer */
 	if (!ret && oldstack  &&
 		(put_user((long)uoss.ss_sp,
-			  &((stack_32_t *)(long)oldstack)->ss_sp) ||
+			  &((stack_32_t __user *)(long)oldstack)->ss_sp) ||
 		 __put_user(uoss.ss_flags,
 			 &((stack_32_t *)(long)oldstack)->ss_flags) ||
 		 __put_user(uoss.ss_size,
@@ -1116,8 +1121,10 @@

 	/* Invoke correct stack setup routine */
 	if (ka->sa.sa_flags & SA_SIGINFO)
-		setup_rt_frame32(regs, (struct sigregs32*)(u64)frame, newsp);
+		setup_rt_frame32(regs, (struct sigregs32 __user *)(u64)frame,
+				 newsp);
 	else
-		setup_frame32(regs, (struct sigregs32*)(u64)frame, newsp);
+		setup_frame32(regs, (struct sigregs32 __user *)(u64)frame,
+			      newsp);
 	return 1;
 }
===== fs/compat.c 1.10 vs edited =====
--- 1.10/fs/compat.c	Mon May 26 16:19:40 2003
+++ edited/fs/compat.c	Sat Jun 21 00:29:18 2003
@@ -39,7 +39,8 @@
  * Not all architectures have sys_utime, so implement this in terms
  * of sys_utimes.
  */
-asmlinkage long compat_sys_utime(char *filename, struct compat_utimbuf *t)
+asmlinkage long compat_sys_utime(char __user *filename,
+				 struct compat_utimbuf __user *t)
 {
 	struct timeval tv[2];

@@ -54,8 +55,8 @@
 }


-asmlinkage long compat_sys_newstat(char * filename,
-		struct compat_stat *statbuf)
+asmlinkage long compat_sys_newstat(char __user *filename,
+		struct compat_stat __user *statbuf)
 {
 	struct kstat stat;
 	int error = vfs_stat(filename, &stat);
@@ -65,8 +66,8 @@
 	return error;
 }

-asmlinkage long compat_sys_newlstat(char * filename,
-		struct compat_stat *statbuf)
+asmlinkage long compat_sys_newlstat(char __user *filename,
+		struct compat_stat __user *statbuf)
 {
 	struct kstat stat;
 	int error = vfs_lstat(filename, &stat);
@@ -77,7 +78,7 @@
 }

 asmlinkage long compat_sys_newfstat(unsigned int fd,
-		struct compat_stat * statbuf)
+		struct compat_stat __user *statbuf)
 {
 	struct kstat stat;
 	int error = vfs_fstat(fd, &stat);
@@ -87,7 +88,8 @@
 	return error;
 }

-static int put_compat_statfs(struct compat_statfs *ubuf, struct statfs *kbuf)
+static int put_compat_statfs(struct compat_statfs __user *ubuf,
+			     struct statfs *kbuf)
 {
 	if (verify_area(VERIFY_WRITE, ubuf, sizeof(*ubuf)) ||
 	    __put_user(kbuf->f_type, &ubuf->f_type) ||
@@ -108,7 +110,8 @@
  * The following statfs calls are copies of code from fs/open.c and
  * should be checked against those from time to time
  */
-asmlinkage long compat_sys_statfs(const char *path, struct compat_statfs *buf)
+asmlinkage long compat_sys_statfs(const char __user *path,
+				  struct compat_statfs __user *buf)
 {
 	struct nameidata nd;
 	int error;
@@ -124,7 +127,8 @@
 	return error;
 }

-asmlinkage long compat_sys_fstatfs(unsigned int fd, struct compat_statfs *buf)
+asmlinkage long compat_sys_fstatfs(unsigned int fd,
+				   struct compat_statfs __user *buf)
 {
 	struct file * file;
 	struct statfs tmp;
===== include/asm-ppc64/cputable.h 1.1 vs edited =====
--- 1.1/include/asm-ppc64/cputable.h	Sat Jun  7 18:20:51 2003
+++ edited/include/asm-ppc64/cputable.h	Fri Jun 20 17:56:50 2003
@@ -108,11 +108,11 @@
 #define CPU_FTR_DUAL_PLL_750FX		0x0000000000004000

 /* Add the 64b processor unique features in the top half of the word */
-#define CPU_FTR_SLB           		0x0000000100000000
-#define CPU_FTR_16M_PAGE      		0x0000000200000000
-#define CPU_FTR_TLBIEL         		0x0000000400000000
-#define CPU_FTR_NOEXECUTE     		0x0000000800000000
-#define CPU_FTR_NODSISRALIGN  		0x0000001000000000
+#define CPU_FTR_SLB           		0x0000000100000000UL
+#define CPU_FTR_16M_PAGE      		0x0000000200000000UL
+#define CPU_FTR_TLBIEL         		0x0000000400000000UL
+#define CPU_FTR_NOEXECUTE     		0x0000000800000000UL
+#define CPU_FTR_NODSISRALIGN  		0x0000001000000000UL

 /* Platform firmware features */
 #define FW_FTR_                         0x0000000000000001
===== include/asm-ppc64/eeh.h 1.4 vs edited =====
--- 1.4/include/asm-ppc64/eeh.h	Sat Dec  7 18:04:33 2002
+++ edited/include/asm-ppc64/eeh.h	Mon Jun 23 15:58:34 2003
@@ -65,9 +65,6 @@
  */
 unsigned long eeh_token_to_phys(unsigned long token);

-extern void *memcpy(void *, const void *, unsigned long);
-extern void *memset(void *,int, unsigned long);
-
 /* EEH_POSSIBLE_ERROR() -- test for possible MMIO failure.
  *
  * Order this macro for performance.
@@ -166,7 +163,7 @@

 static inline void eeh_outb(u8 val, unsigned long port) {
 	if (!_IO_IS_ISA(port) || _IO_HAS_ISA_BUS)
-		return out_8((u8 *)(port+pci_io_base), val);
+		out_8((u8 *)(port+pci_io_base), val);
 }

 static inline u16 eeh_inw(unsigned long port) {
@@ -181,7 +178,7 @@

 static inline void eeh_outw(u16 val, unsigned long port) {
 	if (!_IO_IS_ISA(port) || _IO_HAS_ISA_BUS)
-		return out_le16((u16 *)(port+pci_io_base), val);
+		out_le16((u16 *)(port+pci_io_base), val);
 }

 static inline u32 eeh_inl(unsigned long port) {
@@ -196,7 +193,7 @@

 static inline void eeh_outl(u32 val, unsigned long port) {
 	if (!_IO_IS_ISA(port) || _IO_HAS_ISA_BUS)
-		return out_le32((u32 *)(port+pci_io_base), val);
+		out_le32((u32 *)(port+pci_io_base), val);
 }

 #endif /* _EEH_H */
===== include/asm-ppc64/mmu.h 1.7 vs edited =====
--- 1.7/include/asm-ppc64/mmu.h	Wed Mar 26 15:30:59 2003
+++ edited/include/asm-ppc64/mmu.h	Sat Jun 21 19:06:11 2003
@@ -193,7 +193,7 @@
 		page = vpn & 0xffff;
 	}

-	return (vsid & 0x7fffffffff) ^ page;
+	return (vsid & 0x7fffffffffUL) ^ page;
 }

 static inline void _tlbie(unsigned long va, int large)
===== include/asm-ppc64/mmu_context.h 1.4 vs edited =====
--- 1.4/include/asm-ppc64/mmu_context.h	Fri Jan 10 18:21:00 2003
+++ edited/include/asm-ppc64/mmu_context.h	Fri Jun 20 17:16:52 2003
@@ -155,8 +155,8 @@
 #define activate_mm(active_mm, mm) \
 	switch_mm(active_mm, mm, current, smp_processor_id());

-#define VSID_RANDOMIZER 42470972311
-#define VSID_MASK	0xfffffffff
+#define VSID_RANDOMIZER 42470972311UL
+#define VSID_MASK	0xfffffffffUL


 /* This is only valid for kernel (including vmalloc, imalloc and bolted) EA's
===== include/asm-ppc64/paca.h 1.8 vs edited =====
--- 1.8/include/asm-ppc64/paca.h	Wed May 21 06:11:13 2003
+++ edited/include/asm-ppc64/paca.h	Sat Jun 21 18:32:17 2003
@@ -34,7 +34,11 @@
 #include	<asm/processor.h>

 extern struct paca_struct paca[];
+#ifdef __CHECKER__
+#define local_paca ((struct paca_struct *)NULL)
+#else
 register struct paca_struct *local_paca asm("r13");
+#endif
 #define get_paca()	local_paca

 /*============================================================================
===== include/asm-ppc64/page.h 1.19 vs edited =====
--- 1.19/include/asm-ppc64/page.h	Wed Mar 26 15:30:59 2003
+++ edited/include/asm-ppc64/page.h	Sat Jun 21 19:08:17 2003
@@ -23,7 +23,7 @@
 #define PAGE_OFFSET_MASK (PAGE_SIZE-1)

 #define SID_SHIFT       28
-#define SID_MASK        0xfffffffff
+#define SID_MASK        0xfffffffffUL
 #define GET_ESID(x)     (((x) >> SID_SHIFT) & SID_MASK)

 /* align addr on a size boundary - adjust address up/down if needed */
@@ -145,11 +145,15 @@
 /*       KERNELBASE is defined for performance reasons. */
 /*       When KERNELBASE moves, those macros may have   */
 /*             to change!                               */
+#ifdef __ASSEMBLY__
 #define PAGE_OFFSET     0xC000000000000000
+#else
+#define PAGE_OFFSET     0xC000000000000000UL
+#endif
 #define KERNELBASE      PAGE_OFFSET
-#define VMALLOCBASE     0xD000000000000000
-#define IOREGIONBASE    0xE000000000000000
-#define EEHREGIONBASE   0xA000000000000000
+#define VMALLOCBASE     0xD000000000000000UL
+#define IOREGIONBASE    0xE000000000000000UL
+#define EEHREGIONBASE   0xA000000000000000UL

 #define IO_REGION_ID       (IOREGIONBASE>>REGION_SHIFT)
 #define EEH_REGION_ID      (EEHREGIONBASE>>REGION_SHIFT)
===== include/asm-ppc64/pgtable.h 1.23 vs edited =====
--- 1.23/include/asm-ppc64/pgtable.h	Wed Jun 11 16:33:17 2003
+++ edited/include/asm-ppc64/pgtable.h	Fri Jun 20 18:31:32 2003
@@ -44,7 +44,7 @@
 /*
  * Define the address range of the vmalloc VM area.
  */
-#define VMALLOC_START (0xD000000000000000)
+#define VMALLOC_START (0xD000000000000000UL)
 #define VMALLOC_VMADDR(x) ((unsigned long)(x))
 #define VMALLOC_END   (VMALLOC_START + VALID_EA_BITS)

@@ -54,7 +54,7 @@
  */
 #define IMALLOC_START (ioremap_bot)
 #define IMALLOC_VMADDR(x) ((unsigned long)(x))
-#define IMALLOC_BASE  (0xE000000000000000)
+#define IMALLOC_BASE  (0xE000000000000000UL)
 #define IMALLOC_END   (IMALLOC_BASE + VALID_EA_BITS)

 /*
===== include/asm-ppc64/processor.h 1.30 vs edited =====
--- 1.30/include/asm-ppc64/processor.h	Sat Jun  7 11:19:27 2003
+++ edited/include/asm-ppc64/processor.h	Fri Jun 20 18:15:26 2003
@@ -502,21 +502,21 @@
 /*
  * Begining of traceback info work for asm functions.
  */
-#define TB_ASM		0x000C000000000000
-#define TB_GLOBALLINK	0x0000800000000000
-#define TB_IS_EPROL	0x0000400000000000
-#define TB_HAS_TBOFF	0x0000200000000000
-#define TB_INT_PROC	0x0000100000000000
-#define TB_HAS_CTL	0x0000080000000000
-#define TB_TOCLESS	0x0000040000000000
-#define TB_FP_PRESENT	0x0000020000000000
-#define TB_LOG_ABORT	0x0000010000000000
-#define TB_INT_HNDL	0x0000008000000000
-#define TB_NAME_PRESENT	0x0000004000000000
-#define TB_SAVES_CR	0x0000000200000000
-#define TB_SAVES_LR	0x0000000100000000
-#define TB_STORES_BC	0x0000000080000000
-#define TB_PARMINFO	0x000000000000FFFF
+#define TB_ASM		0x000C000000000000UL
+#define TB_GLOBALLINK	0x0000800000000000UL
+#define TB_IS_EPROL	0x0000400000000000UL
+#define TB_HAS_TBOFF	0x0000200000000000UL
+#define TB_INT_PROC	0x0000100000000000UL
+#define TB_HAS_CTL	0x0000080000000000UL
+#define TB_TOCLESS	0x0000040000000000UL
+#define TB_FP_PRESENT	0x0000020000000000UL
+#define TB_LOG_ABORT	0x0000010000000000UL
+#define TB_INT_HNDL	0x0000008000000000UL
+#define TB_NAME_PRESENT	0x0000004000000000UL
+#define TB_SAVES_CR	0x0000000200000000UL
+#define TB_SAVES_LR	0x0000000100000000UL
+#define TB_STORES_BC	0x0000000080000000UL
+#define TB_PARMINFO	0x000000000000FFFFUL
 #define TB_DEFAULT	TB_ASM | TB_HAS_TBOFF | TB_NAME_PRESENT

 #ifdef __ASSEMBLY__
===== include/asm-ppc64/signal.h 1.6 vs edited =====
--- 1.6/include/asm-ppc64/signal.h	Wed May 28 08:36:24 2003
+++ edited/include/asm-ppc64/signal.h	Sat Jun 21 00:22:19 2003
@@ -148,12 +148,14 @@
 struct timespec;
 extern int do_signal(sigset_t *oldset, struct pt_regs *regs);
 extern int do_signal32(sigset_t *oldset, struct pt_regs *regs);
-extern long sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset,
-			       size_t sigsetsize);
-extern long sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
-extern long sys_rt_sigtimedwait(const sigset_t *uthese, siginfo_t *uinfo,
-				const struct timespec *uts, size_t sigsetsize);
-extern long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t *uinfo);
+extern long sys_rt_sigprocmask(int how, sigset_t __user *set,
+			       sigset_t __user *oset, size_t sigsetsize);
+extern long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize);
+extern long sys_rt_sigtimedwait(const sigset_t __user *uthese,
+				siginfo_t __user *uinfo,
+				const struct timespec __user *uts,
+				size_t sigsetsize);
+extern long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo);
 #define ptrace_signal_deliver(regs, cookie) do { } while (0)

 struct pt_regs;
===== include/asm-ppc64/thread_info.h 1.8 vs edited =====
--- 1.8/include/asm-ppc64/thread_info.h	Wed Jun  4 23:42:25 2003
+++ edited/include/asm-ppc64/thread_info.h	Fri Jun 20 16:46:36 2003
@@ -58,10 +58,6 @@
 #define get_thread_info(ti)	get_task_struct((ti)->task)
 #define put_thread_info(ti)	put_task_struct((ti)->task)

-#if THREAD_SIZE != (4*PAGE_SIZE)
-#error update vmlinux.lds and current_thread_info to match
-#endif
-
 /* how to get the thread information struct from C */
 static inline struct thread_info *current_thread_info(void)
 {
===== include/asm-ppc64/uaccess.h 1.10 vs edited =====
--- 1.10/include/asm-ppc64/uaccess.h	Sat Jun 21 18:09:48 2003
+++ edited/include/asm-ppc64/uaccess.h	Sat Jun 21 18:11:47 2003
@@ -56,7 +56,7 @@
 #define access_ok(type,addr,size) \
 	__access_ok(((unsigned long)(addr)),(size),get_fs())

-static inline int verify_area(int type, const void *addr, unsigned long size)
+static inline int verify_area(int type, const void __user *addr, unsigned long size)
 {
 	return access_ok(type,addr,size) ? 0 : -EFAULT;
 }
@@ -213,7 +213,8 @@

 /* more complex routines */

-extern unsigned long __copy_tofrom_user(void *to, const void *from,
+extern unsigned long __copy_tofrom_user(void __user *to,
+					const void __user *from,
 					unsigned long size);

 /* XXX should zero destination if fault happened */
@@ -238,7 +239,7 @@
 			return ret;
 		}
 	}
-	return __copy_tofrom_user(to, from, n);
+	return __copy_tofrom_user((void __user *)to, from, n);
 }

 static inline unsigned long
@@ -262,14 +263,14 @@
 			return ret;
 		}
 	}
-	return __copy_tofrom_user(to, from, n);
+	return __copy_tofrom_user(to, (void __user *)from, n);
 }

 #define __copy_in_user(to, from, size) \
 	__copy_tofrom_user((to), (from), (size))

 static inline unsigned long
-copy_from_user(void *to, const void *from, unsigned long n)
+copy_from_user(void *to, const void __user *from, unsigned long n)
 {
 	if (likely(access_ok(VERIFY_READ, from, n)))
 		n = __copy_from_user(to, from, n);
@@ -277,7 +278,7 @@
 }

 static inline unsigned long
-copy_to_user(void *to, const void *from, unsigned long n)
+copy_to_user(void __user *to, const void *from, unsigned long n)
 {
 	if (likely(access_ok(VERIFY_WRITE, to, n)))
 		n = __copy_to_user(to, from, n);
@@ -285,7 +286,7 @@
 }

 static inline unsigned long
-copy_in_user(void *to, const void *from, unsigned long n)
+copy_in_user(void __user *to, const void __user *from, unsigned long n)
 {
 	if (likely(access_ok(VERIFY_READ, from, n) &&
 	    access_ok(VERIFY_WRITE, to, n)))
@@ -293,20 +294,20 @@
 	return n;
 }

-extern unsigned long __clear_user(void *addr, unsigned long size);
+extern unsigned long __clear_user(void __user *addr, unsigned long size);

 static inline unsigned long
-clear_user(void *addr, unsigned long size)
+clear_user(void __user *addr, unsigned long size)
 {
 	if (likely(access_ok(VERIFY_WRITE, addr, size)))
 		size = __clear_user(addr, size);
 	return size;
 }

-extern int __strncpy_from_user(char *dst, const char *src, long count);
+extern int __strncpy_from_user(char *dst, const char __user *src, long count);

 static inline long
-strncpy_from_user(char *dst, const char *src, long count)
+strncpy_from_user(char *dst, const char __user *src, long count)
 {
 	if (likely(access_ok(VERIFY_READ, src, 1)))
 		return __strncpy_from_user(dst, src, count);
@@ -318,14 +319,14 @@
  *
  * Return 0 for error
  */
-extern int __strnlen_user(const char *str, long len);
+extern int __strnlen_user(const char __user *str, long len);

 /*
  * Returns the length of the string at str (including the null byte),
  * or 0 if we hit a page we can't access,
  * or something > len if we didn't find a null byte.
  */
-static inline int strnlen_user(const char *str, long len)
+static inline int strnlen_user(const char __user *str, long len)
 {
 	if (likely(access_ok(VERIFY_READ, str, 1)))
 		return __strnlen_user(str, len);
===== include/asm-ppc64/iSeries/HvCallSc.h 1.2 vs edited =====
--- 1.2/include/asm-ppc64/iSeries/HvCallSc.h	Sun Jun  9 19:59:38 2002
+++ edited/include/asm-ppc64/iSeries/HvCallSc.h	Fri Jun 20 16:09:15 2003
@@ -24,14 +24,14 @@
 #ifndef _HVCALLSC_H
 #define _HVCALLSC_H

-#define HvCallBase		0x8000000000000000
-#define HvCallCc		0x8001000000000000
-#define HvCallCfg		0x8002000000000000
-#define HvCallEvent		0x8003000000000000
-#define HvCallHpt		0x8004000000000000
-#define HvCallPci		0x8005000000000000
-#define HvCallSm		0x8007000000000000
-#define HvCallXm		0x8009000000000000
+#define HvCallBase		0x8000000000000000UL
+#define HvCallCc		0x8001000000000000UL
+#define HvCallCfg		0x8002000000000000UL
+#define HvCallEvent		0x8003000000000000UL
+#define HvCallHpt		0x8004000000000000UL
+#define HvCallPci		0x8005000000000000UL
+#define HvCallSm		0x8007000000000000UL
+#define HvCallXm		0x8009000000000000UL

 u64 HvCall0( u64 );
 u64 HvCall1( u64, u64 );
===== include/linux/bitops.h 1.4 vs edited =====
--- 1.4/include/linux/bitops.h	Fri Jun  6 16:37:30 2003
+++ edited/include/linux/bitops.h	Wed Jun 18 21:03:23 2003
@@ -115,12 +115,12 @@
 				generic_hweight32((unsigned int)w);
 #else
 	u64 res;
-	res = (w & 0x5555555555555555) + ((w >> 1) & 0x5555555555555555);
-	res = (res & 0x3333333333333333) + ((res >> 2) & 0x3333333333333333);
-	res = (res & 0x0F0F0F0F0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F0F0F0F0F);
-	res = (res & 0x00FF00FF00FF00FF) + ((res >> 8) & 0x00FF00FF00FF00FF);
-	res = (res & 0x0000FFFF0000FFFF) + ((res >> 16) & 0x0000FFFF0000FFFF);
-	return (res & 0x00000000FFFFFFFF) + ((res >> 32) & 0x00000000FFFFFFFF);
+	res = (w & 0x5555555555555555UL) + ((w >> 1) & 0x5555555555555555UL);
+	res = (res & 0x3333333333333333UL) + ((res >> 2) & 0x3333333333333333UL);
+	res = (res & 0x0F0F0F0F0F0F0F0FUL) + ((res >> 4) & 0x0F0F0F0F0F0F0F0FUL);
+	res = (res & 0x00FF00FF00FF00FFUL) + ((res >> 8) & 0x00FF00FF00FF00FFUL);
+	res = (res & 0x0000FFFF0000FFFFUL) + ((res >> 16) & 0x0000FFFF0000FFFFUL);
+	return (res & 0x00000000FFFFFFFFUL) + ((res >> 32) & 0x00000000FFFFFFFFUL);
 #endif
 }

===== include/linux/compat.h 1.11 vs edited =====
--- 1.11/include/linux/compat.h	Wed Apr 16 15:48:21 2003
+++ edited/include/linux/compat.h	Sat Jun 21 00:41:39 2003
@@ -38,9 +38,11 @@
 	compat_sigset_word	sig[_COMPAT_NSIG_WORDS];
 } compat_sigset_t;

-extern int cp_compat_stat(struct kstat *, struct compat_stat *);
-extern int get_compat_timespec(struct timespec *, struct compat_timespec *);
-extern int put_compat_timespec(struct timespec *, struct compat_timespec *);
+extern int cp_compat_stat(struct kstat *, struct compat_stat __user *);
+extern int get_compat_timespec(struct timespec *,
+			       struct compat_timespec __user *);
+extern int put_compat_timespec(struct timespec *,
+			       struct compat_timespec __user *);

 struct compat_iovec {
 	compat_uptr_t	iov_base;
===== kernel/compat.c 1.17 vs edited =====
--- 1.17/kernel/compat.c	Tue Jun 17 22:37:03 2003
+++ edited/kernel/compat.c	Sat Jun 21 00:33:04 2003
@@ -22,14 +22,14 @@

 #include <asm/uaccess.h>

-int get_compat_timespec(struct timespec *ts, struct compat_timespec *cts)
+int get_compat_timespec(struct timespec *ts, struct compat_timespec __user *cts)
 {
 	return (verify_area(VERIFY_READ, cts, sizeof(*cts)) ||
 			__get_user(ts->tv_sec, &cts->tv_sec) ||
 			__get_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
 }

-int put_compat_timespec(struct timespec *ts, struct compat_timespec *cts)
+int put_compat_timespec(struct timespec *ts, struct compat_timespec __user *cts)
 {
 	return (verify_area(VERIFY_WRITE, cts, sizeof(*cts)) ||
 			__put_user(ts->tv_sec, &cts->tv_sec) ||
@@ -39,7 +39,7 @@
 static long compat_nanosleep_restart(struct restart_block *restart)
 {
 	unsigned long expire = restart->arg0, now = jiffies;
-	struct compat_timespec *rmtp;
+	struct compat_timespec __user *rmtp;

 	/* Did it expire while we handled signals? */
 	if (!time_after(expire, now))
@@ -50,7 +50,7 @@
 	if (expire == 0)
 		return 0;

-	rmtp = (struct compat_timespec *)restart->arg1;
+	rmtp = (struct compat_timespec __user *)restart->arg1;
 	if (rmtp) {
 		struct compat_timespec ct;
 		struct timespec t;
@@ -65,8 +65,8 @@
 	return -ERESTART_RESTARTBLOCK;
 }

-asmlinkage long compat_sys_nanosleep(struct compat_timespec *rqtp,
-		struct compat_timespec *rmtp)
+asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
+		struct compat_timespec __user *rmtp)
 {
 	struct timespec t;
 	struct restart_block *restart;
@@ -151,7 +151,7 @@
 	return 0;
 }

-asmlinkage long compat_sys_times(struct compat_tms *tbuf)
+asmlinkage long compat_sys_times(struct compat_tms __user *tbuf)
 {
 	/*
 	 *	In the SMP world we might just be unlucky and have one of
@@ -214,7 +214,7 @@

 #ifdef CONFIG_FUTEX
 asmlinkage long compat_sys_futex(u32 *uaddr, int op, int val,
-		struct compat_timespec *utime, u32 *uaddr2)
+		struct compat_timespec __user *utime, u32 *uaddr2)
 {
 	struct timespec t;
 	unsigned long timeout = MAX_SCHEDULE_TIMEOUT;

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list