]> err.no Git - linux-2.6/commitdiff
uml: throw out CHOOSE_MODE
authorJeff Dike <jdike@addtoit.com>
Tue, 16 Oct 2007 08:26:56 +0000 (01:26 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:43:05 +0000 (09:43 -0700)
The next stage after removing code which depends on CONFIG_MODE_TT is removing
the CHOOSE_MODE abstraction, which provided both compile-time and run-time
branching to either tt-mode or skas-mode code.

This patch removes choose-mode.h and all inclusions of it, and replaces all
CHOOSE_MODE invocations with the skas branch.  This leaves a number of trivial
functions which will be dealt with in a later patch.

There are some changes in the uaccess and tls support which go somewhat beyond
this and eliminate some of the now-redundant functions.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
36 files changed:
arch/um/drivers/chan_user.c
arch/um/drivers/harddog_user.c
arch/um/drivers/mconsole_kern.c
arch/um/include/choose-mode.h [deleted file]
arch/um/include/skas/uaccess-skas.h [deleted file]
arch/um/include/sysdep-i386/ptrace.h
arch/um/include/sysdep-x86_64/ptrace.h
arch/um/include/um_mmu.h
arch/um/include/um_uaccess.h
arch/um/kernel/exec.c
arch/um/kernel/ksyms.c
arch/um/kernel/physmem.c
arch/um/kernel/process.c
arch/um/kernel/reboot.c
arch/um/kernel/skas/uaccess.c
arch/um/kernel/syscall.c
arch/um/kernel/time.c
arch/um/kernel/tlb.c
arch/um/kernel/um_arch.c
arch/um/os-Linux/aio.c
arch/um/os-Linux/main.c
arch/um/os-Linux/signal.c
arch/um/os-Linux/start_up.c
arch/um/os-Linux/trap.c
arch/um/sys-i386/ldt.c
arch/um/sys-i386/ptrace.c
arch/um/sys-i386/signal.c
arch/um/sys-i386/tls.c
arch/um/sys-x86_64/signal.c
arch/um/sys-x86_64/syscalls.c
include/asm-um/a.out.h
include/asm-um/mmu_context.h
include/asm-um/processor-generic.h
include/asm-um/ptrace-i386.h
include/asm-um/tlbflush.h
include/asm-um/uaccess.h

index d29e56d8ced462764ecf721dbaf97af9d399908c..74f22d27327d0bbb1cda3dc588a828b89a28405f 100644 (file)
@@ -264,8 +264,7 @@ void register_winch(int fd, struct tty_struct *tty)
                return;
 
        pid = tcgetpgrp(fd);
-       if (!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd, tty) &&
-           (pid == -1)) {
+       if (!is_skas_winch(pid, fd, tty) && (pid == -1)) {
                thread = winch_tramp(fd, tty, &thread_fd, &stack);
                if (thread < 0)
                        return;
index 1171790f742c33c79fe41b18fe4801947cc640d8..b050e267befe879da3382de2aa9d8914dae3f671 100644 (file)
@@ -9,7 +9,6 @@
 #include "user.h"
 #include "mconsole.h"
 #include "os.h"
-#include "choose-mode.h"
 #include "mode.h"
 
 struct dog_data {
@@ -64,7 +63,7 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)
        }
        else {
                /* XXX The os_getpid() is not SMP correct */
-               sprintf(pid_buf, "%d", CHOOSE_MODE(tracing_pid, os_getpid()));
+               sprintf(pid_buf, "%d", os_getpid());
                args = pid_args;
        }
 
index 4d563b9dde560bbc0a63b605343158f7a1a41ef3..3591c3806670ea196bba06e543f12fb4ef65c9ea 100644 (file)
@@ -33,7 +33,6 @@
 #include "init.h"
 #include "os.h"
 #include "irq_kern.h"
-#include "choose-mode.h"
 
 static int do_unlink_socket(struct notifier_block *notifier,
                            unsigned long what, void *data)
diff --git a/arch/um/include/choose-mode.h b/arch/um/include/choose-mode.h
deleted file mode 100644 (file)
index 51a3876..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* 
- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#ifndef __CHOOSE_MODE_H__
-#define __CHOOSE_MODE_H__
-
-#include "uml-config.h"
-
-#define CHOOSE_MODE(tt, skas) (skas)
-
-#define CHOOSE_MODE_PROC(tt, skas, args...) \
-       CHOOSE_MODE(tt(args), skas(args))
-
-#ifndef __CHOOSE_MODE
-#define __CHOOSE_MODE(tt, skas) CHOOSE_MODE(tt, skas)
-#endif
-
-#endif
diff --git a/arch/um/include/skas/uaccess-skas.h b/arch/um/include/skas/uaccess-skas.h
deleted file mode 100644 (file)
index 224a75f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#ifndef __SKAS_UACCESS_H
-#define __SKAS_UACCESS_H
-
-#include "asm/errno.h"
-
-/* No SKAS-specific checking. */
-#define access_ok_skas(type, addr, size) 0
-
-extern int copy_from_user_skas(void *to, const void __user *from, int n);
-extern int copy_to_user_skas(void __user *to, const void *from, int n);
-extern int strncpy_from_user_skas(char *dst, const char __user *src, int count);
-extern int __clear_user_skas(void __user *mem, int len);
-extern int clear_user_skas(void __user *mem, int len);
-extern int strnlen_user_skas(const void __user *str, int len);
-
-#endif
index c0ea4dbd042b4b745b20663bc4c5fc08bda870ab..45573088864cb6e9692e252cfd1aac460e57a250 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * 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
  */
 
@@ -9,7 +9,6 @@
 #include "uml-config.h"
 #include "user_constants.h"
 #include "sysdep/faultinfo.h"
-#include "choose-mode.h"
 
 #define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long))
 #define MAX_REG_OFFSET (UM_FRAME_SIZE)
@@ -67,40 +66,23 @@ union uml_pt_regs {
 #define EMPTY_UML_PT_REGS { }
 
 #define UPT_SC(r) ((r)->tt.sc)
-#define UPT_IP(r) \
-       __CHOOSE_MODE(SC_IP(UPT_SC(r)), REGS_IP((r)->skas.regs))
-#define UPT_SP(r) \
-       __CHOOSE_MODE(SC_SP(UPT_SC(r)), REGS_SP((r)->skas.regs))
-#define UPT_EFLAGS(r) \
-       __CHOOSE_MODE(SC_EFLAGS(UPT_SC(r)), REGS_EFLAGS((r)->skas.regs))
-#define UPT_EAX(r) \
-       __CHOOSE_MODE(SC_EAX(UPT_SC(r)), REGS_EAX((r)->skas.regs))
-#define UPT_EBX(r) \
-       __CHOOSE_MODE(SC_EBX(UPT_SC(r)), REGS_EBX((r)->skas.regs))
-#define UPT_ECX(r) \
-       __CHOOSE_MODE(SC_ECX(UPT_SC(r)), REGS_ECX((r)->skas.regs))
-#define UPT_EDX(r) \
-       __CHOOSE_MODE(SC_EDX(UPT_SC(r)), REGS_EDX((r)->skas.regs))
-#define UPT_ESI(r) \
-       __CHOOSE_MODE(SC_ESI(UPT_SC(r)), REGS_ESI((r)->skas.regs))
-#define UPT_EDI(r) \
-       __CHOOSE_MODE(SC_EDI(UPT_SC(r)), REGS_EDI((r)->skas.regs))
-#define UPT_EBP(r) \
-       __CHOOSE_MODE(SC_EBP(UPT_SC(r)), REGS_EBP((r)->skas.regs))
-#define UPT_ORIG_EAX(r) \
-       __CHOOSE_MODE((r)->tt.syscall, (r)->skas.syscall)
-#define UPT_CS(r) \
-       __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs))
-#define UPT_SS(r) \
-       __CHOOSE_MODE(SC_SS(UPT_SC(r)), REGS_SS((r)->skas.regs))
-#define UPT_DS(r) \
-       __CHOOSE_MODE(SC_DS(UPT_SC(r)), REGS_DS((r)->skas.regs))
-#define UPT_ES(r) \
-       __CHOOSE_MODE(SC_ES(UPT_SC(r)), REGS_ES((r)->skas.regs))
-#define UPT_FS(r) \
-       __CHOOSE_MODE(SC_FS(UPT_SC(r)), REGS_FS((r)->skas.regs))
-#define UPT_GS(r) \
-       __CHOOSE_MODE(SC_GS(UPT_SC(r)), REGS_GS((r)->skas.regs))
+#define UPT_IP(r) REGS_IP((r)->skas.regs)
+#define UPT_SP(r) REGS_SP((r)->skas.regs)
+#define UPT_EFLAGS(r) REGS_EFLAGS((r)->skas.regs)
+#define UPT_EAX(r) REGS_EAX((r)->skas.regs)
+#define UPT_EBX(r) REGS_EBX((r)->skas.regs)
+#define UPT_ECX(r) REGS_ECX((r)->skas.regs)
+#define UPT_EDX(r) REGS_EDX((r)->skas.regs)
+#define UPT_ESI(r) REGS_ESI((r)->skas.regs)
+#define UPT_EDI(r) REGS_EDI((r)->skas.regs)
+#define UPT_EBP(r) REGS_EBP((r)->skas.regs)
+#define UPT_ORIG_EAX(r) ((r)->skas.syscall)
+#define UPT_CS(r) REGS_CS((r)->skas.regs)
+#define UPT_SS(r) REGS_SS((r)->skas.regs)
+#define UPT_DS(r) REGS_DS((r)->skas.regs)
+#define UPT_ES(r) REGS_ES((r)->skas.regs)
+#define UPT_FS(r) REGS_FS((r)->skas.regs)
+#define UPT_GS(r) REGS_GS((r)->skas.regs)
 
 #define UPT_SYSCALL_ARG1(r) UPT_EBX(r)
 #define UPT_SYSCALL_ARG2(r) UPT_ECX(r)
