Commit 95906b24 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds
Browse files

uml: style fixes in arch/um/sys-x86_64



Style fixes in arch/um/sys-x86_64:
	updated copyrights
	CodingStyle fixes
	added severities to printks which needed them

A bunch of functions in sys-*/ptrace_user.c turn out to be unused, so they and
their declarations are gone.

Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7281ff95
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
/* 
 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 * Licensed under the GPL
 */

@@ -10,12 +10,6 @@

extern int ptrace_getregs(long pid, unsigned long *regs_out);
extern int ptrace_setregs(long pid, unsigned long *regs_in);
extern int ptrace_getfpregs(long pid, unsigned long *regs_out);
extern int ptrace_setfpregs(long pid, unsigned long *regs);
extern void arch_enter_kernel(void *task, int pid);
extern void arch_leave_kernel(void *task, int pid);
extern void ptrace_pokeuser(unsigned long addr, unsigned long data);


/* syscall emulation path in ptrace */

@@ -54,7 +48,8 @@ extern int sysemu_supported;
	(((int[3][3] ) { \
		{ PTRACE_SYSCALL, PTRACE_SYSCALL, PTRACE_SINGLESTEP }, \
		{ PTRACE_SYSEMU, PTRACE_SYSEMU, PTRACE_SINGLESTEP }, \
		{ PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP, PTRACE_SYSEMU_SINGLESTEP }}) \
		{ PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP, \
		  PTRACE_SYSEMU_SINGLESTEP } }) \
		[sysemu_mode][singlestep_mode])

#endif
+0 −14
Original line number Diff line number Diff line
@@ -19,17 +19,3 @@ int ptrace_setregs(long pid, unsigned long *regs)
		return -errno;
	return 0;
}

int ptrace_getfpregs(long pid, unsigned long *regs)
{
	if (ptrace(PTRACE_GETFPREGS, pid, 0, regs) < 0)
		return -errno;
	return 0;
}

int ptrace_setfpregs(long pid, unsigned long *regs)
{
	if (ptrace(PTRACE_SETFPREGS, pid, 0, regs) < 0)
		return -errno;
	return 0;
}
+2 −1
Original line number Diff line number Diff line
@@ -5,7 +5,8 @@

#include <linux/uaccess.h>

/* Mostly copied from i386/x86_86 - eliminated the eip < PAGE_OFFSET because
/*
 * Mostly copied from i386/x86_86 - eliminated the eip < PAGE_OFFSET because
 * that's not relevant in skas mode.
 */

+15 −14
Original line number Diff line number Diff line
@@ -5,13 +5,12 @@
 * Licensed under the GPL
 */

#define __FRAME_OFFSETS
#include <asm/ptrace.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/mm.h>
#define __FRAME_OFFSETS
#include <asm/ptrace.h>
#include <asm/uaccess.h>
#include <asm/elf.h>

/*
 * determines which flags the user has access to.
@@ -24,8 +23,10 @@ int putreg(struct task_struct *child, int regno, unsigned long value)
	unsigned long tmp;

#ifdef TIF_IA32
	/* Some code in the 64bit emulation may not be 64bit clean.
	   Don't take any chances. */
	/*
	 * Some code in the 64bit emulation may not be 64bit clean.
	 * Don't take any chances.
	 */
	if (test_tsk_thread_flag(child, TIF_IA32))
		value &= 0xffffffff;
#endif
@@ -108,9 +109,8 @@ int peek_user(struct task_struct *child, long addr, long data)
		return -EIO;

	tmp = 0;  /* Default return condition */
	if (addr < MAX_REG_OFFSET){
	if (addr < MAX_REG_OFFSET)
		tmp = getreg(child, addr);
	}
	else if ((addr >= offsetof(struct user, u_debugreg[0])) &&
		(addr <= offsetof(struct user, u_debugreg[7]))) {
		addr -= offsetof(struct user, u_debugreg[0]);
@@ -128,7 +128,8 @@ int is_syscall(unsigned long addr)

	n = copy_from_user(&instr, (void __user *) addr, sizeof(instr));
	if (n) {
		/* access_process_vm() grants access to vsyscall and stub,
		/*
		 * access_process_vm() grants access to vsyscall and stub,
		 * while copy_from_user doesn't. Maybe access_process_vm is
		 * slow, but that doesn't matter, since it will be called only
		 * in case of singlestepping, if copy_from_user failed.
+5 −41
Original line number Diff line number Diff line
@@ -4,55 +4,19 @@
 * Licensed under the GPL
 */

#include <stddef.h>
#include <errno.h>
#include "ptrace_user.h"
#include "user.h"
#include "kern_constants.h"

int ptrace_getregs(long pid, unsigned long *regs_out)
{
	if (ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
		return(-errno);
	return(0);
}

int ptrace_setregs(long pid, unsigned long *regs)
{
	if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0)
		return(-errno);
		return -errno;
	return(0);
}

int ptrace_setfpregs(long pid, unsigned long *regs)
int ptrace_setregs(long pid, unsigned long *regs_out)
{
	if (ptrace(PTRACE_SETFPREGS, pid, 0, regs) < 0)
	if (ptrace(PTRACE_SETREGS, pid, 0, regs_out) < 0)
		return -errno;
	return 0;
}

void ptrace_pokeuser(unsigned long addr, unsigned long data)
{
	panic("ptrace_pokeuser");
}

#define DS 184
#define ES 192
#define __USER_DS     0x2b

void arch_enter_kernel(void *task, int pid)
{
}

void arch_leave_kernel(void *task, int pid)
{
#ifdef UM_USER_CS
        if(ptrace(PTRACE_POKEUSR, pid, CS, UM_USER_CS) < 0)
                printk("POKEUSR CS failed");
#endif

        if(ptrace(PTRACE_POKEUSR, pid, DS, __USER_DS) < 0)
                printk("POKEUSR DS failed");
        if(ptrace(PTRACE_POKEUSR, pid, ES, __USER_DS) < 0)
                printk("POKEUSR ES failed");
	return(0);
}
Loading