summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2004-09-16 21:57:44 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-16 21:57:44 -0700
commitbcd1340bd7a1adde76ff77ffd11a32c58c053b4e (patch)
tree8f0649e859ab6e54d9015dbe2421d61aeb26210f
parent890d643b7f8e337a4fe92e2d5fbb740f4b49e06f (diff)
[PATCH] ppc64: Remove A() and AA()
Remove the A() and AA() macros. Now we have compat_ptr we should be using that. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/ppc64/kernel/ioctl32.c2
-rw-r--r--arch/ppc64/kernel/signal.c1
-rw-r--r--arch/ppc64/kernel/sys_ppc32.c16
-rw-r--r--include/asm-ppc64/ppc32.h24
4 files changed, 8 insertions, 35 deletions
diff --git a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c
index 40ba4c17eba2..94d1a05b7839 100644
--- a/arch/ppc64/kernel/ioctl32.c
+++ b/arch/ppc64/kernel/ioctl32.c
@@ -22,9 +22,7 @@
#define INCLUDES
#include "compat_ioctl.c"
-#include <linux/ncp_fs.h>
#include <linux/syscalls.h>
-#include <asm/ppc32.h>
#define CODE
#include "compat_ioctl.c"
diff --git a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c
index 488f1b28ace6..ce616280b7bd 100644
--- a/arch/ppc64/kernel/signal.c
+++ b/arch/ppc64/kernel/signal.c
@@ -26,7 +26,6 @@
#include <linux/unistd.h>
#include <linux/stddef.h>
#include <linux/elf.h>
-#include <asm/ppc32.h>
#include <asm/sigcontext.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
index 26e5e8dd9a76..3dd7256e517c 100644
--- a/arch/ppc64/kernel/sys_ppc32.c
+++ b/arch/ppc64/kernel/sys_ppc32.c
@@ -72,7 +72,6 @@
#include <asm/semaphore.h>
#include <asm/ppcdebug.h>
#include <asm/time.h>
-#include <asm/ppc32.h>
#include <asm/mmu_context.h>
#include "pci.h"
@@ -700,7 +699,7 @@ asmlinkage int sys32_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf
(unsigned long) dfn,
(unsigned long) off,
(unsigned long) len,
- (unsigned char __user *)AA(ubuf));
+ compat_ptr(ubuf));
}
asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
@@ -709,7 +708,7 @@ asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubu
(unsigned long) dfn,
(unsigned long) off,
(unsigned long) len,
- (unsigned char __user *)AA(ubuf));
+ compat_ptr(ubuf));
}
#define IOBASE_BRIDGE_NUMBER 0
@@ -1095,7 +1094,7 @@ struct __sysctl_args32 {
u32 __unused[4];
};
-extern asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
+asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
{
struct __sysctl_args32 tmp;
int error;
@@ -1114,19 +1113,20 @@ extern asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
glibc's __sysctl uses rw memory for the structure
anyway. */
oldlenp = (size_t __user *)addr;
- if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) ||
+ if (get_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)) ||
put_user(oldlen, oldlenp))
return -EFAULT;
}
lock_kernel();
- error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval),
- oldlenp, (void __user *)A(tmp.newval), tmp.newlen);
+ error = do_sysctl(compat_ptr(tmp.name), tmp.nlen,
+ compat_ptr(tmp.oldval), oldlenp,
+ compat_ptr(tmp.newval), tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, oldlenp) ||
- put_user(oldlen, (u32 __user *)A(tmp.oldlenp)))
+ put_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)))
error = -EFAULT;
}
copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
diff --git a/include/asm-ppc64/ppc32.h b/include/asm-ppc64/ppc32.h
index f4a36ea035f2..2897d3281b43 100644
--- a/include/asm-ppc64/ppc32.h
+++ b/include/asm-ppc64/ppc32.h
@@ -14,30 +14,6 @@
* 2 of the License, or (at your option) any later version.
*/
-/* Use this to get at 32-bit user passed pointers. */
-/* Things to consider: the low-level assembly stub does
- srl x, 0, x for first four arguments, so if you have
- pointer to something in the first four arguments, just
- declare it as a pointer, not u32. On the other side,
- arguments from 5th onwards should be declared as u32
- for pointers, and need AA() around each usage.
- A() macro should be used for places where you e.g.
- have some internal variable u32 and just want to get
- rid of a compiler warning. AA() has to be used in
- places where you want to convert a function argument
- to 32bit pointer or when you e.g. access pt_regs
- structure and want to consider 32bit registers only.
- -
- */
-#define A(__x) ((unsigned long)(__x))
-#define AA(__x) \
-({ unsigned long __ret; \
- __asm__ ("clrldi %0, %0, 32" \
- : "=r" (__ret) \
- : "0" (__x)); \
- __ret; \
-})
-
/* These are here to support 32-bit syscalls on a 64-bit kernel. */
typedef struct compat_siginfo {