@@ -111,8 +93,7 @@ union uml_pt_regs {
 
 extern int user_context(unsigned long sp);
 
-#define UPT_IS_USER(r) \
-       CHOOSE_MODE(user_context(UPT_SP(r)), (r)->skas.is_user)
+#define UPT_IS_USER(r) ((r)->skas.is_user)
 
 struct syscall_args {
        unsigned long args[6];
@@ -181,18 +162,14 @@ struct syscall_args {
        } while (0)
 
 #define UPT_SET_SYSCALL_RETURN(r, res) \
-       CHOOSE_MODE(SC_SET_SYSCALL_RETURN(UPT_SC(r), (res)), \
-                    REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res)))
+       REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res))
 
-#define UPT_RESTART_SYSCALL(r) \
-       CHOOSE_MODE(SC_RESTART_SYSCALL(UPT_SC(r)), \
-                   REGS_RESTART_SYSCALL((r)->skas.regs))
+#define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->skas.regs)
 
 #define UPT_ORIG_SYSCALL(r) UPT_EAX(r)
 #define UPT_SYSCALL_NR(r) UPT_ORIG_EAX(r)
 #define UPT_SYSCALL_RET(r) UPT_EAX(r)
 
-#define UPT_FAULTINFO(r) \
-        CHOOSE_MODE((&(r)->tt.faultinfo), (&(r)->skas.faultinfo))
+#define UPT_FAULTINFO(r) (&(r)->skas.faultinfo)
 
 #endif
index ff525bda4c110a262c89c130f299def1277573a7..b3412b64cbea6ab661ef3bbb2b14313ea62654f0 100644 (file)
@@ -84,8 +84,6 @@
 
 #define REGS_ERR(r) ((r)->fault_type)
 
