[PATCH] ppc64: Remove A() and AA()
Anton Blanchard
anton at samba.org
Wed Sep 15 22:25:00 EST 2004
Remove the A() and AA() macros. Now we have compat_ptr we should be
using that.
Signed-off-by: Anton Blanchard <anton at samba.org>
diff -puN include/asm-ppc64/ppc32.h~remove_A_and_AA include/asm-ppc64/ppc32.h
--- 2.6.9-rc1-mm5/include/asm-ppc64/ppc32.h~remove_A_and_AA 2004-09-14 15:46:08.566253864 +1000
+++ 2.6.9-rc1-mm5-anton/include/asm-ppc64/ppc32.h 2004-09-14 15:46:37.434377476 +1000
@@ -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 {
diff -puN arch/ppc64/kernel/sys_ppc32.c~remove_A_and_AA arch/ppc64/kernel/sys_ppc32.c
--- 2.6.9-rc1-mm5/arch/ppc64/kernel/sys_ppc32.c~remove_A_and_AA 2004-09-14 15:46:45.022847819 +1000
+++ 2.6.9-rc1-mm5-anton/arch/ppc64/kernel/sys_ppc32.c 2004-09-14 18:34:51.658432705 +1000
@@ -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
(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
(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(stru
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 -puN arch/ppc64/kernel/ioctl32.c~remove_A_and_AA arch/ppc64/kernel/ioctl32.c
--- 2.6.9-rc1-mm5/arch/ppc64/kernel/ioctl32.c~remove_A_and_AA 2004-09-14 18:33:57.830408888 +1000
+++ 2.6.9-rc1-mm5-anton/arch/ppc64/kernel/ioctl32.c 2004-09-14 18:34:36.949325869 +1000
@@ -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 -puN arch/ppc64/kernel/signal.c~remove_A_and_AA arch/ppc64/kernel/signal.c
--- 2.6.9-rc1-mm5/arch/ppc64/kernel/signal.c~remove_A_and_AA 2004-09-14 18:34:03.085794964 +1000
+++ 2.6.9-rc1-mm5-anton/arch/ppc64/kernel/signal.c 2004-09-14 18:34:46.040943197 +1000
@@ -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>
_
More information about the Linuxppc64-dev
mailing list