* Licensed under the GPL
*/
+#include <linux/config.h>
+#include <linux/compiler.h>
#include "linux/sched.h"
#include "asm/elf.h"
#include "asm/ptrace.h"
#include "asm/uaccess.h"
+#include "asm/unistd.h"
#include "ptrace_user.h"
#include "sysdep/sigcontext.h"
#include "sysdep/sc.h"
unsigned short instr;
int n;
- n = copy_from_user(&instr, (void *) addr, sizeof(instr));
+ n = copy_from_user(&instr, (void __user *) addr, sizeof(instr));
if(n){
- printk("is_syscall : failed to read instruction from 0x%lu\n",
+ printk("is_syscall : failed to read instruction from 0x%lx\n",
addr);
return(0);
}
- return(instr == 0x80cd);
+ /* int 0x80 or sysenter */
+ return((instr == 0x80cd) || (instr == 0x340f));
}
/* determines which flags the user has access to. */
*/
#ifdef CONFIG_MODE_TT
-static inline int convert_fxsr_to_user_tt(struct _fpstate *buf,
+static inline int convert_fxsr_to_user_tt(struct _fpstate __user *buf,
struct pt_regs *regs)
{
struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs));
unsigned long env[7];
- struct _fpreg *to;
+ struct _fpreg __user *to;
struct _fpxreg *from;
int i;
}
#endif
-static inline int convert_fxsr_to_user(struct _fpstate *buf,
+static inline int convert_fxsr_to_user(struct _fpstate __user *buf,
struct pt_regs *regs)
{
return(CHOOSE_MODE(convert_fxsr_to_user_tt(buf, regs), 0));
#ifdef CONFIG_MODE_TT
static inline int convert_fxsr_from_user_tt(struct pt_regs *regs,
- struct _fpstate *buf)
+ struct _fpstate __user *buf)
{
struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs));
unsigned long env[7];
struct _fpxreg *to;
- struct _fpreg *from;
+ struct _fpreg __user *from;
int i;
if ( __copy_from_user( env, buf, 7 * sizeof(long) ) )
#endif
static inline int convert_fxsr_from_user(struct pt_regs *regs,
- struct _fpstate *buf)
+ struct _fpstate __user *buf)
{
return(CHOOSE_MODE(convert_fxsr_from_user_tt(regs, buf), 0));
}
{
int err;
- err = convert_fxsr_to_user((struct _fpstate *) buf,
+ err = convert_fxsr_to_user((struct _fpstate __user *) buf,
&child->thread.regs);
if(err) return(-EFAULT);
else return(0);
int err;
err = convert_fxsr_from_user(&child->thread.regs,
- (struct _fpstate *) buf);
+ (struct _fpstate __user *) buf);
if(err) return(-EFAULT);
else return(0);
}
struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs));
int err;
- err = __copy_to_user((void *) buf, fxsave,
+ err = __copy_to_user((void __user *) buf, fxsave,
sizeof(struct user_fxsr_struct));
if(err) return -EFAULT;
else return 0;
struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs));
int err;
- err = __copy_from_user(fxsave, (void *) buf,
+ err = __copy_from_user(fxsave, (void __user *) buf,
sizeof(struct user_fxsr_struct) );
if(err) return -EFAULT;
else return 0;