-#include "choose-mode.h"
-
 /* XXX */
 union uml_pt_regs {
        struct skas_regs {
@@ -99,48 +97,45 @@ union uml_pt_regs {
 
 #define EMPTY_UML_PT_REGS { }
 
-#define UPT_RBX(r) __CHOOSE_MODE(SC_RBX(UPT_SC(r)), REGS_RBX((r)->skas.regs))
-#define UPT_RCX(r) __CHOOSE_MODE(SC_RCX(UPT_SC(r)), REGS_RCX((r)->skas.regs))
-#define UPT_RDX(r) __CHOOSE_MODE(SC_RDX(UPT_SC(r)), REGS_RDX((r)->skas.regs))
-#define UPT_RSI(r) __CHOOSE_MODE(SC_RSI(UPT_SC(r)), REGS_RSI((r)->skas.regs))
-#define UPT_RDI(r) __CHOOSE_MODE(SC_RDI(UPT_SC(r)), REGS_RDI((r)->skas.regs))
-#define UPT_RBP(r) __CHOOSE_MODE(SC_RBP(UPT_SC(r)), REGS_RBP((r)->skas.regs))
-#define UPT_RAX(r) __CHOOSE_MODE(SC_RAX(UPT_SC(r)), REGS_RAX((r)->skas.regs))
-#define UPT_R8(r) __CHOOSE_MODE(SC_R8(UPT_SC(r)), REGS_R8((r)->skas.regs))
-#define UPT_R9(r) __CHOOSE_MODE(SC_R9(UPT_SC(r)), REGS_R9((r)->skas.regs))
-#define UPT_R10(r) __CHOOSE_MODE(SC_R10(UPT_SC(r)), REGS_R10((r)->skas.regs))
-#define UPT_R11(r) __CHOOSE_MODE(SC_R11(UPT_SC(r)), REGS_R11((r)->skas.regs))
-#define UPT_R12(r) __CHOOSE_MODE(SC_R12(UPT_SC(r)), REGS_R12((r)->skas.regs))
-#define UPT_R13(r) __CHOOSE_MODE(SC_R13(UPT_SC(r)), REGS_R13((r)->skas.regs))
-#define UPT_R14(r) __CHOOSE_MODE(SC_R14(UPT_SC(r)), REGS_R14((r)->skas.regs))
-#define UPT_R15(r) __CHOOSE_MODE(SC_R15(UPT_SC(r)), REGS_R15((r)->skas.regs))
-#define UPT_CS(r) __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs))
+#define UPT_RBX(r) REGS_RBX((r)->skas.regs)
+#define UPT_RCX(r) REGS_RCX((r)->skas.regs)
+#define UPT_RDX(r) REGS_RDX((r)->skas.regs)
+#define UPT_RSI(r) REGS_RSI((r)->skas.regs)
+#define UPT_RDI(r) REGS_RDI((r)->skas.regs)
+#define UPT_RBP(r) REGS_RBP((r)->skas.regs)
+#define UPT_RAX(r) REGS_RAX((r)->skas.regs)
+#define UPT_R8(r) REGS_R8((r)->skas.regs)
+#define UPT_R9(r) REGS_R9((r)->skas.regs)
+#define UPT_R10(r) REGS_R10((r)->skas.regs)
+#define UPT_R11(r) REGS_R11((r)->skas.regs)
+#define UPT_R12(r) REGS_R12((r)->skas.regs)
+#define UPT_R13(r) REGS_R13((r)->skas.regs)
+#define UPT_R14(r) REGS_R14((r)->skas.regs)
+#define UPT_R15(r) REGS_R15((r)->skas.regs)
+#define UPT_CS(r) REGS_CS((r)->skas.regs)
 #define UPT_FS_BASE(r) \
-       __CHOOSE_MODE(SC_FS_BASE(UPT_SC(r)), REGS_FS_BASE((r)->skas.regs))
-#define UPT_FS(r) __CHOOSE_MODE(SC_FS(UPT_SC(r)), REGS_FS((r)->skas.regs))
+       REGS_FS_BASE((r)->skas.regs)
+#define UPT_FS(r) REGS_FS((r)->skas.regs)
 #define UPT_GS_BASE(r) \
-       __CHOOSE_MODE(SC_GS_BASE(UPT_SC(r)), REGS_GS_BASE((r)->skas.regs))
-#define UPT_GS(r) __CHOOSE_MODE(SC_GS(UPT_SC(r)), REGS_GS((r)->skas.regs))
-#define UPT_DS(r) __CHOOSE_MODE(SC_DS(UPT_SC(r)), REGS_DS((r)->skas.regs))
-#define UPT_ES(r) __CHOOSE_MODE(SC_ES(UPT_SC(r)), REGS_ES((r)->skas.regs))
-#define UPT_CS(r) __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs))
-#define UPT_SS(r) __CHOOSE_MODE(SC_SS(UPT_SC(r)), REGS_SS((r)->skas.regs))
-#define UPT_ORIG_RAX(r) \
-       __CHOOSE_MODE((r)->tt.orig_rax, REGS_ORIG_RAX((r)->skas.regs))
-
-#define UPT_IP(r) __CHOOSE_MODE(SC_IP(UPT_SC(r)), REGS_IP((r)->skas.regs))
-#define UPT_SP(r) __CHOOSE_MODE(SC_SP(UPT_SC(r)), REGS_SP((r)->skas.regs))
-
-#define UPT_EFLAGS(r) \
-       __CHOOSE_MODE(SC_EFLAGS(UPT_SC(r)), REGS_EFLAGS((r)->skas.regs))
+       REGS_GS_BASE((r)->skas.regs)
+#define UPT_GS(r) REGS_GS((r)->skas.regs)
+#define UPT_DS(r) REGS_DS((r)->skas.regs)
+#define UPT_ES(r) REGS_ES((r)->skas.regs)
+#define UPT_CS(r) REGS_CS((r)->skas.regs)
+#define UPT_SS(r) REGS_SS((r)->skas.regs)
+#define UPT_ORIG_RAX(r) REGS_ORIG_RAX((r)->skas.regs)
+
+#define UPT_IP(r) REGS_IP((r)->skas.regs)
+#define UPT_SP(r) REGS_SP((r)->skas.regs)
+
+#define UPT_EFLAGS(r) REGS_EFLAGS((r)->skas.regs)
 #define UPT_SC(r) ((r)->tt.sc)
-#define UPT_SYSCALL_NR(r) __CHOOSE_MODE((r)->tt.syscall, (r)->skas.syscall)
+#define UPT_SYSCALL_NR(r) ((r)->skas.syscall)
 #define UPT_SYSCALL_RET(r) UPT_RAX(r)
 
 extern int user_context(unsigned long sp);
 
-#define UPT_IS_USER(r) \
-       CHOOSE_MODE(user_context(UPT_SP(r)), (r)->skas.is_user)
+#define UPT_IS_USER(r) ((r)->skas.is_user)
 
 #define UPT_SYSCALL_ARG1(r) UPT_RDI(r)
 #define UPT_SYSCALL_ARG2(r) UPT_RSI(r)
@@ -237,18 +232,12 @@ struct syscall_args {
         })
 
 #define UPT_SET_SYSCALL_RETURN(r, res) \
-       CHOOSE_MODE(SC_SET_SYSCALL_RETURN(UPT_SC(r), (res)), \
-                    REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res)))
+       REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res))
 
-#define UPT_RESTART_SYSCALL(r) \
-       CHOOSE_MODE(SC_RESTART_SYSCALL(UPT_SC(r)), \
-                   REGS_RESTART_SYSCALL((r)->skas.regs))
+#define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->skas.regs)
 
-#define UPT_SEGV_IS_FIXABLE(r) \
-       CHOOSE_MODE(SC_SEGV_IS_FIXABLE(UPT_SC(r)), \
-                    REGS_SEGV_IS_FIXABLE(&r->skas))
+#define UPT_SEGV_IS_FIXABLE(r) REGS_SEGV_IS_FIXABLE(&r->skas)
 
-#define UPT_FAULTINFO(r) \
-        CHOOSE_MODE((&(r)->tt.faultinfo), (&(r)->skas.faultinfo))
+#define UPT_FAULTINFO(r) (&(r)->skas.faultinfo)
 
 #endif
