#include <linux/ptrace.h>
#include <linux/aio_abi.h>
#include <linux/elf.h>
-#include <linux/vs_cvirt.h>
#include <net/scm.h>
#include <net/sock.h>
#include <asm/semaphore.h>
#include <asm/ppcdebug.h>
#include <asm/time.h>
-#include <asm/ppc32.h>
#include <asm/mmu_context.h>
+#include <asm/systemcfg.h>
#include "pci.h"
return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
}
+#ifdef CONFIG_SYSVIPC
long sys32_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr,
u32 fifth)
{
return -ENOSYS;
}
+#endif
/* Note: it is necessary to treat out_fd and in_fd as unsigned ints,
* with the corresponding cast to a signed int to insure that the
error = PTR_ERR(filename);
if (IS_ERR(filename))
goto out;
- if (regs->msr & MSR_FP)
- giveup_fpu(current);
-#ifdef CONFIG_ALTIVEC
- if (regs->msr & MSR_VEC)
- giveup_altivec(current);
-#endif /* CONFIG_ALTIVEC */
+ flush_fp_to_thread(current);
+ flush_altivec_to_thread(current);
error = compat_do_execve(filename, compat_ptr(a1), compat_ptr(a2), regs);
- if (error == 0)
+ if (error == 0) {
+ task_lock(current);
current->ptrace &= ~PT_DTRACE;
+ task_unlock(current);
+ }
putname(filename);
out:
void start_thread32(struct pt_regs* regs, unsigned long nip, unsigned long sp)
{
set_fs(USER_DS);
- memset(regs->gpr, 0, sizeof(regs->gpr));
- memset(®s->ctr, 0, 4 * sizeof(regs->ctr));
+
+ /*
+ * If we exec out of a kernel thread then thread.regs will not be
+ * set. Do it now.
+ */
+ if (!current->thread.regs) {
+ unsigned long childregs = (unsigned long)current->thread_info +
+ THREAD_SIZE;
+ childregs -= sizeof(struct pt_regs);
+ current->thread.regs = (struct pt_regs *)childregs;
+ }
+
+ /*
+ * ELF_PLAT_INIT already clears all registers but it also sets r2.
+ * So just clear r2 here.
+ */
+ regs->gpr[2] = 0;
+
regs->nip = nip;
regs->gpr[1] = sp;
regs->msr = MSR_USER32;
(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)
(unsigned long) dfn,
(unsigned long) off,
(unsigned long) len,
- (unsigned char __user *)AA(ubuf));
+ compat_ptr(ubuf));
}
#define IOBASE_BRIDGE_NUMBER 0
return sys_umask((int)mask);
}
+#ifdef CONFIG_SYSCTL
struct __sysctl_args32 {
u32 name;
int nlen;
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;
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));
}
return error;
}
-
-asmlinkage long sys32_time(compat_time_t __user * tloc)
-{
- compat_time_t secs;
-
- struct timeval tv;
-
- do_gettimeofday( &tv );
- secs = tv.tv_sec;
-
- if (tloc) {
- if (put_user(secs,tloc))
- secs = -EFAULT;
- }
-
- return secs;
-}
+#endif
asmlinkage int sys32_olduname(struct oldold_utsname __user * name)
{
return err;
}
+
+asmlinkage long sys32_add_key(const char __user *_type,
+ const char __user *_description,
+ const void __user *_payload,
+ u32 plen,
+ u32 ringid)
+{
+ return sys_add_key(_type, _description, _payload, plen, ringid);
+}
+
+asmlinkage long sys32_request_key(const char __user *_type,
+ const char __user *_description,
+ const char __user *_callout_info,
+ u32 destringid)
+{
+ return sys_request_key(_type, _description, _callout_info, destringid);
+}
+