From: Paul Mackerras <paulus@samba.org>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org, trini@kernel.crashing.org,
benh@kernel.crashing.org
Subject: [PATCH] PPC 64-bit get/put_user
Date: Wed, 12 Sep 2001 09:40:40 +1000 (EST) [thread overview]
Message-ID: <15262.41208.111676.456259@cargo.ozlabs.ibm.com> (raw)
Linus,
The patch below adds support for 64-bit quantities in get_user,
put_user, etc. on PowerPC. This is needed because of the addition of
the BLKGETSIZE64 ioctl. Please apply to your tree.
Regards,
Paul.
--- linux/include/asm-ppc/uaccess.h Sat May 26 12:39:54 2001
+++ linuxppc_2_4/include/asm-ppc/uaccess.h Tue Sep 11 18:10:06 2001
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.uaccess.h 1.5 05/17/01 18:14:26 cort
+ * BK Id: SCCS/s.uaccess.h 1.8 09/11/01 18:10:06 paulus
*/
#ifdef __KERNEL__
#ifndef _PPC_UACCESS_H
@@ -116,6 +116,7 @@
case 1: __put_user_asm(x,ptr,retval,"stb"); break; \
case 2: __put_user_asm(x,ptr,retval,"sth"); break; \
case 4: __put_user_asm(x,ptr,retval,"stw"); break; \
+ case 8: __put_user_asm2(x,ptr,retval); break; \
default: __put_user_bad(); \
} \
} while (0)
@@ -143,6 +144,22 @@
: "=r"(err) \
: "r"(x), "b"(addr), "i"(-EFAULT), "0"(err))
+#define __put_user_asm2(x, addr, err) \
+ __asm__ __volatile__( \
+ "1: stw %1,0(%2)\n" \
+ "2: stw %1+1,4(%2)\n" \
+ "3:\n" \
+ ".section .fixup,\"ax\"\n" \
+ "4: li %0,%3\n" \
+ " b 3b\n" \
+ ".previous\n" \
+ ".section __ex_table,\"a\"\n" \
+ " .align 2\n" \
+ " .long 1b,4b\n" \
+ " .long 2b,4b\n" \
+ ".previous" \
+ : "=r"(err) \
+ : "r"(x), "b"(addr), "i"(-EFAULT), "0"(err))
#define __get_user_nocheck(x,ptr,size) \
({ \
@@ -171,6 +188,7 @@
case 1: __get_user_asm(x,ptr,retval,"lbz"); break; \
case 2: __get_user_asm(x,ptr,retval,"lhz"); break; \
case 4: __get_user_asm(x,ptr,retval,"lwz"); break; \
+ case 8: __get_user_asm2(x, ptr, retval); \
default: (x) = __get_user_bad(); \
} \
} while (0)
@@ -189,6 +207,25 @@
" .long 1b,3b\n" \
".previous" \
: "=r"(err), "=r"(x) \
+ : "b"(addr), "i"(-EFAULT), "0"(err))
+
+#define __get_user_asm2(x, addr, err) \
+ __asm__ __volatile__( \
+ "1: lwz %1,0(%2)\n" \
+ "2: lwz %1+1,4(%2)\n" \
+ "3:\n" \
+ ".section .fixup,\"ax\"\n" \
+ "4: li %0,%3\n" \
+ " li %1,0\n" \
+ " li %1+1,0\n" \
+ " b 3b\n" \
+ ".previous\n" \
+ ".section __ex_table,\"a\"\n" \
+ " .align 2\n" \
+ " .long 1b,4b\n" \
+ " .long 2b,4b\n" \
+ ".previous" \
+ : "=r"(err), "=&r"(x) \
: "b"(addr), "i"(-EFAULT), "0"(err))
/* more complex routines */
reply other threads:[~2001-09-11 23:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15262.41208.111676.456259@cargo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
--cc=trini@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®