index 2461be6b0a60199562c45489c88984a2acf550e6..03bd4b949c04b9e2661e0b3f25929f60077c877b 100644 (file)
@@ -7,7 +7,6 @@
 #define __ARCH_UM_MMU_H
 
 #include "uml-config.h"
-#include "choose-mode.h"
 #include "mmu-skas.h"
 
 typedef union mm_context {
index 6757ee768ccb194b66c713dc78038d490d4ad7c9..b1629b1e142317fc1e8a7a0a8ae1c695cb278c19 100644 (file)
@@ -6,8 +6,6 @@
 #ifndef __ARCH_UM_UACCESS_H
 #define __ARCH_UM_UACCESS_H
 
-#include "choose-mode.h"
-#include "uaccess-skas.h"
 #include "asm/fixmap.h"
 
 #define __under_task_size(addr, size) \
        (__addr_range_nowrap(addr, size) && \
         (__under_task_size(addr, size) || \
          __access_ok_vsyscall(type, addr, size) || \
-         segment_eq(get_fs(), KERNEL_DS) || \
-         CHOOSE_MODE_PROC(access_ok_tt, access_ok_skas, type, addr, size)))
+         segment_eq(get_fs(), KERNEL_DS)))
 
-static inline int copy_from_user(void *to, const void __user *from, int n)
-{
-       return(CHOOSE_MODE_PROC(copy_from_user_tt, copy_from_user_skas, to,
-                               from, n));
-}
-
-static inline int copy_to_user(void __user *to, const void *from, int n)
-{
-       return(CHOOSE_MODE_PROC(copy_to_user_tt, copy_to_user_skas, to, 
-                               from, n));
-}
+extern int copy_from_user(void *to, const void __user *from, int n);
+extern int copy_to_user(void __user *to, const void *from, int n);
 
 /*
  * strncpy_from_user: - Copy a NUL terminated string from userspace.
@@ -61,11 +49,7 @@ static inline int copy_to_user(void __user *to, const void *from, int n)
  * and returns @count.
  */
 
-static inline int strncpy_from_user(char *dst, const char __user *src, int count)
-{
-       return(CHOOSE_MODE_PROC(strncpy_from_user_tt, strncpy_from_user_skas,
-                               dst, src, count));
-}
+extern int strncpy_from_user(char *dst, const char __user *src, int count);
 
 /*
  * __clear_user: - Zero a block of memory in user space, with less checking.
@@ -78,10 +62,7 @@ static inline int strncpy_from_user(char *dst, const char __user *src, int count
  * Returns number of bytes that could not be cleared.
  * On success, this will be zero.
  */
-static inline int __clear_user(void *mem, int len)
-{
-       return(CHOOSE_MODE_PROC(__clear_user_tt, __clear_user_skas, mem, len));
-}
+extern int __clear_user(void __user *mem, int len);
 
 /*
  * clear_user: - Zero a block of memory in user space.
@@ -93,10 +74,7 @@ static inline int __clear_user(void *mem, int len)
  * Returns number of bytes that could not be cleared.
  * On success, this will be zero.
  */
-static inline int clear_user(void __user *mem, int len)
-{
-       return(CHOOSE_MODE_PROC(clear_user_tt, clear_user_skas, mem, len));
-}
+extern int clear_user(void __user *mem, int len);
 
 /*
  * strlen_user: - Get the size of a string in user space.
@@ -109,10 +87,7 @@ static inline int clear_user(void __user *mem, int len)
  * On exception, returns 0.
  * If the string is too long, returns a value greater than @n.
  */
-static inline int strnlen_user(const void __user *str, long len)
-{
-       return(CHOOSE_MODE_PROC(strnlen_user_tt, strnlen_user_skas, str, len));
-}
+extern int strnlen_user(const void __user *str, int len);
 
 #endif
 
index 84d77a0d138c20f41c1a0b3f883e620e51395553..8f774c25b7653295e60d1c0e83100b072881683c 100644 (file)
 #include "irq_user.h"
 #include "tlb.h"
 #include "os.h"
-#include "choose-mode.h"
 #include "mode_kern.h"
 
 void flush_thread(void)
 {
        arch_flush_thread(&current->thread.arch);
-       CHOOSE_MODE(flush_thread_tt(), flush_thread_skas());
+       flush_thread_skas();
 }
 
 void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
 {
-       CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp);
+       start_thread_skas(regs, eip, esp);
 }
 
 #ifdef CONFIG_TTY_LOG
index 59e22d27b239669c8c5bb4ada73aa1e07004dc45..996412c0bb47cccdef43aa846d26032b6ead7cd1 100644 (file)
@@ -37,11 +37,11 @@ EXPORT_SYMBOL(um_virt_to_phys);
 EXPORT_SYMBOL(handle_page_fault);
 EXPORT_SYMBOL(find_iomem);
 
-EXPORT_SYMBOL(strnlen_user_skas);
-EXPORT_SYMBOL(strncpy_from_user_skas);
-EXPORT_SYMBOL(copy_to_user_skas);
-EXPORT_SYMBOL(copy_from_user_skas);
-EXPORT_SYMBOL(clear_user_skas);
+EXPORT_SYMBOL(strnlen_user);
+EXPORT_SYMBOL(strncpy_from_user);
+EXPORT_SYMBOL(copy_to_user);
+EXPORT_SYMBOL(copy_from_user);
+EXPORT_SYMBOL(clear_user);
 EXPORT_SYMBOL(uml_strdup);
 
 EXPORT_SYMBOL(os_stat_fd);
index fb695e48fad70631e0328a65037583c819d0af5e..f7b2f3594793ec40a7442836648e10eaa2d37d45 100644 (file)
@@ -61,7 +61,7 @@ static unsigned long kmem_top = 0;
 unsigned long get_kmem_end(void)
 {
        if (kmem_top == 0)
-               kmem_top = CHOOSE_MODE(kmem_end_tt, kmem_end_skas);
+               kmem_top = kmem_end_skas;
        return kmem_top;
 }
 
index 005ed44d4a8ec4db5e39055709ac912a81028def..22ad46fd2c0833d430b6480c67be2c4c85d67d89 100644 (file)
@@ -45,7 +45,6 @@
 #include "os.h"
 #include "mode.h"
 #include "mode_kern.h"
