Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

uml: style fixes in FP code



Tidy the code affected by the floating point fixes.

A bunch of unused stuff is gone, including two sigcontext.c files,
which turned out to be entirely unneeded.

There are the usual fixes -
	whitespace and style cleanups
	copyright updates
	emacs formatting comments gone
	include cleanups
	adding severities to printks

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 54fa0ba4
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -6,15 +6,10 @@
#ifndef __SYS_SIGCONTEXT_I386_H
#define __SYS_SIGCONTEXT_I386_H

#include "uml-config.h"
#include "skas.h"
#include "sysdep/sc.h"

#define IP_RESTART_SYSCALL(ip) ((ip) -= 2)

#define SC_RESTART_SYSCALL(sc) IP_RESTART_SYSCALL(SC_IP(sc))
#define SC_SET_SYSCALL_RETURN(sc, result) SC_EAX(sc) = (result)

#define GET_FAULTINFO_FROM_SC(fi,sc) \
	{ \
		(fi).cr2 = SC_CR2(sc); \
@@ -22,18 +17,10 @@
		(fi).trap_no = SC_TRAPNO(sc); \
	}

/* ptrace expects that, at the start of a system call, %eax contains
 * -ENOSYS, so this makes it so.
 */
#define SC_START_SYSCALL(sc) do SC_EAX(sc) = -ENOSYS; while(0)

/* This is Page Fault */
#define SEGV_IS_FIXABLE(fi)	((fi)->trap_no == 14)

/* SKAS3 has no trap_no on i386, but get_skas_faultinfo() sets it to 0. */
#define SEGV_MAYBE_FIXABLE(fi)	((fi)->trap_no == 0 && ptrace_faultinfo)

extern unsigned long *sc_sigmask(void *sc_ptr);
extern int sc_get_fpregs(unsigned long buf, void *sc_ptr);

#endif
+1 −27
Original line number Diff line number Diff line
@@ -11,12 +11,6 @@

#define IP_RESTART_SYSCALL(ip) ((ip) -= 2)

#define SC_RESTART_SYSCALL(sc) IP_RESTART_SYSCALL(SC_IP(sc))
#define SC_SET_SYSCALL_RETURN(sc, result) SC_RAX(sc) = (result)

#define SC_FAULT_ADDR(sc) SC_CR2(sc)
#define SC_FAULT_TYPE(sc) SC_ERR(sc)

#define GET_FAULTINFO_FROM_SC(fi, sc) \
	{ \
		(fi).cr2 = SC_CR2(sc); \
@@ -24,30 +18,10 @@
		(fi).trap_no = SC_TRAPNO(sc); \
	}

/* ptrace expects that, at the start of a system call, %eax contains
 * -ENOSYS, so this makes it so.
 */

#define SC_START_SYSCALL(sc) do SC_RAX(sc) = -ENOSYS; while(0)

/* This is Page Fault */
#define SEGV_IS_FIXABLE(fi)	((fi)->trap_no == 14)

/* No broken SKAS API, which doesn't pass trap_no, here. */
#define SEGV_MAYBE_FIXABLE(fi)	0

extern unsigned long *sc_sigmask(void *sc_ptr);

#endif

/*
 * Overrides for Emacs so that we follow Linus's tabbing style.
 * Emacs will notice this stuff at the end of the file and automatically
 * adjust the settings for this buffer only.  This must remain at the end
 * of the file.
 * ---------------------------------------------------------------------------
 * Local variables:
 * c-file-style: "linux"
 * End:
 */
+0 −2
Original line number Diff line number Diff line
@@ -171,8 +171,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
		 */
		ret = copy_to_user(p, &child->thread.arch.faultinfo,
				   sizeof(struct ptrace_faultinfo));
		if (ret)
			break;
		break;
	}

+16 −10
Original line number Diff line number Diff line
/*
 * Copyright (C) 2004 PathScale, Inc
 * Copyright (C) 2004 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 * Licensed under the GPL
 */

#include <errno.h>
#include <sysdep/ptrace_user.h>
#include "kern_constants.h"
#include "longjmp.h"
#include "user.h"
#include "sysdep/ptrace_user.h"

int save_fp_registers(int pid, unsigned long *fp_regs)
{
@@ -39,11 +41,15 @@ int restore_fpx_registers(int pid, unsigned long *fp_regs)
unsigned long get_thread_reg(int reg, jmp_buf *buf)
{
	switch (reg) {
	case EIP: return buf[0]->__eip;
	case UESP: return buf[0]->__esp;
	case EBP: return buf[0]->__ebp;
	case EIP:
		return buf[0]->__eip;
	case UESP:
		return buf[0]->__esp;
	case EBP:
		return buf[0]->__ebp;
	default:
		printk("get_thread_regs - unknown register %d\n", reg);
		printk(UM_KERN_ERR "get_thread_regs - unknown register %d\n",
		       reg);
		return 0;
	}
}
+3 −3
Original line number Diff line number Diff line
@@ -3,14 +3,14 @@
#

obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
	ptrace_user.o setjmp.o signal.o sigcontext.o stub.o stub_segv.o \
	syscalls.o sysrq.o sys_call_table.o tls.o
	ptrace_user.o setjmp.o signal.o stub.o stub_segv.o syscalls.o sysrq.o \
	sys_call_table.o tls.o

subarch-obj-y = lib/bitops_32.o lib/semaphore_32.o lib/string_32.o
subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem_32.o
subarch-obj-$(CONFIG_MODULES) += kernel/module_32.o

USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
USER_OBJS := bugs.o ptrace_user.o fault.o

USER_OBJS += user-offsets.s
extra-y += user-offsets.s
Loading