-#include "choose-mode.h"
 
 /* This is a per-cpu array.  A processor only modifies its entry and it only
  * cares about its entry, so it's OK if another processor is modifying its
@@ -55,7 +54,7 @@ struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } };
 
 static inline int external_pid(struct task_struct *task)
 {
-       return CHOOSE_MODE_PROC(external_pid_tt, external_pid_skas, task);
+       return external_pid_skas(task);
 }
 
 int pid_to_processor_id(int pid)
@@ -114,8 +113,8 @@ void *_switch_to(void *prev, void *next, void *last)
        set_current(to);
 
        do {
-               current->thread.saved_task = NULL ;
-               CHOOSE_MODE_PROC(switch_to_tt, switch_to_skas, prev, next);
+               current->thread.saved_task = NULL;
+               switch_to_skas(prev, next);
                if(current->thread.saved_task)
                        show_regs(&(current->thread.regs));
                next= current->thread.saved_task;
@@ -136,7 +135,7 @@ void interrupt_end(void)
 
 void release_thread(struct task_struct *task)
 {
-       CHOOSE_MODE(release_thread_tt(task), release_thread_skas(task));
+       release_thread_skas(task);
 }
 
 void exit_thread(void)
@@ -155,8 +154,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
        int ret;
 
        p->thread = (struct thread_struct) INIT_THREAD;
-       ret = CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr,
-                               clone_flags, sp, stack_top, p, regs);
+       ret = copy_thread_skas(nr, clone_flags, sp, stack_top, p, regs);
 
        if (ret || !current->thread.forking)
                goto out;
@@ -178,15 +176,12 @@ void initial_thread_cb(void (*proc)(void *), void *arg)
        int save_kmalloc_ok = kmalloc_ok;
 
        kmalloc_ok = 0;
-       CHOOSE_MODE_PROC(initial_thread_cb_tt, initial_thread_cb_skas, proc,
-                        arg);
+       initial_thread_cb_skas(proc, arg);
        kmalloc_ok = save_kmalloc_ok;
 }
 
 void default_idle(void)
 {
-       CHOOSE_MODE(uml_idle_timer(), (void) 0);
-
        while(1){
                /* endless idle loop with no priority at all */
 
@@ -203,7 +198,7 @@ void default_idle(void)
 
 void cpu_idle(void)
 {
-       CHOOSE_MODE(init_idle_tt(), init_idle_skas());
+       init_idle_skas();
 }
 
 void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
index 93df0672d02230ba19e13266946d1b01445179b6..4a0def32e32327edf4f586e421e97a60b4f92617 100644 (file)
 #include "kern.h"
 #include "os.h"
 #include "mode.h"
-#include "choose-mode.h"
 
 void (*pm_power_off)(void);
 
 static void kill_off_processes(void)
 {
-       CHOOSE_MODE(kill_off_processes_tt(), kill_off_processes_skas());
+       kill_off_processes_skas();
 }
 
 void uml_cleanup(void)
@@ -29,13 +28,13 @@ void uml_cleanup(void)
 void machine_restart(char * __unused)
 {
         uml_cleanup();
-       CHOOSE_MODE(reboot_tt(), reboot_skas());
+       reboot_skas();
 }
 
 void machine_power_off(void)
 {
         uml_cleanup();
-       CHOOSE_MODE(halt_tt(), halt_skas());
+       halt_skas();
 }
 
 void machine_halt(void)
index 8912cec0fe43380cb6761e088099c04dccd1bfaf..b14422e2c07c0bd35f30942b6fbde08c1511701b 100644 (file)
@@ -139,7 +139,7 @@ static int copy_chunk_from_user(unsigned long from, int len, void *arg)
        return(0);
 }
 
-int copy_from_user_skas(void *to, const void __user *from, int n)
+int copy_from_user(void *to, const void __user *from, int n)
 {
        if(segment_eq(get_fs(), KERNEL_DS)){
                memcpy(to, (__force void*)from, n);
@@ -160,7 +160,7 @@ static int copy_chunk_to_user(unsigned long to, int len, void *arg)
        return(0);
 }
 
-int copy_to_user_skas(void __user *to, const void *from, int n)
+int copy_to_user(void __user *to, const void *from, int n)
 {
        if(segment_eq(get_fs(), KERNEL_DS)){
                memcpy((__force void*)to, from, n);
@@ -186,7 +186,7 @@ static int strncpy_chunk_from_user(unsigned long from, int len, void *arg)
        return(0);
 }
 
-int strncpy_from_user_skas(char *dst, const char __user *src, int count)
+int strncpy_from_user(char *dst, const char __user *src, int count)
 {
        int n;
        char *ptr = dst;
@@ -212,12 +212,12 @@ static int clear_chunk(unsigned long addr, int len, void *unused)
        return(0);
 }
 
-int __clear_user_skas(void __user *mem, int len)
+int __clear_user(void __user *mem, int len)
 {
        return(buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL));
 }
 
-int clear_user_skas(void __user *mem, int len)
+int clear_user(void __user *mem, int len)
 {
        if(segment_eq(get_fs(), KERNEL_DS)){
                memset((__force void*)mem, 0, len);
@@ -240,7 +240,7 @@ static int strnlen_chunk(unsigned long str, int len, void *arg)
        return(0);
 }
 
-int strnlen_user_skas(const void __user *str, int len)
+int strnlen_user(const void __user *str, int len)
 {
        int count = 0, n;
 
index 7b3b67333ff31c2b4c418308b7cec9ff36b9d951..138bcb43b997df6f1c1f24410ca5e0b2be9d7b4c 100644 (file)
@@ -21,7 +21,6 @@
 #include "kern_util.h"
 #include "sysdep/syscalls.h"
 #include "mode_kern.h"
-#include "choose-mode.h"
 
 /*  Unlocked, I don't care if this is a bit off */
 int nsyscalls = 0;
index 259c49da7ff501fd4eca0761deb1b45277172a77..3571703a7cb4303aecba3ec96065b04e1be64b67 100644 (file)
@@ -181,9 +181,7 @@ void timer_handler(int sig, union uml_pt_regs *regs)
                timer_irq(regs);
        local_irq_disable();
        irq_enter();
-       update_process_times(CHOOSE_MODE(
-                            (UPT_SC(regs) && user_context(UPT_SP(regs))),
-                            (regs)->skas.is_user));
+       update_process_times((regs)->skas.is_user);
        irq_exit();
        local_irq_enable();
 }
index 8a8d52851443bf33cc7e82ffb40f65b6ddf8dc68..312e8ba30cd3d1ab472e23ae040b92472f0bcaec 100644 (file)
@@ -8,7 +8,6 @@
 #include "asm/pgalloc.h"
 #include "asm/pgtable.h"
 #include "asm/tlbflush.h"
-#include "choose-mode.h"
 #include "mode_kern.h"
 #include "as-layout.h"
 #include "tlb.h"
@@ -378,35 +377,31 @@ void flush_tlb_all(void)
 
 void flush_tlb_kernel_range(unsigned long start, unsigned long end)
 {
-       CHOOSE_MODE_PROC(flush_tlb_kernel_range_tt,
-                        flush_tlb_kernel_range_common, start, end);
+       flush_tlb_kernel_range_common(start, end);
 }
 
 void flush_tlb_kernel_vm(void)
 {
-       CHOOSE_MODE(flush_tlb_kernel_vm_tt(),
-                   flush_tlb_kernel_range_common(start_vm, end_vm));
+       flush_tlb_kernel_range_common(start_vm, end_vm);
 }
 
 void __flush_tlb_one(unsigned long addr)
 {
-       CHOOSE_MODE_PROC(__flush_tlb_one_tt, __flush_tlb_one_skas, addr);
+       __flush_tlb_one_skas(addr);
 }
 
 void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
                     unsigned long end)
 {
-       CHOOSE_MODE_PROC(flush_tlb_range_tt, flush_tlb_range_skas, vma, start,
-                        end);
+       flush_tlb_range_skas(vma, start, end);
 }
 
 void flush_tlb_mm(struct mm_struct *mm)
 {
-       CHOOSE_MODE_PROC(flush_tlb_mm_tt, flush_tlb_mm_skas, mm);
+       flush_tlb_mm_skas(mm);
 }
 
 void force_flush_all(void)
 {
-       CHOOSE_MODE(force_flush_all_tt(), force_flush_all_skas());
+       force_flush_all_skas();
 }
-
index aa7b067565d9ffe5870b34eaeff80a131994f389..9f3a207eb81f2ff2d055fdb6f18ae94680f011d4 100644 (file)
@@ -35,7 +35,6 @@
 #include "initrd.h"
 #include "init.h"
 #include "os.h"
-#include "choose-mode.h"
 #include "mode_kern.h"
 #include "mode.h"
 #include "skas.h"
@@ -68,8 +67,7 @@ struct cpuinfo_um boot_cpu_data = {
 
 unsigned long thread_saved_pc(struct task_struct *task)
 {
-       return os_process_pc(CHOOSE_MODE_PROC(thread_pid_tt, thread_pid_skas,
-                                             task));
+       return os_process_pc(thread_pid_skas(task));
 }
 
 /* Changed in setup_arch, which is called in early boot */
@@ -88,7 +86,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        seq_printf(m, "processor\t: %d\n", index);
        seq_printf(m, "vendor_id\t: User Mode Linux\n");
        seq_printf(m, "model name\t: UML\n");
-       seq_printf(m, "mode\t\t: %s\n", CHOOSE_MODE("tt", "skas"));
+       seq_printf(m, "mode\t\t: skas\n");
        seq_printf(m, "host\t\t: %s\n", host_info);
        seq_printf(m, "bogomips\t: %lu.%02lu\n\n",
                   loops_per_jiffy/(500000/HZ),
@@ -283,8 +281,7 @@ int __init linux_main(int argc, char **argv)
 
        printf("UML running in %s mode\n", mode);
 
-       host_task_size = CHOOSE_MODE_PROC(set_task_sizes_tt,
-                                         set_task_sizes_skas, &task_size);
+       host_task_size = set_task_sizes_skas(&task_size);
 
        /*
         * Setting up handlers to 'sig_info' struct
@@ -292,7 +289,7 @@ int __init linux_main(int argc, char **argv)
        os_fill_handlinfo(handlinfo_kern);
 
        brk_start = (unsigned long) sbrk(0);
-       CHOOSE_MODE_PROC(before_mem_tt, before_mem_skas, brk_start);
+       before_mem_skas(brk_start);
        /* Increase physical memory size for exec-shield users
        so they actually get what they asked for. This should
        add zero for non-exec shield users */
@@ -357,7 +354,7 @@ int __init linux_main(int argc, char **argv)
        stack_protections((unsigned long) &init_thread_info);
        os_flush_stdout();
 
-       return CHOOSE_MODE(start_uml_tt(), start_uml_skas());
+       return start_uml_skas();
 }
 
 extern int uml_exitcode;
index 59348359f9ab3bd0bdf9b469ce850937e0052c36..c8f5b7a2c1c6143c4d80afad258da4566fbce620 100644 (file)
@@ -320,11 +320,6 @@ static int init_aio(void)
 {
        int err;
 
-       CHOOSE_MODE(({ if(!aio_24){
-                           printk("Disabling 2.6 AIO in tt mode\n");
-                           aio_24 = 1;
-                   } }), (void) 0);
-
        if(!aio_24){
                err = init_aio_26();
                if(err && (errno == ENOSYS)){
index 425aa8960649323b9a290e3eff95dae4be7090cb..bfabb883daae38ef1c63d169c2e59f5cd47e6071 100644 (file)
@@ -19,7 +19,6 @@
 #include "user.h"
 #include "init.h"
 #include "mode.h"
-#include "choose-mode.h"
 #include "uml-config.h"
 #include "os.h"
 #include "um_malloc.h"
@@ -189,16 +188,13 @@ int __init main(int argc, char **argv, char **envp)
        return uml_exitcode;
 }
 
-#define CAN_KMALLOC() \
-       (kmalloc_ok && CHOOSE_MODE((os_getpid() != tracing_pid), 1))
-
 extern void *__real_malloc(int);
 
 void *__wrap_malloc(int size)
 {
        void *ret;
 
-       if(!CAN_KMALLOC())
+       if(!kmalloc_ok)
                return __real_malloc(size);
        else if(size <= UM_KERN_PAGE_SIZE)
                /* finding contiguous pages can be hard*/
@@ -251,11 +247,11 @@ void __wrap_free(void *ptr)
         */
 
        if((addr >= uml_physmem) && (addr < high_physmem)){
-               if(CAN_KMALLOC())
+               if(kmalloc_ok)
                        kfree(ptr);
        }
        else if((addr >= start_vm) && (addr < end_vm)){
-               if(CAN_KMALLOC())
+               if(kmalloc_ok)
                        vfree(ptr);
        }
        else __real_free(ptr);
index b98f7ea2d2f6562ce894e4a4fe6f57b003af7768..0d6122adb8a789919052cbfbaadf9878e0c57a25 100644 (file)
@@ -53,8 +53,7 @@ void sig_handler(int sig, struct sigcontext *sc)
 
        block_signals();
 
-       CHOOSE_MODE_PROC(sig_handler_common_tt, sig_handler_common_skas,
-                        sig, sc);
+       sig_handler_common_skas(sig, sc);
 
        set_signals(enabled);
 }
@@ -257,8 +256,7 @@ void unblock_signals(void)
                 * back here.
                 */
                if(save_pending & SIGIO_MASK)
-                       CHOOSE_MODE_PROC(sig_handler_common_tt,
-                                        sig_handler_common_skas, SIGIO, NULL);
+                       sig_handler_common_skas(SIGIO, NULL);
 
                if(save_pending & SIGALRM_MASK)
                        real_alarm_handler(SIGALRM, NULL);
index acf52ea4ff52f2933198c7f18425b55be527d503..da5c90df5c9e2dc899c0a2a7b509d2a4203f9464 100644 (file)
@@ -31,7 +31,6 @@
 #include "init.h"
 #include "os.h"
 #include "uml-config.h"
-#include "choose-mode.h"
 #include "mode.h"
 #include "tempfile.h"
 #include "kern_constants.h"
index 295da657931ab54fef6d3f1cb308cf002f0454f7..b17f546c3655b67e00302092f47fbf8c35773fa0 100644 (file)
@@ -12,7 +12,6 @@
 
 void usr2_handler(int sig, union uml_pt_regs *regs)
 {
-       CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0);
 }
 
 /* Initialized from linux_main() */
index 762a12aec7578c2a6f4d7f3c9a3076e09dae99c3..2683d302395d82391b5caf33853ece573f3907e5 100644 (file)
@@ -12,7 +12,6 @@
 #include "asm/smp.h"
 #include "asm/ldt.h"
 #include "asm/unistd.h"
-#include "choose-mode.h"
 #include "kern.h"
 #include "mode_kern.h"
 #include "os.h"
@@ -506,6 +505,5 @@ void free_ldt(struct mmu_context_skas * mm)
 
 int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
 {
-       return CHOOSE_MODE_PROC(do_modify_ldt_tt, do_modify_ldt_skas, func,
-                               ptr, bytecount);
+       return do_modify_ldt_skas(func, ptr, bytecount);
 }
index 572fd504b94b99fc3f457f803b5d32a95d778330..7792365827a2cd165c2ec6425467a5e418f3ef2d 100644 (file)
@@ -230,13 +230,13 @@ static inline unsigned long twd_fxsr_to_i387( struct i387_fxsave_struct *fxsave
 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));
+       return 0;
 }
 
 static inline int convert_fxsr_from_user(struct pt_regs *regs, 
                                         struct _fpstate __user *buf)
 {
-       return(CHOOSE_MODE(convert_fxsr_from_user_tt(regs, buf), 0));
+       return 0;
 }
 
 int get_fpregs(unsigned long buf, struct task_struct *child)
@@ -261,12 +261,12 @@ int set_fpregs(unsigned long buf, struct task_struct *child)
 
 int get_fpxregs(unsigned long buf, struct task_struct *tsk)
 {
-       return(CHOOSE_MODE(get_fpxregs_tt(buf, tsk), 0));
+       return 0;
 }
 
 int set_fpxregs(unsigned long buf, struct task_struct *tsk)
 {
-       return(CHOOSE_MODE(set_fpxregs_tt(buf, tsk), 0));
+       return 0;
 }
 
 #ifdef notdef
@@ -286,16 +286,9 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
 }
 #endif
 
-static inline void copy_fpu_fxsave(struct pt_regs *regs,
-                                  struct user_i387_struct *buf)
-{
-       (void) CHOOSE_MODE(copy_fpu_fxsave_tt(regs, buf), 0);
-}
-
 int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu )
 {
-       copy_fpu_fxsave(regs, (struct user_i387_struct *) fpu);
-       return(1);
+       return 1;
 }
 
 /*
index 187ea27536bd004bf50d91d4727272109141b3d6..a9fe8d6f72c31eb3cb51404fe2714ea4b8292611 100644 (file)
@@ -12,7 +12,6 @@
 #include "frame_kern.h"
 #include "sigcontext.h"
 #include "registers.h"
-#include "mode.h"
 #include "skas.h"
 
 void copy_sc(union uml_pt_regs *regs, void *from)
@@ -108,20 +107,13 @@ int copy_sc_to_user_skas(struct sigcontext __user *to, struct _fpstate __user *t
 
 static int copy_sc_from_user(struct pt_regs *to, void __user *from)
 {
-       int ret;
-
-       ret = CHOOSE_MODE(copy_sc_from_user_tt(UPT_SC(&to->regs), from,
-                                              sizeof(struct _fpstate)),
-                         copy_sc_from_user_skas(to, from));
-       return ret;
+       return copy_sc_from_user_skas(to, from);
 }
 
 static int copy_sc_to_user(struct sigcontext __user *to, struct _fpstate __user *fp,
                           struct pt_regs *from, unsigned long sp)
 {
-       return CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs),
-                                             sizeof(*fp), sp),
-                           copy_sc_to_user_skas(to, fp, from, sp));
+       return copy_sc_to_user_skas(to, fp, from, sp);
 }
 
 static int copy_ucontext_to_user(struct ucontext __user *uc, struct _fpstate __user *fp,
index 0340b96d101b7ad2431102c53e649b9f550af17a..bb4d0e23aa81196bf85e807b7c2857b9a4864d80 100644 (file)
@@ -12,7 +12,6 @@
 #include "asm/segment.h"
 #include "asm/smp.h"
 #include "asm/desc.h"
-#include "choose-mode.h"
 #include "kern.h"
 #include "kern_util.h"
 #include "mode_kern.h"
@@ -28,7 +27,7 @@
 static int host_supports_tls = -1;
 int host_gdt_entry_tls_min;
 
-int do_set_thread_area_skas(struct user_desc *info)
+int do_set_thread_area(struct user_desc *info)
 {
        int ret;
        u32 cpu;
@@ -39,7 +38,7 @@ int do_set_thread_area_skas(struct user_desc *info)
        return ret;
 }
 
-int do_get_thread_area_skas(struct user_desc *info)
+int do_get_thread_area(struct user_desc *info)
 {
        int ret;
        u32 cpu;
@@ -277,7 +276,7 @@ asmlinkage int sys_set_thread_area(struct user_desc __user *user_desc)
                        return -EFAULT;
        }
 
-       ret = CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, &info);
+       ret = do_set_thread_area(&info);
        if (ret)
                return ret;
        return set_tls_entry(current, &info, idx, 1);
index c18d929e69bcb417a9fd2a89872e14bea7344ff2..2d6cdd260c2652a87fe79a5ca7a4cc433ffe0039 100644 (file)
@@ -12,7 +12,6 @@
 #include "asm/sigcontext.h"
 #include "asm/ptrace.h"
 #include "asm/arch/ucontext.h"
-#include "choose-mode.h"
 #include "sysdep/ptrace.h"
 #include "frame_kern.h"
 #include "skas.h"
@@ -135,9 +134,7 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from)
 {
        int ret;
 
-       ret = CHOOSE_MODE(copy_sc_from_user_tt(UPT_SC(&to->regs), from,
-                                              sizeof(struct _fpstate)),
-                         copy_sc_from_user_skas(to, from));
+       ret = copy_sc_from_user_skas(to, from);
        return(ret);
 }
 
@@ -146,9 +143,7 @@ static int copy_sc_to_user(struct sigcontext __user *to,
                           struct pt_regs *from, unsigned long mask,
                           unsigned long sp)
 {
-       return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs),
-                                             sizeof(*fp), sp),
-                          copy_sc_to_user_skas(to, fp, from, mask, sp)));
+       return copy_sc_to_user_skas(to, fp, from, mask, sp);
 }
 
 struct rt_sigframe
index d0ff832c9eaf7634d9d3c6dc99fc3675e9bc694b..d44398c9d27ad687cfad9eb97f049eb00a178b25 100644 (file)
@@ -14,7 +14,6 @@
 #include "asm/ptrace.h"
 #include "asm/unistd.h"
 #include "asm/prctl.h" /* XXX This should get the constants from libc */
-#include "choose-mode.h"
 #include "kern.h"
 #include "os.h"
 
@@ -92,8 +91,7 @@ long arch_prctl_skas(struct task_struct *task, int code,
 
 long sys_arch_prctl(int code, unsigned long addr)
 {
-       return CHOOSE_MODE_PROC(arch_prctl_tt, arch_prctl_skas, current, code,
-                                (unsigned long __user *) addr);
+       return arch_prctl_skas(current, code, (unsigned long __user *) addr);
 }
 
 long sys_clone(unsigned long clone_flags, unsigned long newsp,
index 78bc9eed26b2b2b030171ab27fae694be72f9036..7912f0997cbc8fe473b8642cf2960b78f1bf4e96 100644 (file)
@@ -2,7 +2,6 @@
 #define __UM_A_OUT_H
 
 #include "asm/arch/a.out.h"
-#include "choose-mode.h"
 
 #undef STACK_TOP
 #undef STACK_TOP_MAX
@@ -13,10 +12,8 @@ extern unsigned long host_task_size;
 
 #define STACK_ROOM (stacksizelim)
 
-extern int honeypot;
-#define STACK_TOP \
-       CHOOSE_MODE((honeypot ? host_task_size : task_size), task_size)
+#define STACK_TOP task_size
 
-#define STACK_TOP_MAX  STACK_TOP
+#define STACK_TOP_MAX STACK_TOP
 
 #endif
index 92b0a703fb9e1ee6bbc87116ac58c9fb5ebedd52..a4186af65f246d33920be6044830a8f98bc5c1e8 100644 (file)
@@ -9,7 +9,6 @@
 #include <asm-generic/mm_hooks.h>
 
 #include "linux/sched.h"
-#include "choose-mode.h"
 #include "um_mmu.h"
 
 #define get_mmu_context(task) do ; while(0)
@@ -30,8 +29,7 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
         * possible.
         */
        if (old != new && (current->flags & PF_BORROWED_MM))
-               CHOOSE_MODE(force_flush_all(),
-                           switch_mm_skas(&new->context.skas.id));
+               switch_mm_skas(&new->context.skas.id);
 }
 
 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 
@@ -43,8 +41,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
                cpu_clear(cpu, prev->cpu_vm_mask);
                cpu_set(cpu, next->cpu_vm_mask);
                if(next != &init_mm)
-                       CHOOSE_MODE((void) 0, 
-                                   switch_mm_skas(&next->context.skas.id));
+                       switch_mm_skas(&next->context.skas.id);
        }
 }
 
@@ -59,15 +56,14 @@ extern int init_new_context_skas(struct task_struct *task,
 static inline int init_new_context(struct task_struct *task, 
                                   struct mm_struct *mm)
 {
-       return(CHOOSE_MODE_PROC(init_new_context_tt, init_new_context_skas, 
-                               task, mm));
+       return(init_new_context_skas(task, mm));
 }
 
 extern void destroy_context_skas(struct mm_struct *mm);
 
 static inline void destroy_context(struct mm_struct *mm)
 {
-       CHOOSE_MODE((void) 0, destroy_context_skas(mm));
+       destroy_context_skas(mm);
 }
 
 #endif
index 70c8183d1db099fe6e2ad027ea5c67123e06da2e..be3ffec3a6a6ea29ee67f635a3675ee4ce7ea3ae 100644 (file)
@@ -11,7 +11,6 @@ struct pt_regs;
 struct task_struct;
 
 #include "asm/ptrace.h"
-#include "choose-mode.h"
 #include "registers.h"
 #include "sysdep/archsetjmp.h"
 
index 6e2528bb0083ee4039cc30a5f3ee5aae3bb67e79..4928a31aca7d209f3fda3d19f6d781b1c899d636 100644 (file)
@@ -12,7 +12,6 @@
 #include "sysdep/ptrace.h"
 #include "asm/ptrace-generic.h"
 #include "asm/host_ldt.h"
-#include "choose-mode.h"
 
 #define PT_REGS_EAX(r) UPT_EAX(&(r)->regs)
 #define PT_REGS_EBX(r) UPT_EBX(&(r)->regs)
@@ -59,15 +58,8 @@ extern int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to);
 extern void arch_switch_to_tt(struct task_struct *from, struct task_struct *to);
 extern void arch_switch_to_skas(struct task_struct *from, struct task_struct *to);
 
-static inline int do_get_thread_area(struct user_desc *info)
-{
-       return CHOOSE_MODE_PROC(do_get_thread_area_tt, do_get_thread_area_skas, info);
-}
-
-static inline int do_set_thread_area(struct user_desc *info)
-{
-       return CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, info);
-}
+extern int do_get_thread_area_skas(struct user_desc *info);
+extern int do_set_thread_area_skas(struct user_desc *info);
 
 struct task_struct;
 
index e78c28c1f350e4bf045feca53c6c6d5fc1aff6b7..7912e18d93e3b3ff7e6cf56faca2b6837b4ac34e 100644 (file)
@@ -7,7 +7,6 @@
 #define __UM_TLBFLUSH_H
 
 #include <linux/mm.h>
-#include "choose-mode.h"
 
 /*
  * TLB flushing:
@@ -31,10 +30,7 @@ extern void flush_tlb_page_skas(struct vm_area_struct *vma,
 static inline void flush_tlb_page(struct vm_area_struct *vma,
                                  unsigned long address)
 {
-       address &= PAGE_MASK;
-
-       CHOOSE_MODE(flush_tlb_range(vma, address, address + PAGE_SIZE),
-                   flush_tlb_page_skas(vma, address));
+       flush_tlb_page_skas(vma, address & PAGE_MASK);
 }
 
 extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
index 16c734af9193c8442fbed9ff7d561420ec8157ec..077032d4fc47f13c167ea67463646d6519700b62 100644 (file)
@@ -80,7 +80,7 @@
         __put_user(x, private_ptr) : -EFAULT); \
 })
 
-#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
+#define strlen_user(str) strnlen_user(str, ~0U >> 1)
 
 struct exception_table_entry
 {